-
Notifications
You must be signed in to change notification settings - Fork 13.4k
SIGILL while running the test suite of a few crates #47616
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
Crate consistenttime also regressed (crater log). cc @valarauca |
It might be related to my crate not being thread safe. This is because the library is intended to be invoked from a proprietary C++ program (BYOND) using FFI, and said program isn't threaded at all, so I saw no need to make it thread safe and just used a mutable static. I don't test the crate directly, but a library I made using the crate does and I did both |
I tested your crate again with just one thread and it still crashes. Can you please manually test it? Be sure to use the beta channel though: the error doesn't appear on stable (only beta and nightly), and the travis configuration you linked just tests on stable. |
Ok yeah I can definitely confirm it's crashing due to a |
Ok I figured it out. Seems like panicking across an extern "C" fn foo() {
panic!("uh oh");
}
#[test]
fn does_it_break() {
foo()
} Now whether or not this should be legal I'm not sure of, so if this was just an implementation detail I'll just remove the bad tests. On top of this, looking at the other crate mentioned here, it definitely seems like that one also has tests checking a panic across an |
Panicking across FFI boundaries is definitely undefined behavior. |
Yeah I don't doubt it, but on the other hand none of this is explicitly marked unsafe so I don't know how that fits in here. |
This is caused by #46833 protecting from undefined behavior by aborting instead. |
Huh... I would've thought you'd need |
No reason to worry — abort is violent but memory safe. And it is now mentioned in the reference rust-lang/reference#196 |
[¹]: using a different calling convention does not make the code/function unsafe. |
I believe this is expected -- @rust-lang/lang can you confirm that we are okay with this regression? To be clear, #46833 made it so that we do not unwind across FFI boundaries, and instead abort. Currently inclined to close as these crates were depending on UB. |
How hard would it be, in debug mode, to provide more detailed panic information in this case rather than just an abort? |
FWIW, I'm fine with this being "regressed". |
@joshtriplett @diwic or @nikomatsakis can probably comment on providing more information in debug mode. I think that sounds like something we could improve and add to... seems simple in theory, but may have implications I'm not aware of. There's some comments on #46833 I think. |
This is expected behavior. The idea roughly is that specifying the ABI does indeed specify whether a panic is allowed -- it's not so much about the FFI boundary, as about the fact taht Obviously it'd be nice to give a better error message. |
Closing as "expected behavior" in this case =) |
The easy answer is that the Now, we could have just told LLVM that no functions are "nounwind". But - apart from possible negative impact on optimisations and/or code size - that would be a against the practical goal here, which is to avoid as many panics into FFI land as possible, where the panic could cause all sorts of unexpected problems. |
Uh oh!
There was an error while loading. Please reload this page.
The test suites of a few crates are crashing with a SIGILL in the latest beta.
cc @PJB3005
The text was updated successfully, but these errors were encountered: