{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/22394","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/22394/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/22394/comments","events_url":"https://api.github.com/repos/golang/go/issues/22394/events","html_url":"https://github.com/golang/go/issues/22394","id":267626910,"number":22394,"title":"runtime: Windows 2008: all goroutines are asleep - deadlock","user":{"login":"felixge","id":15000,"avatar_url":"https://avatars1.githubusercontent.com/u/15000?v=4","gravatar_id":"","url":"https://api.github.com/users/felixge","html_url":"https://github.com/felixge","followers_url":"https://api.github.com/users/felixge/followers","following_url":"https://api.github.com/users/felixge/following{/other_user}","gists_url":"https://api.github.com/users/felixge/gists{/gist_id}","starred_url":"https://api.github.com/users/felixge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixge/subscriptions","organizations_url":"https://api.github.com/users/felixge/orgs","repos_url":"https://api.github.com/users/felixge/repos","events_url":"https://api.github.com/users/felixge/events{/privacy}","received_events_url":"https://api.github.com/users/felixge/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":{"url":"https://api.github.com/repos/golang/go/milestones/60","html_url":"https://github.com/golang/go/milestone/60","labels_url":"https://api.github.com/repos/golang/go/milestones/60/labels","id":2814851,"number":60,"title":"Go1.9.2","description":"","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","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},"open_issues":33,"closed_issues":0,"state":"open","created_at":"2017-10-04T15:40:09Z","updated_at":"2017-10-25T15:17:03Z","due_on":null,"closed_at":null},"comments":25,"created_at":"2017-10-23T11:05:39Z","updated_at":"2017-10-25T15:20:17Z","closed_at":null,"author_association":"NONE","body":"I already reported this issue in https://github.com/golang/go/issues/20362 (which might be the same or related), but am opening a new issue as requested by @davecheney .\r\n\r\n### What version of Go are you using (`go version`)?\r\n\r\n`go version go1.9.1 linux/amd64`\r\n\r\n### Does this issue reproduce with the latest release?\r\n\r\nYes.\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\n\r\n```\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOEXE=\".exe\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"linux\"\r\nGOOS=\"windows\"\r\nGOPATH=\"/dn\"\r\nGORACE=\"\"\r\nGOROOT=\"/usr/local/go19\"\r\nGOTOOLDIR=\"/usr/local/go19/pkg/tool/linux_amd64\"\r\nGCCGO=\"gccgo\"\r\nCC=\"gcc\"\r\nGOGCCFLAGS=\"-m64 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build141570660=/tmp/go-build -gno-record-gcc-switches\"\r\nCXX=\"g++\"\r\nCGO_ENABLED=\"0\"\r\nCGO_CFLAGS=\"-g -O2\"\r\nCGO_CPPFLAGS=\"\"\r\nCGO_CXXFLAGS=\"-g -O2\"\r\nCGO_FFLAGS=\"-g -O2\"\r\nCGO_LDFLAGS=\"-g -O2\"\r\nPKG_CONFIG=\"pkg-config\"\r\n```\r\n\r\n### What did you do?\r\n\r\nI was able to reproduce the deadlock with a [minimal test program](https://gist.github.com/felixge/2981efeccbe31591069e422c347c5528) that basically just executes a http GET request.\r\n\r\nI ran the command in a loop and got the following results:\r\n\r\n- go1.7.5: No deadlocks\r\n- go1.8.4: No deadlocks (This means that the e4371fb179ad69cbd057f2430120843948e09f2f aka `go1.8beta2-389-ge4371fb179` commit mentioned in #20362 is probably not the root cause)\r\n- go1.9.1: Lots of deadlocks, [see example](https://gist.github.com/felixge/a2efcaf098e1b8fa0ec1f7d67fb2481c)\r\n\r\nNotes:\r\n- I was able to consistently reproduce this in 64Bit Win7 VM with Cygwin. However, it doesn't happen for every run of the program, but 20-50% of the runs trigger the problem.\r\n- I was not able to reproduce this in a local 64Bit Win7 Professional VM (also using Cygwin)\r\n\r\n### What did you expect to see?\r\n\r\nNo deadlock.\r\n\r\n### What did you see instead?\r\n\r\nhttps://gist.github.com/felixge/a2efcaf098e1b8fa0ec1f7d67fb2481c"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/339366254","html_url":"https://github.com/golang/go/issues/22394#issuecomment-339366254","issue_url":"https://api.github.com/repos/golang/go/issues/22394","id":339366254,"user":{"login":"stevenh","id":104239,"avatar_url":"https://avatars1.githubusercontent.com/u/104239?v=4","gravatar_id":"","url":"https://api.github.com/users/stevenh","html_url":"https://github.com/stevenh","followers_url":"https://api.github.com/users/stevenh/followers","following_url":"https://api.github.com/users/stevenh/following{/other_user}","gists_url":"https://api.github.com/users/stevenh/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenh/subscriptions","organizations_url":"https://api.github.com/users/stevenh/orgs","repos_url":"https://api.github.com/users/stevenh/repos","events_url":"https://api.github.com/users/stevenh/events{/privacy}","received_events_url":"https://api.github.com/users/stevenh/received_events","type":"User","site_admin":false},"created_at":"2017-10-25T15:20:17Z","updated_at":"2017-10-25T15:20:17Z","author_association":"CONTRIBUTOR","body":"My hunch about a consumer of ```nanotime()`` treating zero as a special case was correct.\r\n\r\nThe runtime scheduler ```sched.lastpoll``` does just that in several places. When it is zero it can prevent a network poll from being triggered which leads to deadlock. I tested this by creating a ```nanotime2()``` which was ```nanotime() + 1``` which also fixes the issue.\r\n\r\nWhat I would like to understand @rsc is why do we want / need ```nanotime()``` to be relative instead of being absolute?\r\n\r\nCurrently this creates a disparity between platforms that use go and those use asm for ```nanotime()```, in addition removing this means less operations, so a small speed up too. Could you enlighten me?"}}
{"actor":{"display_login":"stevenh"}}