-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
JS tracer fails on too large stacks in returnvalue #23669
Comments
It gets killed here:
|
backtrace courtesy of @gballet
|
This same bug can be reproed all the way back to |
This problem is related to the The segfault is triggered in the prologue of musl's
Before subtracting
So this is what happens at the very lowest level. Root cause analysis still needs to be done to understand why this came to be. The program is clearly running out of stack, as |
After increasing the thread stack size when linking-in duktape, the behavior is the expected one:
So that seems to be the problem: musl doesn't offer too much thread stack space (see here) for a nice comparison table. Because other distribs have a higher stack size, duktape usually hits the limit of 1000 allowed recursions before it runs out of stack. Not so with alpine linux, that offers a smaller stacksize by default. |
@holiman Looks like go won't let me hardcode the linker flags to increase the stack size on alpine, so we have two courses of action to avoid this issue:
|
Heh, that's pretty spot on: the table says |
429 to be precise |
With that in mind, btw, it would be good if we could run the CI testsuite on alpine too. |
Another alternative to 1), would be to fork duktape to not 'cheat' and use a stack buffer: https://github.com/svaarala/duktape/blob/master/src-input/duk_api_stack.c#L4768 , or make it smaller than |
Would also be good to produce a minimum PoC and submit upstream to duktape, maybe they wouldn't mind figuring something out on their end. |
I thought about that, but Go doesn't let you set external ld flags via a |
I meant maybe just an alpine docker image with a minimal duktape interpreter which just loads a piece of code and crashes. Not sure what you mean is problematic? |
I thought you meant: provide a fix using the cgo directive, which is not possible. Just reproducing it isn't problematic. |
Hope this is the right thread. Since upgrading to v1.10.9 in our testing env we are seeing errors tracing certain txs.
This returns a number of txs with the error pthread size program
Which returned Untraceable txs0x430874b252f837eecef4eefd51f94019d31b0cb2fa8cba78ebc98f33c660ade2 |
I made this into a unit test in https://github.com/s1na/go-ethereum/tree/test/tracer-deep-nested but the crash wasn't happening for me in an alpine docker. We tried with @gballet's setup and at first the test was passing (i.e. no segfault). Then he tried with compiling the test (i.e. |
Can also confirm that the test passes on my machine (host machine running ubuntu 20.04 fwiw). Tried running it on |
Closed by #23676 |
There appears to be a regression, which concerns alpine builds, which causes crashes like #23660 .
This seems to happen only when runing via docker, and it can be reproed like as shown below. This was once fixed by #22857, no idea why we're seeing it now.
Run it
Also
^ process killed.
The text was updated successfully, but these errors were encountered: