{"action":"created","issue":{"url":"https://api.github.com/repos/derekparker/delve/issues/259","labels_url":"https://api.github.com/repos/derekparker/delve/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/derekparker/delve/issues/259/comments","events_url":"https://api.github.com/repos/derekparker/delve/issues/259/events","html_url":"https://github.com/derekparker/delve/pull/259","id":108532576,"number":259,"title":"proc.(*Process).Continue skips breakpoints [WIP]","user":{"login":"aarzilli","id":303620,"avatar_url":"https://avatars.githubusercontent.com/u/303620?v=3","gravatar_id":"","url":"https://api.github.com/users/aarzilli","html_url":"https://github.com/aarzilli","followers_url":"https://api.github.com/users/aarzilli/followers","following_url":"https://api.github.com/users/aarzilli/following{/other_user}","gists_url":"https://api.github.com/users/aarzilli/gists{/gist_id}","starred_url":"https://api.github.com/users/aarzilli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aarzilli/subscriptions","organizations_url":"https://api.github.com/users/aarzilli/orgs","repos_url":"https://api.github.com/users/aarzilli/repos","events_url":"https://api.github.com/users/aarzilli/events{/privacy}","received_events_url":"https://api.github.com/users/aarzilli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2015-09-27T12:40:01Z","updated_at":"2015-11-30T23:38:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/derekparker/delve/pulls/259","html_url":"https://github.com/derekparker/delve/pull/259","diff_url":"https://github.com/derekparker/delve/pull/259.diff","patch_url":"https://github.com/derekparker/delve/pull/259.patch"},"body":"This is a fix for the problem unearthed by PR #255, it is submitted for discussion, not definitive.\r\n\r\nThere are two problems with `(*Process).Continue`\r\n\r\n1. The first is that between the time one breakpoint is triggered and the point where we loop over all threads and `Halt` eacho one the second goroutine may hit the breakpoint too, this second hit gets lost\r\n2. The second problem is that the way `Continue` resumes the process has a race condition with the tracee\r\n\r\nLet's that thread A hit the breakpoint and thread B was sleeping when `Continue` called `Halt` on it. After we finish processing the breakpoint on A we call `Continue` again, `Continue` then loops through all threads, it calls `resume` on B, then moves onto thread A, sees that it's on a breakpoint so it calls `(*Thread).Step()`.\r\nIf thread B happens to get to the breakpoint while `(*Thread).Step` on thread A is happening the breakpoint gets skipped, because we temporarily cleared it.\r\n\r\nYou can test this by reverting the changes and running `TestBreakpointCounts`. The fact that multiple breakpoints can be hit simultaneously needs to be propagated all the way to the client, either by changing CurrentBreakpoint in State to a slice or by returning one breakpoint at a time in Debugger."},"comment":{"url":"https://api.github.com/repos/derekparker/delve/issues/comments/160799428","html_url":"https://github.com/derekparker/delve/pull/259#issuecomment-160799428","issue_url":"https://api.github.com/repos/derekparker/delve/issues/259","id":160799428,"user":{"login":"derekparker","id":1314079,"avatar_url":"https://avatars.githubusercontent.com/u/1314079?v=3","gravatar_id":"","url":"https://api.github.com/users/derekparker","html_url":"https://github.com/derekparker","followers_url":"https://api.github.com/users/derekparker/followers","following_url":"https://api.github.com/users/derekparker/following{/other_user}","gists_url":"https://api.github.com/users/derekparker/gists{/gist_id}","starred_url":"https://api.github.com/users/derekparker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekparker/subscriptions","organizations_url":"https://api.github.com/users/derekparker/orgs","repos_url":"https://api.github.com/users/derekparker/repos","events_url":"https://api.github.com/users/derekparker/events{/privacy}","received_events_url":"https://api.github.com/users/derekparker/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T23:38:48Z","updated_at":"2015-11-30T23:38:48Z","body":"@aarzilli pulled branch and ran tests several times, getting failures probably 80% of the time on OSX. Are you getting any failures in your OSX VM?"}}