Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Segfault when using rust inside a go program #64834
This is really a weird bug that occurs on one of our program, i managed to make a reproducable example under this repository: https://github.com/joelwurtz/segfault-golang-with-rust
However i'm wondering if the bug is not coming from rust-lang
What it does:
This result in a segfault 100% of the time
There are some workaround for this:
I really don't know what happens inside and it's really difficult to trace it due to the way of compiling this.
I'm wondering if using compiler_builtins in 0.1.19 version will help tracing this bug due to rust-lang/compiler-builtins@985a430
If you also have insight on how i can produce a better debugging log i will gladly do it.
This is the relevant stack-trace
For some arbitrary execution, on entry:
and it eventually segfaults when the stack probing routine reaches…
With the stack size request of
Looking at the memory maps for the process:
You can see that the stack address which did not probe successfully is inside of the non-read non-write page(s). These are usually called a "guard page" and are used to enforce that no code will write to outside its stack. Thus the too-small-stack hypothesis is confirmed.
Closing as a not-a-bug.