Skip to content
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

Using the backtrace-rs crate inside of a generator segfaults on Linux x64 #2

Open
bkolobara opened this issue Apr 3, 2021 · 2 comments

Comments

@bkolobara
Copy link
Collaborator

Having a split stack makes it really easy to break backtracing libraries. For now I have disabled the test on Linux.

Could be a bug inside of the backtrace crate. Default backtraces on rust panics work.

@kaimast
Copy link

kaimast commented May 4, 2021

Do you know when this error started popping up? I think I see this now when wasmer is raising a user trap :/

@bkolobara
Copy link
Collaborator Author

@kaimast I'm not sure when it started popping up. I don't think it's even related to changes in async-wormhole.

For the sake of stability I think I will abandon the original goal of having cross-stack backtraces. There are so many subtle ways this can fail, depending on the OS, architecture and optimisation mode. It's also super tricky to debug.

A big issue here is the use of inline asm! in Rust. We don't control the surrounding Rust code the compiler will generate different DWARF directives around us. I'm constantly running into the issue that it either works in debug or release modes, but not in both because the generated directives don't play nicely with the hand written ones.

I just need to figure out how to stop the backtrace on a specific function in Windows. On DWARF systems this can be accomplished using .cfi_undefined rip. I wonder if there is an equivalent .seh_ alternative on Windows. I found this in the Julia compiler, but would like to avoid writing a custom exception handler.

We carry panics across the stacks with: https://github.com/lunatic-solutions/async-wormhole/blob/master/switcheroo/src/lib.rs#L101 so we should be fine there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants