-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: 1.11rc2 crash in runtime.sigInitIgnored #27183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
How exactly are you building your shared library? How are you using it? |
We build it the standard way:
Our main application is written in a language called XOJO and dynamically links against the libbbtgo library to expose the functionality. We've been doing this for the past few years without issue. |
Here's the stack trace
|
CC @randall77 |
There's also only a single thread
I wonder if |
If it's an ordering issue, it's not clear why it would fail on 32-bit but work on 64-bit. |
It's also unclear why it doesn't crash if I launch via command line, but crashes if the process is spawned by a parent process. With that in mind, it may work on 64-bit out of luck. |
In the directory misc/cgo/testcshared, |
How is the process spawned by the parent process? Is the parent process written in Go or C? |
And for the record, |
The parent process is written in a language called Xojo and is spawned via a call to Shell.Execute |
Thanks. I'm not going to be able to do anything here without some ability to recreate the problem. The code seems OK, and it works for me. I would suggest investigating any differences between |
looking at |
Calling the utility via the command line using |
What shell are you running when you run the program from the command line? |
bash.. which is the weird thing |
I apologize, calling it using bash -c via the command line does not crash. |
Let me know if there's any more debug info I can provide, since it's not easily reproducible on your end. This is definitely a regression for us, since it wasn't an issue with Go 1.10 and prior. Things are further complicated since we need to upgrade to Go 1.11 to resolve an unrelated issue for 64-bit. |
I'm confused as to why |
Unfortunately I'm basically turning this around for you to look into what differs when using
|
I've found a difference that seems to matter. When launching from the GUI app, signal 25 (SIGCONT) seems to be ignored, which triggers the buggy call to |
Another relevant datapoint. By setting breakpoints in |
Launching from GUI
Re-running in lldb (same as running from command line)
|
OK, got it. Thanks very much for debugging. |
Change https://golang.org/cl/131277 mentions this issue: |
I can confirm that the patch does fix the crash we were seeing. |
Change https://golang.org/cl/131278 mentions this issue: |
The sigInitIgnored function can be called by initsig before a shared library is initialized, before the runtime is initialized. Fixes #27183 Change-Id: I7073767938fc011879d47ea951d63a14d1cce878 Reviewed-on: https://go-review.googlesource.com/131277 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Austin Clements <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> (cherry picked from commit d20ecd6e5dab55376ea4f169eed63608f9bb3b2b) Reviewed-on: https://go-review.googlesource.com/131278 Reviewed-by: Brad Fitzpatrick <[email protected]>
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.11rc2 darwin/386
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Our application links against a shared library that's written in Go. When compiling with both Go 1.11 RC1 and 1.11 RC2 we're seeing a crash at start for one of our 32-bit applications. The strange thing is that the crash depends on how the application is launched. If it's launched via the command line we see no crash. If it's launched via a call for a parent application, it crashes. We have no issues with Go 1.10. The issue happens without any calls to the go library, and seems like it's doing the runtime initialization. We don't see this issue with the 64-bit application.
I suspect that this crash is related to the TLS changes made in b3a854c.
Here's the crash in lldb
As you can see, gs:[0x18] contains a null pointer, which causes a segfault on the next instruction
The text was updated successfully, but these errors were encountered: