test: Add a regression test for Apple platforms aborting on free#155713
test: Add a regression test for Apple platforms aborting on free#155713rust-bors[bot] merged 1 commit intorust-lang:mainfrom
free#155713Conversation
|
r? @adwinwhite rustbot has assigned @adwinwhite. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@bors try jobs=aarch64-apple |
This comment has been minimized.
This comment has been minimized.
test: Add a regression test for Apple platforms aborting on `free` try-job: aarch64-apple
This comment has been minimized.
This comment has been minimized.
|
💔 Test for eb1af91 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
943e78c to
acb99bb
Compare
|
Blocked of course if the runner in CI fails. @dianqk this is just your repro from #150898 (comment). |
This comment has been minimized.
This comment has been minimized.
acb99bb to
3e273bc
Compare
This comment has been minimized.
This comment has been minimized.
3e273bc to
a511777
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
test: Add a regression test for Apple platforms aborting on `free` try-job: aarch64-apple
| // bug. If this fails with SIGABRT, you may need to upgrade your system to | ||
| // avoid other unexpected behavior. | ||
| // | ||
| // The bug was resolved by MacOS 26.4. |
There was a problem hiding this comment.
| // The bug was resolved by MacOS 26.4. | |
| // The bug was resolved by macOS 26.4. |
| #[unsafe(no_mangle)] | ||
| fn retv() -> Reproducer { | ||
| // let x = [48, 0, 3, 1, 48, 0]; | ||
| let x = [0, 0, 3, 0, 0, 0]; |
There was a problem hiding this comment.
I don't know if this can pass Miri check. Should we use let x = [48, 0, 3, 1, 48, 0];?
There was a problem hiding this comment.
I replaced the test case with something that I think should be less reliant on codegen, based on your asm repro. I found that using threads makes it reproduce is every time, or at least hasn't not crashed in the
30-40 times I've run it.
|
|
||
| let s = 128; | ||
| // A few more allocations seem to be necessary, probably to prime | ||
| // the allocator find the bug. |
There was a problem hiding this comment.
Should we document that this test can be a flaky test?
There was a problem hiding this comment.
Mentioned this in the comment that it can have false negatives but is also pretty reliable
This comment was marked as outdated.
This comment was marked as outdated.
a511777 to
227e008
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
test: Add a regression test for Apple platforms aborting on `free` try-job: aarch64-apple
|
Any idea what the actual failure mechanism is in the buggy allocator? I can't wrap my head around how writing a random value to a (should be) valid allocation could cause free to not work. |
I have no idea. Really. And I don't think Apple will share this bug. |
|
@bors r+ rollup |
…=dianqk test: Add a regression test for Apple platforms aborting on `free` Add a regression test for rust-lang#150898 to make users aware that if this test failures, they may encounter unusual behavior elsewhere.
…=dianqk test: Add a regression test for Apple platforms aborting on `free` Add a regression test for rust-lang#150898 to make users aware that if this test failures, they may encounter unusual behavior elsewhere.
…uwer Rollup of 12 pull requests Successful merges: - #149452 (Refactor out common code into a `IndexItem::new` constructor) - #155621 (Document #[diagnostic::on_move] in the unstable book.) - #155635 (delegation: rename `Self` generic param to `This` in recursive delegations) - #155730 (Some cleanups around per parent disambiguators) - #153537 (rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu) - #155219 (Do not suggest borrowing enclosing calls for nested where-clause obligations) - #155408 (rustdoc: Fix Managarm C Library name in cfg pretty printer) - #155571 (Enable AddressSanitizer on arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf) - #155713 (test: Add a regression test for Apple platforms aborting on `free`) - #155723 (Fix tier level for 5 thumb bare-metal ARM targets) - #155735 (Fix typo by removing extra 'to') - #155736 (Remove `AllVariants` workaround for rust-analyzer)
…uwer Rollup of 12 pull requests Successful merges: - #149452 (Refactor out common code into a `IndexItem::new` constructor) - #155621 (Document #[diagnostic::on_move] in the unstable book.) - #155635 (delegation: rename `Self` generic param to `This` in recursive delegations) - #155730 (Some cleanups around per parent disambiguators) - #153537 (rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu) - #155219 (Do not suggest borrowing enclosing calls for nested where-clause obligations) - #155408 (rustdoc: Fix Managarm C Library name in cfg pretty printer) - #155571 (Enable AddressSanitizer on arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf) - #155713 (test: Add a regression test for Apple platforms aborting on `free`) - #155723 (Fix tier level for 5 thumb bare-metal ARM targets) - #155735 (Fix typo by removing extra 'to') - #155736 (Remove `AllVariants` workaround for rust-analyzer)
|
We started hitting this test in chromium, and it's not clear what the right thing for us to do is. This appears to be testing the system that builds the compiler, not the one it actually runs on, so it's not clear if it's really applicable. Since it only seems to reproduce in specific circumstances anyway, we've disabled the test for now; is the expectation just that anyone distributing rustc will disable the test when packaging it? |
|
Disabling it or marking xfail is reasonable if you are unable to upgrade your MacOS version. I added this test because we've seen some spurious crashes and we need a way to be sure they aren't coming from the buggy platform. For your downstream purpose I suppose it's just an FYI that you have a chance of hitting the random abort. |
|
If the action is "disable the test", how is it useful to have a test that just fails on platforms earlier than macOS 26.4? Also, don't most people use prebuilt rustc binaries? The linked #150898 only affects macOS 26 (before 26.4) from what I can tell, but this test is failing on earlier macOS versions as well. Is the takeaway here that rustc produces binaries that can crash on macOS before 26.4 and there's nothing people can do about it? Something else? Just to confirm, the bug is about run-time behavior of compiled code, not of rustc itself crashing? In short, I suppose my question is "what problem does this solve?". Sorry about being confused about so many things 😅 |
The action is "upgrade the buggy OS". If this really isn't possible then yes, all you can really do is hide the problem and hope you don't hit related bugs.
Generally yes, this has shown up in builds other than rustc. But we also have no way of guaranteeing that there isn't a codepath within rustc that may hit this, now or at some point in the future. Or that codegen changes won't mean this problem gets hit in places it wasn't before. (Not rustc-specific of course since this bug can be hit from any language.)
From above:
Without this test, if we hit a bug that looks like it could be caused by the issue here, we have no way of knowing whether it's a bug on our end or in the platform. #155518 is one real example. |
But the person building rustc (or, worse, a program compiled by rustc) for distribution has no control over the OS it (or its output) runs on. |
|
I don't know how to improve that situation. If it's that important then I guess you could look at LLVM changes to avoid emitting the bad pattern when building for MacOS? But that really doesn't seem worth the effort. Are you hitting the |
|
We're building a rustc binary. We're now disabling this test: https://chromium-review.googlesource.com/c/chromium/src/+/7808009/2/tools/rust/build_rust.py I imagine everyone else building and distributing a rustc binary will also have to disable it. This doesn't seem very useful to me is all :) I was hoping I was missing something. (Since we disabled the test, we're not blocked on anything here.) |
Only if you CI is truly stuck on the version. I assume that can't be very many people for very long since AIUI this was only present on 26.0(?)-26.4, which has been out for over a month at this point. But yes, this test's main purpose is helping narrow other test failures, that's less useful downstream than in-repo. |
|
Ah, if the intent is for this to say "other tests might fail", then that makes sense. Sorry it took me a while to understand, thanks for patiently explaining. |
View all comments
Add a regression test for #150898 to make users aware that if this test failures, they may encounter unusual behavior elsewhere.