{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/24768","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/24768/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/24768/comments","events_url":"https://api.github.com/repos/golang/go/issues/24768/events","html_url":"https://github.com/golang/go/issues/24768","id":312438904,"number":24768,"title":"runtime: Fatal Error in heapBitsForObject during GC on Windows","user":{"login":"billziss-gh","id":15330948,"avatar_url":"https://avatars3.githubusercontent.com/u/15330948?v=4","gravatar_id":"","url":"https://api.github.com/users/billziss-gh","html_url":"https://github.com/billziss-gh","followers_url":"https://api.github.com/users/billziss-gh/followers","following_url":"https://api.github.com/users/billziss-gh/following{/other_user}","gists_url":"https://api.github.com/users/billziss-gh/gists{/gist_id}","starred_url":"https://api.github.com/users/billziss-gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billziss-gh/subscriptions","organizations_url":"https://api.github.com/users/billziss-gh/orgs","repos_url":"https://api.github.com/users/billziss-gh/repos","events_url":"https://api.github.com/users/billziss-gh/events{/privacy}","received_events_url":"https://api.github.com/users/billziss-gh/received_events","type":"User","site_admin":false},"labels":[{"id":373402289,"url":"https://api.github.com/repos/golang/go/labels/NeedsInvestigation","name":"NeedsInvestigation","color":"ededed","default":false},{"id":199753992,"url":"https://api.github.com/repos/golang/go/labels/OS-Windows","name":"OS-Windows","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-09T08:28:20Z","updated_at":"2018-04-09T17:59:39Z","closed_at":null,"author_association":"NONE","body":"### What version of Go are you using (`go version`)?\r\n\r\n```\r\ngo version go1.10 windows/amd64\r\n```\r\n\r\n### Does this issue reproduce with the latest release?\r\n\r\n???\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\n\r\n```\r\nwindows/amd64\r\n```\r\n### What did you do?\r\n\r\nI have a program that uses cgo. The program implements a user mode file system and is available [here](https://github.com/billziss-gh/objfs). The program runs on Windows, macOS and Linux.\r\n\r\nI am experiencing this problem during testing of the `Readdir` operation on Windows. The problem is rather easy to reproduce with the proper setup (happens 1 every 3-4 test runs). Unfortunately it is not trivial to recreate this setup. (I can provide instructions if desired.)\r\n\r\n### What did you expect to see?\r\n\r\nI expected the program to continue running without problems.\r\n\r\n### What did you see instead?\r\n\r\nEvery few test runs the program crashes within `heapBitsForObject`. I provide stack traces from two different crashes:\r\n\r\n```\r\nfatal error: unexpected signal during runtime execution\r\nfatal error: unexpected signal during runtime execution\r\n[signal 0xc0000005 code=0x0 addr=0xffffffffffffffff pc=0x41382e]\r\n\r\nruntime stack:\r\nruntime.throw(0x7164f3, 0x2a)\r\n        C:/Program Files/Go/src/runtime/panic.go:619 +0x88\r\nruntime.sigpanic()\r\n        C:/Program Files/Go/src/runtime/signal_windows.go:161 +0x170\r\nruntime.(*mspan).base(...)\r\n        C:/Program Files/Go/src/runtime/mheap.go:310\r\nruntime.heapBitsForObject(0xc042018ac0, 0x8a2920, 0x61e0, 0xc041ff06f2, 0xc000000002, 0x29b7240, 0xc04201b270, 0x9)\r\n        C:/Program Files/Go/src/runtime/mbitmap.go:393 +0xae\r\nruntime.scanblock(0x8a2920, 0x9410, 0x293d800, 0xc04201b270)\r\n        C:/Program Files/Go/src/runtime/mgcmark.go:1103 +0xde\r\nruntime.markrootBlock(0x8a2920, 0x9410, 0x293d800, 0xc04201b270, 0x0)\r\n        C:/Program Files/Go/src/runtime/mgcmark.go:294 +0x83\r\nruntime.markroot(0xc04201b270, 0xc000000002)\r\n        C:/Program Files/Go/src/runtime/mgcmark.go:195 +0xee\r\nruntime.gcDrain(0xc04201b270, 0x15)\r\n        C:/Program Files/Go/src/runtime/mgcmark.go:934 +0x11f\r\nruntime.gcBgMarkWorker.func2()\r\n        C:/Program Files/Go/src/runtime/mgc.go:1863 +0x1a8\r\nruntime.systemstack(0x0)\r\n        C:/Program Files/Go/src/runtime/asm_amd64.s:409 +0x7e\r\nruntime.mstart()\r\n        C:/Program Files/Go/src/runtime/proc.go:1170\r\n```\r\n\r\n```\r\nunexpected fault address 0xffffffffffffffff\r\nfatal error: fault\r\n[signal 0xc0000005 code=0x0 addr=0xffffffffffffffff pc=0x41382e]\r\n\r\ngoroutine 17 [running, locked to thread]:\r\nruntime.throw(0x7097ae, 0x5)\r\n        C:/Program Files/Go/src/runtime/panic.go:619 +0x88 fp=0xc042460878 sp=0xc042460858 pc=0x42c9c8\r\n\r\nruntime.sigpanic()\r\n        C:/Program Files/Go/src/runtime/signal_windows.go:170 +0x13a fp=0xc0424608a8 sp=0xc042460878 pc=0x43f5ea\r\nruntime.(*mspan).base(...)\r\n        C:/Program Files/Go/src/runtime/mheap.go:310\r\nruntime.heapBitsForObject(0xc042010d80, 0x0, 0x0, 0x3, 0x1, 0x4182d8, 0x8cdee0, 0xc04211e150)\r\n        C:/Program Files/Go/src/runtime/mbitmap.go:393 +0xae fp=0xc042460900 sp=0xc0424608a8 pc=0x41382e\r\nruntime.gcMarkTinyAllocs()\r\n        C:/Program Files/Go/src/runtime/mgcmark.go:1389 +0x86 fp=0xc042460980 sp=0xc042460900 pc=0x41faf6\r\nruntime.gcStart(0x0, 0x1, 0x0, 0x0)\r\n        C:/Program Files/Go/src/runtime/mgc.go:1357 +0x314 fp=0xc0424609b0 sp=0xc042460980 pc=0x4196c4\r\n\r\nruntime.mallocgc(0x40, 0x0, 0x0, 0xc0423a2200)\r\n        C:/Program Files/Go/src/runtime/malloc.go:803 +0x448 fp=0xc042460a50 sp=0xc0424609b0 pc=0x411a18\r\nruntime.growslice(0x6979c0, 0xc0423a2200, 0x20, 0x20, 0x21, 0xc0423a2200, 0x10, 0x20)\r\n        C:/Program Files/Go/src/runtime/slice.go:172 +0x224 fp=0xc042460ab8 sp=0xc042460a50 pc=0x43fe74\r\nstrings.(*Builder).WriteRune(0xc042460b60, 0xc00000006c, 0x1, 0x0, 0x0)\r\n        C:/Program Files/Go/src/strings/builder.go:101 +0xbb fp=0xc042460b30 sp=0xc042460ab8 pc=0x4d4d5b\r\ngithub.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive.decodeName(0xc04239b3b0, 0x24, 0x86b5, 0x68eb80)\r\n        C:/Users/billziss/Projects/go/src/github.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive/onedrive.go:78 +0x4b fp=0xc042460b90 sp=0xc042460b30 pc=0x658ceb\r\ngithub.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive.(*codedName).UnmarshalJSON(0xc0423a0770, 0xc04242774b, 0x26, 0x86b5, 0x0, 0x4513ae8)\r\n        C:/Users/billziss/Projects/go/src/github.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive/onedrive.go:99 +0xac fp=0xc042460be0 sp=0xc042460b90 pc=0x658f0c\r\nencoding/json.(*decodeState).literalStore(0xc04211e3e8, 0xc04242774b, 0x26, 0x86b5, 0x6a6e60, 0xc0423a0770, 0x198, 0x67f800)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:853 +0x2512 fp=0xc042460f50 sp=0xc042460be0 pc=0x641822\r\nencoding/json.(*decodeState).literal(0xc04211e3e8, 0x6a6e60, 0xc0423a0770, 0x198)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:820 +0xdc fp=0xc042460fa8 sp=0xc042460f50 pc=0x63f06c\r\nencoding/json.(*decodeState).value(0xc04211e3e8, 0x6a6e60, 0xc0423a0770, 0x198)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:411 +0x314 fp=0xc042461028 sp=0xc042460fa8 pc=0x63c044\r\nencoding/json.(*decodeState).object(0xc04211e3e8, 0x6cca00, 0xc0421a8c18, 0x196)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:754 +0x1334 fp=0xc0424612a8 sp=0xc042461028 pc=0x63e5b4\r\nencoding/json.(*decodeState).value(0xc04211e3e8, 0x6cca00, 0xc0421a8c18, 0x196)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:408 +0x2da fp=0xc042461328 sp=0xc0424612a8 pc=0x63c00a\r\nencoding/json.(*decodeState).array(0xc04211e3e8, 0x691100, 0xc042256720, 0x197)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:561 +0x1d7 fp=0xc042461428 sp=0xc042461328 pc=0x63c8f7\r\nencoding/json.(*decodeState).value(0xc04211e3e8, 0x691100, 0xc042256720, 0x197)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:405 +0x26d fp=0xc0424614a8 sp=0xc042461428 pc=0x63bf9d\r\nencoding/json.(*decodeState).object(0xc04211e3e8, 0x68f140, 0xc042256720, 0x16)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:754 +0x1334 fp=0xc042461728 sp=0xc0424614a8 pc=0x63e5b4\r\nencoding/json.(*decodeState).value(0xc04211e3e8, 0x68f140, 0xc042256720, 0x16)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:408 +0x2da fp=0xc0424617a8 sp=0xc042461728 pc=0x63c00a\r\nencoding/json.(*decodeState).unmarshal(0xc04211e3e8, 0x68f140, 0xc042256720, 0x0, 0x0)\r\n        C:/Program Files/Go/src/encoding/json/decode.go:189 +0x1ee fp=0xc042461818 sp=0xc0424617a8 pc=0x63b5be\r\nencoding/json.(*Decoder).Decode(0xc04211e3c0, 0x68f140, 0xc042256720, 0x4513a20, 0xc04225a180)\r\n        C:/Program Files/Go/src/encoding/json/stream.go:73 +0x1ae fp=0xc042461858 sp=0xc042461818 pc=0x64d5fe\r\ngithub.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive.(*onedrive).List.func1(0xc04222a5a0, 0x7439d8, 0xc04225a180)\r\n        C:/Users/billziss/Projects/go/src/github.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive/onedrive.go:640 +0xef fp=0xc0424618c8 sp=0xc042461858 pc=0x65e8af\r\ngithub.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive.(*onedrive).sendrecv(0xc0420f8d20, 0xc042461b38, 0xc042461ad8, 0x0, 0x0)\r\n        C:/Users/billziss/Projects/go/src/github.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive/onedrive.go:576 +0x31d fp=0xc042461a70 sp=0xc0424618c8 pc=0x65ad8d\r\ngithub.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive.(*onedrive).List(0xc0420f8d20, 0xc042056858, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n        C:/Users/billziss/Projects/go/src/github.com/billziss-gh/objfs/vendor/github.com/billziss-gh/objfs.pkg/objio/onedrive/onedrive.go:635 +0x21a fp=0xc042461b80 sp=0xc042461a70 pc=0x65baca\r\ngithub.com/billziss-gh/objfs/cache.(*Cache).readdirNode(0xc042128000, 0xc042394dc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n        C:/Users/billziss/Projects/go/src/github.com/billziss-gh/objfs/cache/cache.go:762 +0x171 fp=0xc042461ca8 sp=0xc042461b80 pc=0x52d451\r\ngithub.com/billziss-gh/objfs/cache.(*Cache).Readdir(0xc042128000, 0x2e56, 0x0, 0x1, 0x1, 0x18, 0x6ca100, 0x1)\r\n        C:/Users/billziss/Projects/go/src/github.com/billziss-gh/objfs/cache/cache.go:372 +0xa1 fp=0xc042461cf8 sp=0xc042461ca8 pc=0x52b5d1\r\ngithub.com/billziss-gh/objfs/fs/objfs.(*objfs).Readdir(0xc0420765d0, 0xc0421a5c32, 0x1, 0xc042250300, 0x0, 0x2e56, 0xc042042058)\r\n        C:/Users/billziss/Projects/go/src/github.com/billziss-gh/objfs/fs/objfs/objfs.go:272 +0x1dd fp=0xc042461de0 sp=0xc042461cf8 pc=0x63a56d\r\ngithub.com/billziss-gh/objfs/vendor/github.com/billziss-gh/cgofuse/fuse.hostReaddir(0x103b00, 0x513fe20, 0x7ff8bace5980, 0x0, 0x513fe40, 0x0)\r\n        C:/Users/billziss/Projects/go/src/github.com/billziss-gh/objfs/vendor/github.com/billziss-gh/cgofuse/fuse/host.go:931 +0x13f fp=0xc042461e48 sp=0xc042461de0 pc=0x53bd4f\r\ngithub.com/billziss-gh/objfs/vendor/github.com/billziss-gh/cgofuse/fuse._cgoexpwrap_02f8cc1aff87_hostReaddir(0x103b00, 0x513fe20, 0x7ff8bace5980, 0x0, 0x513fe40, 0x7ff8ca82a686)\r\n        _cgo_gotypes.go:776 +0x5a fp=0xc042461e88 sp=0xc042461e48 pc=0x538d8a\r\nruntime.call64(0x0, 0x513fc20, 0x513fd90, 0x30)\r\n        C:/Program Files/Go/src/runtime/asm_amd64.s:574 +0x42 fp=0xc042461ed8 sp=0xc042461e88 pc=0x454602\r\nruntime.cgocallbackg1(0x0)\r\n        C:/Program Files/Go/src/runtime/cgocall.go:316 +0x1aa fp=0xc042461f58 sp=0xc042461ed8 pc=0x402d6a\r\nruntime.cgocallbackg(0x0)\r\n        C:/Program Files/Go/src/runtime/cgocall.go:194 +0xef fp=0xc042461fc0 sp=0xc042461f58 pc=0x402b1f\r\nruntime.cgocallback_gofunc(0x0, 0x0, 0x0, 0x0)\r\n        C:/Program Files/Go/src/runtime/asm_amd64.s:826 +0xb2 fp=0xc042461fe0 sp=0xc042461fc0 pc=0x455bd2\r\nruntime.goexit()\r\n        C:/Program Files/Go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc042461fe8 sp=0xc042461fe0 pc=0x456de1\r\n```"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/379839903","html_url":"https://github.com/golang/go/issues/24768#issuecomment-379839903","issue_url":"https://api.github.com/repos/golang/go/issues/24768","id":379839903,"user":{"login":"odeke-em","id":4898263,"avatar_url":"https://avatars3.githubusercontent.com/u/4898263?v=4","gravatar_id":"","url":"https://api.github.com/users/odeke-em","html_url":"https://github.com/odeke-em","followers_url":"https://api.github.com/users/odeke-em/followers","following_url":"https://api.github.com/users/odeke-em/following{/other_user}","gists_url":"https://api.github.com/users/odeke-em/gists{/gist_id}","starred_url":"https://api.github.com/users/odeke-em/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odeke-em/subscriptions","organizations_url":"https://api.github.com/users/odeke-em/orgs","repos_url":"https://api.github.com/users/odeke-em/repos","events_url":"https://api.github.com/users/odeke-em/events{/privacy}","received_events_url":"https://api.github.com/users/odeke-em/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T17:59:39Z","updated_at":"2018-04-09T17:59:39Z","author_association":"MEMBER","body":"/cc @aclements @randall77 @cherrymui @alexbrainman "}}
{"actor":{"display_login":"odeke-em"}}