{"action":"created","issue":{"url":"https://api.github.com/repos/google/gopacket/issues/367","repository_url":"https://api.github.com/repos/google/gopacket","labels_url":"https://api.github.com/repos/google/gopacket/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/google/gopacket/issues/367/comments","events_url":"https://api.github.com/repos/google/gopacket/issues/367/events","html_url":"https://github.com/google/gopacket/issues/367","id":264247050,"number":367,"title":"Memory allocations inside pcap getNextBufPtrLocked","user":{"login":"JustinAzoff","id":65812,"avatar_url":"https://avatars2.githubusercontent.com/u/65812?v=4","gravatar_id":"","url":"https://api.github.com/users/JustinAzoff","html_url":"https://github.com/JustinAzoff","followers_url":"https://api.github.com/users/JustinAzoff/followers","following_url":"https://api.github.com/users/JustinAzoff/following{/other_user}","gists_url":"https://api.github.com/users/JustinAzoff/gists{/gist_id}","starred_url":"https://api.github.com/users/JustinAzoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JustinAzoff/subscriptions","organizations_url":"https://api.github.com/users/JustinAzoff/orgs","repos_url":"https://api.github.com/users/JustinAzoff/repos","events_url":"https://api.github.com/users/JustinAzoff/events{/privacy}","received_events_url":"https://api.github.com/users/JustinAzoff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-10T14:20:55Z","updated_at":"2017-10-10T16:22:35Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\n\r\nI believe I am seeing memory allocations while using handle.ZeroCopyReadPacketData from pcap package.\r\n\r\nUsing this test program:\r\n\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"log\"\r\n\t\"os\"\r\n\t\"runtime\"\r\n\t\"runtime/pprof\"\r\n\r\n\t\"github.com/google/gopacket/pcap\"\r\n)\r\n\r\nfunc main() {\r\n\r\n\tvar err error\r\n\thandle, err := pcap.OpenLive(os.Args[1], 9000, true, pcap.BlockForever)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tvar m runtime.MemStats\r\n\tfor i := 0; i < 1000000; i++ {\r\n\t\t_, _, err := handle.ZeroCopyReadPacketData()\r\n\t\tif err != nil {\r\n\t\t\tprintln(err)\r\n\t\t}\r\n\t\tif i%100000 == 0 {\r\n\t\t\truntime.ReadMemStats(&m)\r\n\t\t\tlog.Printf(\"Alloc = %v TotalAlloc = %v Sys = %v NumGC = %v\\n\", m.Alloc/1024, m.TotalAlloc/1024, m.Sys/1024, m.NumGC)\r\n\t\t}\r\n\t}\r\n\r\n\tf, err := os.Create(\"sniff.profile\")\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tpprof.WriteHeapProfile(f)\r\n\tf.Close()\r\n}\r\n```\r\n\r\nI get the following output:\r\n\r\n```\r\n2017/10/10 10:06:43 Alloc = 16678 TotalAlloc = 18147 Sys = 20870 NumGC = 3\r\n2017/10/10 10:06:51 Alloc = 19832 TotalAlloc = 21300 Sys = 25418 NumGC = 3\r\n2017/10/10 10:06:53 Alloc = 16770 TotalAlloc = 24434 Sys = 28650 NumGC = 4\r\n2017/10/10 10:06:55 Alloc = 19905 TotalAlloc = 27569 Sys = 28714 NumGC = 4\r\n2017/10/10 10:06:58 Alloc = 23040 TotalAlloc = 30704 Sys = 28778 NumGC = 4\r\n2017/10/10 10:07:00 Alloc = 26174 TotalAlloc = 33838 Sys = 32014 NumGC = 4\r\n2017/10/10 10:07:02 Alloc = 29308 TotalAlloc = 36972 Sys = 35506 NumGC = 4\r\n2017/10/10 10:07:05 Alloc = 17191 TotalAlloc = 40105 Sys = 38806 NumGC = 5\r\n2017/10/10 10:07:07 Alloc = 20326 TotalAlloc = 43240 Sys = 38806 NumGC = 5\r\n2017/10/10 10:07:09 Alloc = 23460 TotalAlloc = 46374 Sys = 38870 NumGC = 5\r\n```\r\n\r\nSo it looks like that every 100000 packets causes ~3000 allocations\r\n\r\nThe pprof shows that the allocations are from getNextBufPtrLocked:\r\n\r\n```\r\n         .          .    357:\tfor atomic.LoadUint64(&p.stop) == 0 {\r\n         .          .    358:\t\t// try to read a packet if one is immediately available\r\n    327684     327684    359:\t\tresult := NextError(C.pcap_next_ex(p.cptr, &p.pkthdr, &p.bufptr))\r\n         .          .    360:\r\n         .          .    361:\t\tswitch result {\r\n         .          .    362:\t\tcase NextErrorOk:\r\n         .          .    363:\t\t\t// got a packet, set capture info and return\r\n         .          .    364:\t\t\tsec := int64(p.pkthdr.ts.tv_sec)\r\n\r\n```\r\nThe pprof output gets a little confusing.. it shows two profiles when using list,\r\n\r\n`getNextBufPtrLocked in /go/src/github.com/google/gopacket/pcap/pcap.go`\r\n\r\nand\r\n\r\n`getNextBufPtrLocked.func1`\r\n\r\n`disasm getNextBufPtrLocked` shows:\r\n\r\n```\r\n(pprof) disasm .getNextBufPtrLocked\r\nTotal: 993980\r\nROUTINE ======================== github.com/google/gopacket/pcap.(*Handle).getNextBufPtrLocked\r\n         0     327684 (flat, cum) 32.97% of Total\r\n         .          .    411fe20: MOVQ GS:0x8a0, CX\t                      ;pcap.go:352\r\n         .          .    411fe29: CMPQ 0x10(CX), SP\r\n         .          .    411fe2d: JBE 0x412005e\r\n         .          .    411fe33: SUBQ $0x30, SP\r\n         .          .    411fe37: MOVQ BP, 0x28(SP)\r\n         .          .    411fe3c: LEAQ 0x28(SP), BP\r\n         .          .    411fe41: MOVQ 0x38(SP), AX\r\n         .          .    411fe46: MOVQ 0(AX), CX\t                         ;pcap.go:353\r\n         .          .    411fe49: TESTQ CX, CX\r\n         .          .    411fe4c: JE 0x412003c\r\n         .          .    411fe52: MOVQ 0x38(AX), CX\t                      ;pcap.go:357\r\n         .          .    411fe56: TESTQ CX, CX\r\n         .          .    411fe59: JNE 0x412001a\r\n         .          .    411fe5f: MOVQ 0(AX), CX\t                         ;pcap.go:359\r\n         .          .    411fe62: LEAQ 0x48(AX), DX\r\n         .          .    411fe66: MOVQ DX, 0x10(SP)\r\n         .          .    411fe6b: MOVQ CX, 0(SP)\r\n         .          .    411fe6f: LEAQ 0x40(AX), CX\r\n         .          .    411fe73: MOVQ CX, 0x8(SP)\r\n                                                                          ;github.com/google/gopacket/pcap.(*Handle).getNextBufPtrLocked pcap.go:359\r\n         .     327684    411fe78: CALL github.com/google/gopacket/pcap.(*Handle).getNextBufPtrLocked.func1(SB)\r\n         .          .    411fe7d: MOVL 0x18(SP), AX\t                      ;pcap.go:359\r\n         .          .    411fe81: CMPL $-0x2, AX\t                         ;pcap.go:374\r\n         .          .    411fe84: JE 0x411fff8\r\n         .          .    411fe8a: TESTL AX, AX\t                           ;pcap.go:377\r\n         .          .    411fe8c: JNE 0x411feac\r\n         .          .    411fe8e: MOVQ 0x38(SP), AX\r\n         .          .    411fe93: MOVQ 0x8(AX), CX\t                       ;pcap.go:380\r\n         .          .    411fe97: TESTQ CX, CX\r\n         .          .    411fe9a: JGE 0x411fe52\r\n         .          .    411fe9c: MOVQ AX, 0(SP)\t                         ;pcap.go:382\r\n         .          .    411fea0: CALL github.com/google/gopacket/pcap.(*Handle).waitForPacket(SB)\r\n         .          .    411fea5: MOVQ 0x38(SP), AX\r\n         .          .    411feaa: JMP 0x411fe52\t                          ;pcap.go:383\r\n         .          .    411feac: CMPL $0x1, AX\t                          ;pcap.go:362\r\n         .          .    411feaf: JNE 0x411ffbc\r\n         .          .    411feb5: MOVQ 0x38(SP), CX\r\n         .          .    411feba: MOVQ 0x40(CX), DX\t                      ;pcap.go:364\r\n         .          .    411febe: MOVQ 0(DX), BX\r\n         .          .    411fec1: MOVSXD 0x8(DX), DX\t                     ;pcap.go:366\r\n         .          .    411fec5: IMULQ $0x3e8, DX, DX\r\n         .          .    411fecc: CMPQ $0x3b9aca00, DX\t                   ;time.go:1262\r\n         .          .    411fed3: JB 0x411ffb1\r\n         .          .    411fed9: MOVQ $0x44b82fa09b5a52cc, AX\r\n         .          .    411fee3: MOVQ DX, SI\r\n         .          .    411fee6: IMULQ DX\t                               ;time.go:1263\r\n         .          .    411fee9: MOVQ SI, DI\r\n         .          .    411feec: SARQ $0x3f, SI\r\n         .          .    411fef0: SARQ $0x1c, DX\r\n         .          .    411fef4: SUBQ SI, DX\r\n         .          .    411fef7: LEAQ 0(BX)(DX*1), SI\t                   ;time.go:1264\r\n         .          .    411fefb: MOVQ DX, R8\r\n         .          .    411fefe: IMULQ $0x3b9aca00, DX, DX\t              ;time.go:1265\r\n         .          .    411ff05: SUBQ DX, DI\r\n         .          .    411ff08: TESTQ DI, DI\t                           ;time.go:1266\r\n         .          .    411ff0b: JGE 0x411ffa6\r\n         .          .    411ff11: LEAQ 0x3b9aca00(DI), AX\t                ;time.go:1267\r\n         .          .    411ff18: LEAQ -0x1(BX)(R8*1), DX\t                ;time.go:1268\r\n         .          .    411ff1d: MOVQ 0x1826cc(IP), BX\t                  ;time.go:1053\r\n         .          .    411ff24: MOVSXD AX, AX\r\n         .          .    411ff27: MOVQ 0x40(SP), SI\r\n         .          .    411ff2c: MOVQ AX, 0(SI)\t                         ;pcap.go:368\r\n         .          .    411ff2f: MOVQ $0xe7791f700, AX\r\n         .          .    411ff39: ADDQ DX, AX\t                            ;time.go:1053\r\n         .          .    411ff3c: MOVQ AX, 0x8(SI)\t                       ;pcap.go:368\r\n         .          .    411ff40: MOVL 0x6d123a(IP), AX\r\n         .          .    411ff46: LEAQ 0x10(SI), DX\r\n         .          .    411ff4a: TESTL AX, AX\r\n         .          .    411ff4c: JNE 0x411ff8c\r\n         .          .    411ff4e: MOVQ BX, 0x10(SI)\r\n         .          .    411ff52: MOVQ 0x40(CX), AX\t                      ;pcap.go:369\r\n         .          .    411ff56: MOVL 0x10(AX), AX\r\n         .          .    411ff59: MOVQ AX, 0x18(SI)\r\n         .          .    411ff5d: MOVQ 0x40(CX), AX\t                      ;pcap.go:370\r\n         .          .    411ff61: MOVL 0x14(AX), AX\r\n         .          .    411ff64: MOVQ AX, 0x20(SI)\r\n         .          .    411ff68: MOVQ 0x20(CX), AX\t                      ;pcap.go:371\r\n         .          .    411ff6c: MOVQ AX, 0x28(SI)\r\n         .          .    411ff70: MOVQ $0x0, 0x48(SP)\t                    ;pcap.go:373\r\n         .          .    411ff79: MOVQ $0x0, 0x50(SP)\r\n         .          .    411ff82: MOVQ 0x28(SP), BP\r\n         .          .    411ff87: ADDQ $0x30, SP\r\n         .          .    411ff8b: RET\r\n         .          .    411ff8c: MOVQ DX, 0(SP)\t                         ;pcap.go:368\r\n         .          .    411ff90: MOVQ BX, 0x8(SP)\r\n         .          .    411ff95: CALL runtime.writebarrierptr(SB)\r\n         .          .    411ff9a: MOVQ 0x38(SP), CX\r\n         .          .    411ff9f: MOVQ 0x40(SP), SI\r\n         .          .    411ffa4: JMP 0x411ff52\r\n         .          .    411ffa6: MOVQ DI, AX\r\n         .          .    411ffa9: MOVQ SI, DX\r\n         .          .    411ffac: JMP 0x411ff1d\t                          ;time.go:1266\r\n         .          .    411ffb1: MOVQ DX, AX\r\n         .          .    411ffb4: MOVQ BX, DX\r\n         .          .    411ffb7: JMP 0x411ff1d\t                          ;time.go:1262\r\n         .          .    411ffbc: MOVL AX, 0x24(SP)\t                      ;pcap.go:386\r\n         .          .    411ffc0: LEAQ 0x171c99(IP), AX\r\n         .          .    411ffc7: MOVQ AX, 0(SP)\r\n         .          .    411ffcb: LEAQ 0x24(SP), AX\r\n         .          .    411ffd0: MOVQ AX, 0x8(SP)\r\n         .          .    411ffd5: CALL runtime.convT2I32(SB)\r\n         .          .    411ffda: MOVQ 0x18(SP), AX\r\n         .          .    411ffdf: MOVQ 0x10(SP), CX\r\n         .          .    411ffe4: MOVQ CX, 0x48(SP)\r\n         .          .    411ffe9: MOVQ AX, 0x50(SP)\r\n         .          .    411ffee: MOVQ 0x28(SP), BP\r\n         .          .    411fff3: ADDQ $0x30, SP\r\n         .          .    411fff7: RET\r\n         .          .    411fff8: MOVQ 0x1882e1(IP), AX\t                  ;pcap.go:376\r\n         .          .    411ffff: MOVQ 0x1882e2(IP), CX\r\n         .          .    4120006: MOVQ AX, 0x48(SP)\r\n         .          .    412000b: MOVQ CX, 0x50(SP)\r\n         .          .    4120010: MOVQ 0x28(SP), BP\r\n         .          .    4120015: ADDQ $0x30, SP\r\n         .          .    4120019: RET\r\n         .          .    412001a: MOVQ 0x1882bf(IP), AX\t                  ;pcap.go:391\r\n         .          .    4120021: MOVQ 0x1882c0(IP), CX\r\n         .          .    4120028: MOVQ AX, 0x48(SP)\r\n         .          .    412002d: MOVQ CX, 0x50(SP)\r\n         .          .    4120032: MOVQ 0x28(SP), BP\r\n         .          .    4120037: ADDQ $0x30, SP\r\n         .          .    412003b: RET\r\n         .          .    412003c: MOVQ 0x1882a5(IP), AX\t                  ;pcap.go:354\r\n         .          .    4120043: MOVQ 0x188296(IP), CX\r\n         .          .    412004a: MOVQ CX, 0x48(SP)\r\n         .          .    412004f: MOVQ AX, 0x50(SP)\r\n         .          .    4120054: MOVQ 0x28(SP), BP\r\n         .          .    4120059: ADDQ $0x30, SP\r\n         .          .    412005d: RET\r\n         .          .    412005e: CALL runtime.morestack_noctxt(SB)\t      ;pcap.go:352\r\n         .          .    4120063: JMP github.com/google/gopacket/pcap.(*Handle).getNextBufPtrLocked(SB)\r\n         .          .    4120068: INT $0x3\r\n         .          .    4120069: INT $0x3\r\n         .          .    412006a: INT $0x3\r\n         .          .    412006b: INT $0x3\r\n         .          .    412006c: INT $0x3\r\n         .          .    412006d: INT $0x3\r\n         .          .    412006e: INT $0x3\r\nROUTINE ======================== github.com/google/gopacket/pcap.(*Handle).getNextBufPtrLocked.func1\r\n    327684     327684 (flat, cum) 32.97% of Total\r\n         .          .    4120620: MOVQ GS:0x8a0, CX\t                      ;pcap.go:359\r\n         .          .    4120629: CMPQ 0x10(CX), SP\r\n         .          .    412062d: JBE 0x41207d2\r\n         .          .    4120633: SUBQ $0x40, SP\r\n         .          .    4120637: MOVQ BP, 0x38(SP)\r\n         .          .    412063c: LEAQ 0x38(SP), BP\r\n         .          .    4120641: LEAQ 0x17f18(IP), AX\r\n         .          .    4120648: MOVQ AX, 0(SP)\r\n         .          .    412064c: MOVQ 0x48(SP), AX\r\n         .          .    4120651: MOVQ AX, 0x8(SP)\r\n         .          .    4120656: MOVQ $0x0, 0x10(SP)\r\n         .          .    412065f: MOVQ $0x0, 0x18(SP)\r\n         .          .    4120668: MOVQ $0x0, 0x20(SP)\r\n         .          .    4120671: CALL runtime.cgoCheckPointer(SB)\r\n         .          .    4120676: LEAQ 0x22603(IP), AX\r\n         .          .    412067d: MOVQ AX, 0(SP)\r\n     98305      98305    4120681: CALL runtime.newobject(SB)\t             ;github.com/google/gopacket/pcap.(*Handle).getNextBufPtrLocked.func1 pcap.go:359\r\n         .          .    4120686: MOVQ 0x8(SP), AX\t                       ;pcap.go:359\r\n         .          .    412068b: MOVZX 0x94250(IP), CX\r\n         .          .    4120692: LEAQ 0x1e7a7(IP), DX\r\n         .          .    4120699: MOVQ DX, 0(AX)\r\n         .          .    412069c: MOVL 0x6d0ade(IP), BX\r\n         .          .    41206a2: LEAQ 0x177017(IP), SI\r\n         .          .    41206a9: ADDQ SI, CX\r\n         .          .    41206ac: LEAQ 0x8(AX), DI\r\n         .          .    41206b0: TESTL BX, BX\r\n         .          .    41206b2: JNE 0x41207b5\r\n         .          .    41206b8: MOVQ CX, 0x8(AX)\r\n         .          .    41206bc: TESTB AL, 0(AX)\r\n         .          .    41206be: LEAQ 0x1425b(IP), CX\r\n         .          .    41206c5: MOVQ CX, 0(SP)\r\n         .          .    41206c9: MOVQ 0x50(SP), CX\r\n         .          .    41206ce: MOVQ CX, 0x8(SP)\r\n         .          .    41206d3: MOVQ AX, 0x10(SP)\r\n         .          .    41206d8: MOVQ $0x1, 0x18(SP)\r\n         .          .    41206e1: MOVQ $0x1, 0x20(SP)\r\n         .          .    41206ea: CALL runtime.cgoCheckPointer(SB)\r\n         .          .    41206ef: LEAQ 0x2258a(IP), AX\r\n         .          .    41206f6: MOVQ AX, 0(SP)\r\n    229379     229379    41206fa: CALL runtime.newobject(SB)\t             ;github.com/google/gopacket/pcap.(*Handle).getNextBufPtrLocked.func1 pcap.go:359\r\n         .          .    41206ff: MOVQ 0x8(SP), AX\t                       ;pcap.go:359\r\n         .          .    4120704: MOVZX 0x941d8(IP), CX\r\n         .          .    412070b: LEAQ 0x1e72e(IP), DX\r\n         .          .    4120712: MOVQ DX, 0(AX)\r\n         .          .    4120715: LEAQ 0x176fa4(IP), DX\r\n         .          .    412071c: ADDQ DX, CX\r\n         .          .    412071f: MOVL 0x6d0a5b(IP), DX\r\n         .          .    4120725: LEAQ 0x8(AX), BX\r\n         .          .    4120729: TESTL DX, DX\r\n         .          .    412072b: JNE 0x4120798\r\n         .          .    412072d: MOVQ CX, 0x8(AX)\r\n         .          .    4120731: TESTB AL, 0(AX)\r\n         .          .    4120733: LEAQ 0x14226(IP), CX\r\n         .          .    412073a: MOVQ CX, 0(SP)\r\n         .          .    412073e: MOVQ 0x58(SP), CX\r\n         .          .    4120743: MOVQ CX, 0x8(SP)\r\n         .          .    4120748: MOVQ AX, 0x10(SP)\r\n         .          .    412074d: MOVQ $0x1, 0x18(SP)\r\n         .          .    4120756: MOVQ $0x1, 0x20(SP)\r\n         .          .    412075f: CALL runtime.cgoCheckPointer(SB)\r\n         .          .    4120764: MOVQ 0x48(SP), AX\r\n         .          .    4120769: MOVQ AX, 0(SP)\r\n         .          .    412076d: MOVQ 0x50(SP), AX\r\n         .          .    4120772: MOVQ AX, 0x8(SP)\r\n         .          .    4120777: MOVQ 0x58(SP), AX\r\n         .          .    412077c: MOVQ AX, 0x10(SP)\r\n         .          .    4120781: CALL github.com/google/gopacket/pcap._Cfunc_pcap_next_ex(SB)\r\n         .          .    4120786: MOVL 0x18(SP), AX\r\n         .          .    412078a: MOVL AX, 0x60(SP)\r\n         .          .    412078e: MOVQ 0x38(SP), BP\r\n         .          .    4120793: ADDQ $0x40, SP\r\n         .          .    4120797: RET\r\n         .          .    4120798: MOVQ AX, 0x30(SP)\r\n         .          .    412079d: MOVQ BX, 0(SP)\r\n         .          .    41207a1: MOVQ CX, 0x8(SP)\r\n         .          .    41207a6: CALL runtime.writebarrierptr(SB)\r\n         .          .    41207ab: MOVQ 0x30(SP), AX\r\n         .          .    41207b0: JMP 0x4120731\r\n         .          .    41207b5: MOVQ AX, 0x28(SP)\r\n         .          .    41207ba: MOVQ DI, 0(SP)\r\n         .          .    41207be: MOVQ CX, 0x8(SP)\r\n         .          .    41207c3: CALL runtime.writebarrierptr(SB)\r\n         .          .    41207c8: MOVQ 0x28(SP), AX\r\n         .          .    41207cd: JMP 0x41206bc\r\n         .          .    41207d2: CALL runtime.morestack_noctxt(SB)\r\n         .          .    41207d7: JMP github.com/google/gopacket/pcap.(*Handle).getNextBufPtrLocked.func1(SB)\r\n         .          .    41207dc: INT $0x3\r\n         .          .    41207dd: INT $0x3\r\n         .          .    41207de: INT $0x3\r\n```\r\n\r\nso, `C.pcap_next_ex(p.cptr, &p.pkthdr, &p.bufptr)` is triggering a runtime.newobject somehow.. but this is as far as I understand about profiling allocations and I don't know much about cgo :-("},"comment":{"url":"https://api.github.com/repos/google/gopacket/issues/comments/335528929","html_url":"https://github.com/google/gopacket/issues/367#issuecomment-335528929","issue_url":"https://api.github.com/repos/google/gopacket/issues/367","id":335528929,"user":{"login":"gconnell","id":1211830,"avatar_url":"https://avatars2.githubusercontent.com/u/1211830?v=4","gravatar_id":"","url":"https://api.github.com/users/gconnell","html_url":"https://github.com/gconnell","followers_url":"https://api.github.com/users/gconnell/followers","following_url":"https://api.github.com/users/gconnell/following{/other_user}","gists_url":"https://api.github.com/users/gconnell/gists{/gist_id}","starred_url":"https://api.github.com/users/gconnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gconnell/subscriptions","organizations_url":"https://api.github.com/users/gconnell/orgs","repos_url":"https://api.github.com/users/gconnell/repos","events_url":"https://api.github.com/users/gconnell/events{/privacy}","received_events_url":"https://api.github.com/users/gconnell/received_events","type":"User","site_admin":false},"created_at":"2017-10-10T16:22:34Z","updated_at":"2017-10-10T16:22:34Z","author_association":"COLLABORATOR","body":"Okay, so we know the issue, just not the fix ;)  PROGRESS!\n\nI'll play around some more and see if I can trick cgo into doing the right\nthing.\n\nOn Tue, Oct 10, 2017 at 10:19 AM, Justin <notifications@github.com> wrote:\n\n> That's very similar to what I was trying to do, but panics at runtime with\n>\n> panic: runtime error: cgo argument has Go pointer to Go pointer\n>\n> The change appears correct though, and running with GODEBUG=cgocheck=0\n> outputs\n>\n> 2017/10/10 12:16:04 Alloc = 16659 TotalAlloc = 18147 Sys = 20870 NumGC = 3\n> 2017/10/10 12:16:09 Alloc = 16665 TotalAlloc = 18153 Sys = 20870 NumGC = 3\n> 2017/10/10 12:16:11 Alloc = 16666 TotalAlloc = 18154 Sys = 20870 NumGC = 3\n> 2017/10/10 12:16:14 Alloc = 16666 TotalAlloc = 18154 Sys = 20870 NumGC = 3\n> 2017/10/10 12:16:16 Alloc = 16666 TotalAlloc = 18154 Sys = 20870 NumGC = 3\n> 2017/10/10 12:17:13 Alloc = 16666 TotalAlloc = 18154 Sys = 20870 NumGC = 3\n> 2017/10/10 12:17:15 Alloc = 16666 TotalAlloc = 18154 Sys = 20870 NumGC = 3\n> 2017/10/10 12:17:17 Alloc = 16666 TotalAlloc = 18154 Sys = 20870 NumGC = 3\n> 2017/10/10 12:17:19 Alloc = 16666 TotalAlloc = 18154 Sys = 20870 NumGC = 3\n> 2017/10/10 12:17:21 Alloc = 16667 TotalAlloc = 18154 Sys = 20870 NumGC = 3\n>\n> I just don't know how to make cgo happy.\n>\n> —\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/google/gopacket/issues/367#issuecomment-335527840>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ABJ9ts3qWg2dq7MydLr86UOfN4j_fA0Kks5sq5jxgaJpZM4P0A-c>\n> .\n>\n"}}
{"actor":{"display_login":"gconnell"}}