{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12516","labels_url":"https://api.github.com/repos/golang/go/issues/12516/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12516/comments","events_url":"https://api.github.com/repos/golang/go/issues/12516/events","html_url":"https://github.com/golang/go/issues/12516","id":105043756,"number":12516,"title":"runtime: throw in linked c++ library causes app crash even if caught, on windows platform","user":{"login":"superbaddude","id":7436343,"avatar_url":"https://avatars.githubusercontent.com/u/7436343?v=3","gravatar_id":"","url":"https://api.github.com/users/superbaddude","html_url":"https://github.com/superbaddude","followers_url":"https://api.github.com/users/superbaddude/followers","following_url":"https://api.github.com/users/superbaddude/following{/other_user}","gists_url":"https://api.github.com/users/superbaddude/gists{/gist_id}","starred_url":"https://api.github.com/users/superbaddude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superbaddude/subscriptions","organizations_url":"https://api.github.com/users/superbaddude/orgs","repos_url":"https://api.github.com/users/superbaddude/repos","events_url":"https://api.github.com/users/superbaddude/events{/privacy}","received_events_url":"https://api.github.com/users/superbaddude/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/golang/go/labels/OS-Windows","name":"OS-Windows","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/24","html_url":"https://github.com/golang/go/milestones/Go1.6","labels_url":"https://api.github.com/repos/golang/go/milestones/24/labels","id":1096159,"number":24,"title":"Go1.6","description":"","creator":{"login":"josharian","id":67496,"avatar_url":"https://avatars.githubusercontent.com/u/67496?v=3","gravatar_id":"","url":"https://api.github.com/users/josharian","html_url":"https://github.com/josharian","followers_url":"https://api.github.com/users/josharian/followers","following_url":"https://api.github.com/users/josharian/following{/other_user}","gists_url":"https://api.github.com/users/josharian/gists{/gist_id}","starred_url":"https://api.github.com/users/josharian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josharian/subscriptions","organizations_url":"https://api.github.com/users/josharian/orgs","repos_url":"https://api.github.com/users/josharian/repos","events_url":"https://api.github.com/users/josharian/events{/privacy}","received_events_url":"https://api.github.com/users/josharian/received_events","type":"User","site_admin":false},"open_issues":88,"closed_issues":519,"state":"open","created_at":"2015-05-05T02:39:06Z","updated_at":"2016-01-02T17:36:09Z","due_on":"2016-01-31T08:00:00Z","closed_at":null},"comments":7,"created_at":"2015-09-05T19:04:49Z","updated_at":"2016-01-04T01:41:59Z","closed_at":null,"body":"when compiling go code using cgo to link a c++ application that uses try/catch/throw logic, the golang app crashes immediately when an exception is thrown.  on linux, it performs as expected.  \r\n\r\ncode versions:\r\n    go version go1.5 windows/amd64\r\n    tdm64-gcc-5.1.0-2\r\n\r\nthe code that demonstrates issue can be found in https://gist.github.com/superbaddude/b52e60f2e8dee0868af2\r\n\r\nthe output from command on windows:\r\n\r\n    go test\r\n\r\n```\r\n=== RUN   Test_Callthrow_and_catch_exception\r\nException 0x20474343 0x1045e80 0x6161616161616161 0x7fff56cda1c8\r\nPC=0x7fff56cda1c8\r\nsignal arrived during external code execution\r\n\r\ngithub.com/superbaddude/testcgo._Cfunc_throw_and_catch_exception()\r\n\tgithub.com/superbaddude/testcgo/_test/_obj_test/_cgo_gotypes.go:37 +0x38\r\ngithub.com/superbaddude/testcgo.Callthrow_and_catch_exception()\r\n\tc:/Code/go/src/github.com/superbaddude/testcgo/throwe.go:9 +0x1b\r\ngithub.com/superbaddude/testcgo.Test_Callthrow_and_catch_exception(0xc08208e000)\r\n\tc:/Code/go/src/github.com/superbaddude/testcgo/throwe_test.go:6 +0x1b\r\ntesting.tRunner(0xc08208e000, 0x702d00)\r\n\tc:/go/src/testing/testing.go:456 +0x9f\r\ncreated by testing.RunTests\r\n\tc:/go/src/testing/testing.go:561 +0x874\r\n\r\ngoroutine 1 [chan receive]:\r\ntesting.RunTests(0x5e4f28, 0x702d00, 0x1, 0x1, 0x1)\r\n\tc:/go/src/testing/testing.go:562 +0x8b4\r\ntesting.(*M).Run(0xc082033ee8, 0xc0820583d0)\r\n\tc:/go/src/testing/testing.go:494 +0x77\r\nmain.main()\r\n\tgithub.com/superbaddude/testcgo/_test/_testmain.go:54 +0x11d\r\n\r\ngoroutine 17 [syscall, locked to thread]:\r\nruntime.goexit()\r\n\tc:/go/src/runtime/asm_amd64.s:1696 +0x1\r\nrax     0x0\r\nrbx     0x1045e80\r\nrcx     0x0\r\nrdi     0x1045ec0\r\nrsi     0x6d6850\r\nrbp     0x0\r\nrsp     0x24fc00\r\nr8      0x10\r\nr9      0x8735d0\r\nr10     0x1\r\nr11     0x3\r\nr12     0x8\r\nr13     0x5e2c36\r\nr14     0x9\r\nr15     0x8\r\nrip     0x7fff56cda1c8\r\nrflags  0x206\r\ncs      0x33\r\nfs      0x53\r\ngs      0x2b\r\nexit status 2\r\nFAIL\tgithub.com/superbaddude/testcgo\t0.914s\r\n```"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/168563653","html_url":"https://github.com/golang/go/issues/12516#issuecomment-168563653","issue_url":"https://api.github.com/repos/golang/go/issues/12516","id":168563653,"user":{"login":"ianlancetaylor","id":3194333,"avatar_url":"https://avatars.githubusercontent.com/u/3194333?v=3","gravatar_id":"","url":"https://api.github.com/users/ianlancetaylor","html_url":"https://github.com/ianlancetaylor","followers_url":"https://api.github.com/users/ianlancetaylor/followers","following_url":"https://api.github.com/users/ianlancetaylor/following{/other_user}","gists_url":"https://api.github.com/users/ianlancetaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianlancetaylor/subscriptions","organizations_url":"https://api.github.com/users/ianlancetaylor/orgs","repos_url":"https://api.github.com/users/ianlancetaylor/repos","events_url":"https://api.github.com/users/ianlancetaylor/events{/privacy}","received_events_url":"https://api.github.com/users/ianlancetaylor/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T01:41:59Z","updated_at":"2016-01-04T01:41:59Z","body":"I understand that Go does not use SEH, but the C++ code, compiled by the C++ compiler, does use SEH.  Windows finds the Go exception handlers fine.  It fails to find the C++ SEH exception handler, but only after the Go runtime has started, or perhaps only when called from Go.  I don't know what the key difference is."}}