{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12157","labels_url":"https://api.github.com/repos/golang/go/issues/12157/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12157/comments","events_url":"https://api.github.com/repos/golang/go/issues/12157/events","html_url":"https://github.com/golang/go/issues/12157","id":101218699,"number":12157,"title":"runtime: invalidptr check triggered on linux/armv5 with cgo","user":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/2","html_url":"https://github.com/golang/go/milestones/Go1.5Maybe","labels_url":"https://api.github.com/repos/golang/go/milestones/2/labels","id":905114,"number":2,"title":"Go1.5Maybe","description":"Things that might make Go 1.5, but aren't critical.\r\n","creator":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":45,"state":"open","created_at":"2014-12-16T02:39:13Z","updated_at":"2015-08-18T16:16:53Z","due_on":"2015-07-31T04:00:00Z","closed_at":null},"comments":9,"created_at":"2015-08-15T23:13:28Z","updated_at":"2015-08-18T18:49:56Z","closed_at":null,"body":"Split from issue #12138 to separate arm report (this one) from amd64 report (#12158).\r\n\r\n#### Reported by @zeebo (2015-08-13 17:54:46)\r\n\r\nI upgraded my system to use go1.5rc1 and let it run for a couple of days. I observed this panic:\r\n\r\n```\r\nruntime:objectstart Span weird: p=0x133a8580 k=0x99d4 s.start=0x13330000 s.limit=0x133b0000 s.state=4\r\nfatal error: objectstart: bad pointer in unexpected span\r\n\r\nruntime stack:\r\nruntime.throw(0x9c2bb8, 0x2b)\r\n\t/home/jeff/go/src/runtime/panic.go:527 +0x78 fp=0xa07fec34 sp=0xa07fec28\r\nruntime.heapBitsForObject(0x133a8580, 0x0, 0x0, 0x0, 0xa53a6f94)\r\n\t/home/jeff/go/src/runtime/mbitmap.go:214 +0x36c fp=0xa07fec58 sp=0xa07fec34\r\nruntime.scanblock(0xb6143b90, 0x4, 0xccf990, 0xa07fecbc)\r\n\t/home/jeff/go/src/runtime/mgcmark.go:797 +0xd8 fp=0xa07fec9c sp=0xa07fec58\r\nruntime.markroot(0x10f16000, 0x3)\r\n\t/home/jeff/go/src/runtime/mgcmark.go:102 +0x44c fp=0xa07fecec sp=0xa07fec9c\r\nruntime.parfordo(0x10f16000)\r\n\t/home/jeff/go/src/runtime/parfor.go:95 +0x134 fp=0xa07fed40 sp=0xa07fecec\r\nruntime.gcscan_m()\r\n\t/home/jeff/go/src/runtime/mgcmark.go:36 +0xa8 fp=0xa07fed64 sp=0xa07fed40\r\nruntime.gc.func1()\r\n\t/home/jeff/go/src/runtime/mgc.go:996 +0x118 fp=0xa07fed84 sp=0xa07fed64\r\nruntime.systemstack(0x11076000)\r\n\t/home/jeff/go/src/runtime/asm_arm.s:242 +0x80 fp=0xa07fed88 sp=0xa07fed84\r\nruntime.mstart()\r\n\t/home/jeff/go/src/runtime/proc1.go:674 fp=0xa07fed88 sp=0xa07fed88\r\n```\r\n\r\nJust as last time (#11640) I'm willing to do whatever I can to help diagnose.\r\n\r\n\r\n#### Comment by @aclements (2015-08-13 20:34:54)\r\n\r\n@zeebo, and chance you're running with -race? We fixed a memory corruption bug after rc1 was branched, but it only affects running in -race mode.\r\n\r\nIf possible, it would be great if you can run your system with GODEBUG=gccheckmark=1. It slows things down quite a bit, but enables some very useful debug code.\r\n\r\n#### Comment by @RLH (2015-08-13 20:36:40)\r\n\r\nAlso if you have any of the other go routine stacks that would help.\r\n\r\n#### Comment by @aclements (2015-08-13 21:03:02)\r\n\r\n@zeebo, is this also with GOOS=linux GOARCH=arm GOARM=5? If so, are you actually running on an ARMv5 or something newer?\r\n\r\nJust some quick diagnosis from the traceback: the bad pointer is the *funcval field of a \"specialfinalizer\" finalizer record. It looks like a pretty reasonable pointer, but points in to a span that's in state _MSpanDead. There's only one way we're supposed to be able to observe a dead span in the h_spans array: if we free a large span and coalesce it with neighboring spans, only the first and last page in the coalesced range are guaranteed to be in state \"free\". The pages in between may point to any span, including one in state \"dead\". Given how far \"p\" is from \"s.start\", this seems the most likely way we found the dead span. If this is ARM, there's also always the possibility of a missing memory barrier, since h_spans is read by the garbage collector without locking.\r\n\r\nIf we in fact freed that span, that means we either somehow created a bogus finalizer record, or we created a fine finalizer record, but failed to mark the funcval in an earlier cycle and the span got collected. One weird thing is that I would expect that funcval to be in a small object span that was only one page and hence could not leave behind \"dead\" spans in h_spans. This is a long shot, @zeebo, but do you have any finalizers that are closures that access particularly large variables from their enclosing frame? Or, in general, any unusual finalizers?\r\n\r\n\r\n#### Comment by @zeebo (2015-08-13 21:08:07)\r\n\r\nIt is not in race mode. It is an ARMv5 in the sense that no binaries will run on it if I don't specify GOARM=5. Unfortunately, I'm not much of a hardware guy so I don't know what that all entails.\r\n\r\nI don't know if we have any unusual finalizers, but it's possible. We use them mostly for freeing resources in our openssl wrapper and some debug checks if we forget to close a file handle or something. I'll do a double check of the code base to see if anything sticks out as really strange.\r\n\r\nHere is more of the stack dump. I'm not sure if it's all of it, but this is what I have:\r\n\r\n```\r\nruntime:objectstart Span weird: p=0x133a8580 k=0x99d4 s.start=0x13330000 s.limit=0x133b0000 s.state=4\r\nfatal error: objectstart: bad pointer in unexpected span\r\n\r\nruntime stack:\r\nruntime.throw(0x9c2bb8, 0x2b)\r\n\t/home/jeff/go/src/runtime/panic.go:527 +0x78 fp=0xa07fec34 sp=0xa07fec28\r\nruntime.heapBitsForObject(0x133a8580, 0x0, 0x0, 0x0, 0xa53a6f94)\r\n\t/home/jeff/go/src/runtime/mbitmap.go:214 +0x36c fp=0xa07fec58 sp=0xa07fec34\r\nruntime.scanblock(0xb6143b90, 0x4, 0xccf990, 0xa07fecbc)\r\n\t/home/jeff/go/src/runtime/mgcmark.go:797 +0xd8 fp=0xa07fec9c sp=0xa07fec58\r\nruntime.markroot(0x10f16000, 0x3)\r\n\t/home/jeff/go/src/runtime/mgcmark.go:102 +0x44c fp=0xa07fecec sp=0xa07fec9c\r\nruntime.parfordo(0x10f16000)\r\n\t/home/jeff/go/src/runtime/parfor.go:95 +0x134 fp=0xa07fed40 sp=0xa07fecec\r\nruntime.gcscan_m()\r\n\t/home/jeff/go/src/runtime/mgcmark.go:36 +0xa8 fp=0xa07fed64 sp=0xa07fed40\r\nruntime.gc.func1()\r\n\t/home/jeff/go/src/runtime/mgc.go:996 +0x118 fp=0xa07fed84 sp=0xa07fed64\r\nruntime.systemstack(0x11076000)\r\n\t/home/jeff/go/src/runtime/asm_arm.s:242 +0x80 fp=0xa07fed88 sp=0xa07fed84\r\nruntime.mstart()\r\n\t/home/jeff/go/src/runtime/proc1.go:674 fp=0xa07fed88 sp=0xa07fed88\r\n\r\ngoroutine 50 [garbage collection scan]:\r\nruntime.systemstack_switch()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:187 +0x4 fp=0x10f1b558 sp=0x10f1b554\r\nruntime.gc(0x0)\r\n\t/home/jeff/go/src/runtime/mgc.go:1005 +0x23c fp=0x10f1b7c4 sp=0x10f1b558\r\nruntime.backgroundgc()\r\n\t/home/jeff/go/src/runtime/mgc.go:896 +0x34 fp=0x10f1b7dc sp=0x10f1b7c4\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f1b7dc sp=0x10f1b7dc\r\ncreated by runtime.startGC\r\n\t/home/jeff/go/src/runtime/mgc.go:869 +0x178\r\n\r\ngoroutine 1 [chan receive, 3809 minutes]:\r\nruntime.gopark(0xa70968, 0x11cd95b0, 0x94a138, 0xc, 0x17, 0x3)\r\n\t/home/jeff/go/src/runtime/proc.go:185 +0x148 fp=0x11cf9d70 sp=0x11cf9d5c\r\nruntime.goparkunlock(0x11cd95b0, 0x94a138, 0xc, 0x17, 0x3)\r\n\t/home/jeff/go/src/runtime/proc.go:191 +0x44 fp=0x11cf9d8c sp=0x11cf9d70\r\nruntime.chanrecv(0x783a38, 0x11cd9580, 0x11cf9e64, 0x11df3e01, 0x11df0000)\r\n\t/home/jeff/go/src/runtime/chan.go:505 +0x960 fp=0x11cf9df8 sp=0x11cf9d8c\r\nruntime.chanrecv1(0x783a38, 0x11cd9580, 0x11cf9e64)\r\n\t/home/jeff/go/src/runtime/chan.go:349 +0x28 fp=0x11cf9e10 sp=0x11cf9df8\r\nsm/flud/FludProcess.RunFludProcess(0xb28f50a0, 0x110440e0, 0x0, 0x0)\r\n\t/home/jeff/katamari/go/src/sm/flud/FludProcess/process.go:90 +0x210 fp=0x11cf9e6c sp=0x11cf9e10\r\nmain.runNode(0x0, 0x0)\r\n\t/home/jeff/katamari/go/src/sm/flud/bin/fludnode/main.go:123 +0x5b0 fp=0x11cf9f48 sp=0x11cf9e6c\r\nmain.main()\r\n\t/home/jeff/katamari/go/src/sm/flud/bin/fludnode/main.go:141 +0x20c fp=0x11cf9fa4 sp=0x11cf9f48\r\nruntime.main()\r\n\t/home/jeff/go/src/runtime/proc.go:111 +0x2b4 fp=0x11cf9fcc sp=0x11cf9fa4\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x11cf9fcc sp=0x11cf9fcc\r\n\r\ngoroutine 17 [syscall, locked to thread]:\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f30fd8 sp=0x10f30fd8\r\n\r\ngoroutine 2 [force gc (idle), 25 minutes]:\r\nruntime.gopark(0xa70968, 0xce7358, 0x94b8f8, 0xf, 0x14, 0x1)\r\n\t/home/jeff/go/src/runtime/proc.go:185 +0x148 fp=0x10f1c7a8 sp=0x10f1c794\r\nruntime.goparkunlock(0xce7358, 0x94b8f8, 0xf, 0x14, 0x1)\r\n\t/home/jeff/go/src/runtime/proc.go:191 +0x44 fp=0x10f1c7c4 sp=0x10f1c7a8\r\nruntime.forcegchelper()\r\n\t/home/jeff/go/src/runtime/proc.go:152 +0xa8 fp=0x10f1c7dc sp=0x10f1c7c4\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f1c7dc sp=0x10f1c7dc\r\ncreated by runtime.init.4\r\n\t/home/jeff/go/src/runtime/proc.go:141 +0x24\r\n\r\ngoroutine 3 [GC sweep wait]:\r\nruntime.gopark(0xa70968, 0xce7648, 0x945ca8, 0xd, 0x81714, 0x1)\r\n\t/home/jeff/go/src/runtime/proc.go:185 +0x148 fp=0x10f1cf9c sp=0x10f1cf88\r\nruntime.goparkunlock(0xce7648, 0x945ca8, 0xd, 0x14, 0x1)\r\n\t/home/jeff/go/src/runtime/proc.go:191 +0x44 fp=0x10f1cfb8 sp=0x10f1cf9c\r\nruntime.bgsweep(0x10f12040)\r\n\t/home/jeff/go/src/runtime/mgcsweep.go:67 +0x13c fp=0x10f1cfd4 sp=0x10f1cfb8\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f1cfd4 sp=0x10f1cfd4\r\ncreated by runtime.gcenable\r\n\t/home/jeff/go/src/runtime/mgc.go:205 +0x4c\r\n\r\ngoroutine 4 [finalizer wait]:\r\nruntime.gopark(0xa70968, 0xcfd5b0, 0x94b6b8, 0xe, 0x14, 0x1)\r\n\t/home/jeff/go/src/runtime/proc.go:185 +0x148 fp=0x10f1d788 sp=0x10f1d774\r\nruntime.goparkunlock(0xcfd5b0, 0x94b6b8, 0xe, 0x14, 0x1)\r\n\t/home/jeff/go/src/runtime/proc.go:191 +0x44 fp=0x10f1d7a4 sp=0x10f1d788\r\nruntime.runfinq()\r\n\t/home/jeff/go/src/runtime/mfinal.go:154 +0xa4 fp=0x10f1d7dc sp=0x10f1d7a4\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f1d7dc sp=0x10f1d7dc\r\ncreated by runtime.createfing\r\n\t/home/jeff/go/src/runtime/mfinal.go:135 +0x5c\r\n\r\ngoroutine 5 [syscall, 3810 minutes]:\r\nruntime.notetsleepg(0xcfd940, 0xffffffff, 0xffffffff, 0x1)\r\n\t/home/jeff/go/src/runtime/lock_futex.go:202 +0x4c fp=0x10f1df98 sp=0x10f1df80\r\nruntime.signal_recv(0x0)\r\n\t/home/jeff/go/src/runtime/sigqueue.go:111 +0x190 fp=0x10f1dfb8 sp=0x10f1df98\r\nos/signal.loop()\r\n\t/home/jeff/go/src/os/signal/signal_unix.go:22 +0x14 fp=0x10f1dfdc sp=0x10f1dfb8\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f1dfdc sp=0x10f1dfdc\r\ncreated by os/signal.init.1\r\n\t/home/jeff/go/src/os/signal/signal_unix.go:28 +0x30\r\n\r\ngoroutine 34 [select, 3810 minutes]:\r\nruntime.gopark(0xa70984, 0x10f19700, 0x8ff6a0, 0x6, 0xcfd518, 0x2)\r\n\t/home/jeff/go/src/runtime/proc.go:185 +0x148 fp=0x10f195dc sp=0x10f195c8\r\nruntime.selectgoImpl(0x10f19700, 0x0, 0xc)\r\n\t/home/jeff/go/src/runtime/select.go:392 +0x14d4 fp=0x10f196b8 sp=0x10f195dc\r\nruntime.selectgo(0x10f19700)\r\n\t/home/jeff/go/src/runtime/select.go:212 +0x10 fp=0x10f196c8 sp=0x10f196b8\r\nsm/discovery.respondUntilError(0xb28b5020, 0x1102c020, 0x11032018, 0x3039, 0xb6a41200, 0x0, 0x0)\r\n\t/home/jeff/katamari/go/src/sm/discovery/responder.go:93 +0x288 fp=0x10f19750 sp=0x10f196c8\r\nsm/discovery.RespondBytesOnPort(0xb28b5020, 0x1102c020, 0x11032018, 0x3039)\r\n\t/home/jeff/katamari/go/src/sm/discovery/responder.go:63 +0x78 fp=0x10f19798 sp=0x10f19750\r\nsm/discovery.RespondOnPort(0xb28b5020, 0x1102c020, 0x11032010, 0x3039)\r\n\t/home/jeff/katamari/go/src/sm/discovery/responder.go:51 +0x40 fp=0x10f197ac sp=0x10f19798\r\nsm/flud/discovery.(*ResponderProtocol).Run.func1(0x10f0ab10, 0xb28b5020, 0x1102c020)\r\n\t/home/jeff/katamari/go/src/sm/flud/discovery/discovery.go:67 +0xe8 fp=0x10f197cc sp=0x10f197ac\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f197cc sp=0x10f197cc\r\ncreated by sm/flud/discovery.(*ResponderProtocol).Run\r\n\t/home/jeff/katamari/go/src/sm/flud/discovery/discovery.go:72 +0x160\r\n\r\ngoroutine 11 [select, 3810 minutes]:\r\nruntime.gopark(0xa70984, 0x10f1ef80, 0x8ff6a0, 0x6, 0x51818, 0x2)\r\n\t/home/jeff/go/src/runtime/proc.go:185 +0x148 fp=0x10f1ee70 sp=0x10f1ee5c\r\nruntime.selectgoImpl(0x10f1ef80, 0x0, 0xc)\r\n\t/home/jeff/go/src/runtime/select.go:392 +0x14d4 fp=0x10f1ef4c sp=0x10f1ee70\r\nruntime.selectgo(0x10f1ef80)\r\n\t/home/jeff/go/src/runtime/select.go:212 +0x10 fp=0x10f1ef5c sp=0x10f1ef4c\r\nsm/space/utils/godump.platformListenAndDump()\r\n\t/home/jeff/katamari/go/src/sm/space/utils/godump/godump_others.go:24 +0x124 fp=0x10f1efd0 sp=0x10f1ef5c\r\nsm/space/utils/godump.listenAndDump()\r\n\t/home/jeff/katamari/go/src/sm/space/utils/godump/godump.go:35 +0x3c fp=0x10f1efdc sp=0x10f1efd0\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f1efdc sp=0x10f1efdc\r\ncreated by sm/space/utils/godump.init.1\r\n\t/home/jeff/katamari/go/src/sm/space/utils/godump/godump.go:25 +0x24\r\n\r\ngoroutine 12 [select, 3810 minutes, locked to thread]:\r\nruntime.gopark(0xa70984, 0x10f1f78c, 0x8ff6a0, 0x6, 0x56318, 0x2)\r\n\t/home/jeff/go/src/runtime/proc.go:185 +0x148 fp=0x10f1f674 sp=0x10f1f660\r\nruntime.selectgoImpl(0x10f1f78c, 0x0, 0xc)\r\n\t/home/jeff/go/src/runtime/select.go:392 +0x14d4 fp=0x10f1f750 sp=0x10f1f674\r\nruntime.selectgo(0x10f1f78c)\r\n\t/home/jeff/go/src/runtime/select.go:212 +0x10 fp=0x10f1f760 sp=0x10f1f750\r\nruntime.ensureSigM.func1()\r\n\t/home/jeff/go/src/runtime/signal1_unix.go:227 +0x428 fp=0x10f1f7dc sp=0x10f1f760\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f1f7dc sp=0x10f1f7dc\r\ncreated by runtime.ensureSigM\r\n\t/home/jeff/go/src/runtime/signal1_unix.go:240 +0xe4\r\n\r\ngoroutine 14 [syscall, 3810 minutes]:\r\nsyscall.Syscall6(0x72, 0x4377, 0x10f19eb0, 0x0, 0x1104e000, 0x0, 0x0, 0x803c8, 0xb6a414b8, 0x6)\r\n\t/home/jeff/go/src/syscall/asm_linux_arm.s:48 +0x8 fp=0x10f19e64 sp=0x10f19e60\r\nsyscall.wait4(0x4377, 0x10f19eb0, 0x0, 0x1104e000, 0x50, 0x0, 0x0)\r\n\t/home/jeff/go/src/syscall/zsyscall_linux_arm.go:172 +0x64 fp=0x10f19e90 sp=0x10f19e64\r\nsyscall.Wait4(0x4377, 0x10f19ed4, 0x0, 0x1104e000, 0x0, 0x0, 0x0)\r\n\t/home/jeff/go/src/syscall/syscall_linux.go:256 +0x54 fp=0x10f19eb4 sp=0x10f19e90\r\nos.(*Process).wait(0x11060240, 0x0, 0x0, 0x0)\r\n\t/home/jeff/go/src/os/exec_unix.go:22 +0xcc fp=0x10f19f0c sp=0x10f19eb4\r\nos.(*Process).Wait(0x11060240, 0x0, 0x0, 0x0)\r\n\t/home/jeff/go/src/os/doc.go:45 +0x2c fp=0x10f19f20 sp=0x10f19f0c\r\nos/exec.(*Cmd).Wait(0x10f56140, 0x0, 0x0)\r\n\t/home/jeff/go/src/os/exec/exec.go:380 +0x1b4 fp=0x10f19f88 sp=0x10f19f20\r\ngithub.com/spacemonkeygo/spacelog.CaptureOutputToProcess.func1(0x10f56140)\r\n\t/home/jeff/katamari/go/src/github.com/spacemonkeygo/spacelog/capture.go:61 +0x1c fp=0x10f19fd4 sp=0x10f19f88\r\nruntime.goexit()\r\n\t/home/jeff/go/src/runtime/asm_arm.s:1031 +0x4 fp=0x10f19fd4 sp=0x10f19fd4\r\ncreated by github.com/spacemonkeygo/spacelog.CaptureOutputToProcess\r\n\t/home/jeff/katamari/go/src/github.com/spacemonkeygo/spacelog/capture.go:65 +0x204\r\n\r\ngoroutine 35 [IO wait]:\r\nruntime.gopark(0xa7094c, 0xb6148424, 0x8f8fc8, 0x7, 0x1b, 0x5)\r\n\t/home/jeff/go/src/runtime/proc.go:185 +0x148 fp=0x10f2edd8 sp=0x10f2edc4\r\nruntime.netpollblock(0xb6148410, 0x72, 0x0, 0x34234)\r\n\t/home/jeff/go/src/runtime/netpoll.go:338 +0x178 fp=0x10f2edfc sp=0x10f2edd8\r\nnet.runtime_pollWait(0xb6148410, 0x72, 0x10f0e060)\r\n\t/home/jeff/go/src/runtime/netpoll.go:157 +0x60 fp=0x10f2ee10 sp=0x10f2edfc\r\nnet.(*pollDesc).Wait(0x10f121b8, 0x72, 0x0, 0x0)\r\n\t/home/jeff/go/src/net/fd_poll_runtime.go:73 +0x34 fp=0x10f2ee20 sp=0x10f2ee10\r\nnet.(*pollDesc).WaitRead(0x10f121b8, 0x0, 0x0)\r\n\t/home/jeff/go/src/net/fd_poll_runtime.go:78 +0x30 fp=0x10f2ee34 sp=0x10f2ee20\r\nnet.(*netFD).readFrom(0x10f12180, 0x10f70a00, 0x80, 0x80, 0x0, 0x0, 0x0, 0xb6141030, 0x10f0e060)\r\n\t/home/jeff/go/src/net/fd_unix.go:259 +0x20c fp=0x10f2eea8 sp=0x10f2ee34\r\nnet.(*UDPConn).ReadFromUDP(0x11032020, 0x10f70a00, 0x80, 0x80, 0x0, 0x10f70a00, 0x0, 0x0)\r\n\t/home/jeff/go/src/net/udpsock_posix.go:61 +0xe4 fp=0x10f2ef18 sp=0x10f2eea8\r\nsm/discovery.handleRequest(0xb28b5090, 0x11032020, 0x11032018, 0x0, 0x0)\r\n\t/home/jeff/katamari/go/src/sm/discovery/responder.go:117 +0x80 fp=0x10f2ef8c sp=0x10f2ef18\r\nsm/discovery.handleRequests(0xb28b5090, 0x11032020, 0x11032018, 0x0, 0x0)\r\n\t/home/jeff/katamari/go/src/sm/discovery/responder.go:107 +0x44 fp=0x10f2efa4 sp=0x10f2ef8c\r\nsm/discovery.respondUntilError.func1(0x10f122c0, 0xb28b5090, 0x11032020, 0x11032018)\r\n\t/home/jeff/katamari/go/src/sm/discovery/responder.go:89 +0x2c fp=0x10f2efc4 sp=0x10f2efa4\r\nruntime.goexit()\r\n```\r\n\r\nI'll see if I can start running it with GODEBUG=gccheckmark=1. Is there anything in particular I should be observing with that flag?\r\n\r\n\r\n#### Comment by @aclements (2015-08-13 21:37:10)\r\n\r\n> It is an ARMv5 in the sense that no binaries will run on it if I don't specify GOARM=5.\r\n\r\nI believe the default is GOARM=6, so if it doesn't run with the default, you must have ARMv5. (I ask because ARM made a mess of its concurrency primitives, so it's basically impossible to run a multithreaded binary compiled for ARM v5 correctly on ARM v7 hardware.)\r\n\r\n> I'll see if I can start running it with GODEBUG=gccheckmark=1. Is there anything in particular I should be observing with that flag?\r\n\r\nPanics. :) This enables an assertion in the runtime, so if it fails, it will panic with a bunch of debugging info.\r\n\r\n#### Comment by @zeebo (2015-08-14 17:44:41)\r\n\r\nI bet we have similar code of dubious nature in our code base. I haven't had any crashes with the debug environment variable yet.\r\n\r\nI wonder if automated tooling can be written that just detects if the last usage of a variable in some function is in an unsafe.Pointer(&var) kind of form. I'd be ok with false positives if it helped me find all those issues.\r\n\r\n\r\n#### Comment by @aclements (2015-08-14 17:51:23)\r\n\r\n> I bet we have similar code of dubious nature in our code base.\r\n\r\nOne of the things we're hoping to do for 1.6 is to write down the rules of pointers and Cgo. We've even tinkered with ways of enforcing these rules, but so far no concrete changes have come of that.\r\n\r\n> I wonder if automated tooling can be written that just detects if the last usage of a variable in some function is in an unsafe.Pointer(&var) kind of form.\r\n\r\nI know that go vet does some checking of unsafe.Pointer use, though I'm not sure what exactly.\r\n\r\n\r\n#### Comment by @zeebo (2015-08-14 18:02:28)\r\n\r\nAs far as I'm aware the only checking it does is to make sure you don't squirrel away pointer values as integer types so the GC is still aware of them. :("},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/132316323","html_url":"https://github.com/golang/go/issues/12157#issuecomment-132316323","issue_url":"https://api.github.com/repos/golang/go/issues/12157","id":132316323,"user":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T18:49:56Z","updated_at":"2015-08-18T18:49:56Z","body":"Thanks. As I read the code the only one with an actual closure is this one:\r\n\r\n```\r\nsrc/github.com/spacemonkeygo/openssl/conn.go\r\n159:    runtime.SetFinalizer(c, func(c *Conn) {\r\n160-        c.into_ssl.Disconnect(into_ssl_cbio)\r\n161-        c.from_ssl.Disconnect(from_ssl_cbio)\r\n162-        C.SSL_free(c.ssl)\r\n163-    })\r\n\r\n335:    runtime.SetFinalizer(cert, func(cert *Certificate) {\r\n336-        C.X509_free(cert.x)\r\n337-    })\r\n```\r\n"}}