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

compiletest crashes on CI with: expected success, got: signal: 11 (core dumped) #93384

Closed
klensy opened this issue Jan 27, 2022 · 15 comments · Fixed by #93459
Closed

compiletest crashes on CI with: expected success, got: signal: 11 (core dumped) #93384

klensy opened this issue Jan 27, 2022 · 15 comments · Fixed by #93459
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) P-critical Critical priority T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Milestone

Comments

@klensy
Copy link
Contributor

klensy commented Jan 27, 2022

runner: x86_64-gnu-llvm-12, ubuntu-20.04-xl
Occured in multiple pr across CI:
#93361: https://github.com/rust-lang/rust/runs/4969749566?check_suite_focus=true
#93381: https://github.com/rust-lang/rust/runs/4969258442?check_suite_focus=true
#93375: https://github.com/rust-lang/rust/runs/4967313356?check_suite_focus=true
#93239: https://github.com/rust-lang/rust/runs/4963643970?check_suite_focus=true
and others

@matthiaskrgr matthiaskrgr added A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jan 27, 2022
@JakobDegen
Copy link
Contributor

Possibly this was #91840 ? Looking at what's been merged in the last day, that seems to be the most relevant thing

@matthiaskrgr
Copy link
Member

You mean it might have introduced a new miscompilation that made compiletest crash?

@JakobDegen
Copy link
Contributor

Maybe. Its also possible that there was some existing UB elsewhere that happened to get set off by this, don't really know. My observation just mostly comes from where the segfault is happening and what commits in the last day have touched nearby code

@klensy
Copy link
Contributor Author

klensy commented Jan 27, 2022

Warning: Skipping "src/test/ui": not a regular file or directory
Warning: Skipping "src/test/mir-opt": not a regular file or directory

Why this even triggered? Looks unrelated, but still suspicious.

@ehuss
Copy link
Contributor

ehuss commented Jan 27, 2022

Those warnings are unrelated. I'll post a patch soon to fix it.

EDIT: #93399

@klensy
Copy link
Contributor Author

klensy commented Jan 28, 2022

Funny thing: #93352 been merged even with crashed compiletest: #93352 (comment), how this works?

@fee1-dead
Copy link
Member

Funny thing: #93352 been merged even with crashed compiletest: #93352 (comment), how this works?

The comment by @rust-log-analyzer is about the CI run not the bors run.

@klensy
Copy link
Contributor Author

klensy commented Jan 28, 2022

The comment by @rust-log-analyzer is about the CI run not the bors run.

Yes, it failed on PR check, not on check-all-platforms-and-merge.
So fast approving PR, so it merged even with failed PR check :-(

@klensy
Copy link
Contributor Author

klensy commented Jan 28, 2022

@JakobDegen can you try to revert that #91840 pr and see, will it fail or not on test?

@JakobDegen
Copy link
Contributor

Yeah, I can do that before the end of the day

@JakobDegen
Copy link
Contributor

JakobDegen commented Jan 29, 2022

Reverting #91840 didn't fix it. Its still very suspicious that this started right after that got merged though. I'll leave the branch up on my fork for a little in case anyone else wants to re-run things or something.

@tmiasko
Copy link
Contributor

tmiasko commented Jan 29, 2022

The issue appears to be caused by a copy of dirent made in <ReadDir as Iterator>::next. Only a part of the structure as described by d_reclen is actually dereferenceable:

let ret = DirEntry {
entry: *entry_ptr,
// d_name is guaranteed to be null-terminated.
name: CStr::from_ptr((*entry_ptr).d_name.as_ptr()).to_owned(),
dir: Arc::clone(&self.inner),
};

Which was recently changed for Linux and Android in #92778.

@ehuss ehuss added the P-critical Critical priority label Jan 29, 2022
@Mark-Simulacrum Mark-Simulacrum added this to the 1.60.0 milestone Jan 29, 2022
@Mark-Simulacrum
Copy link
Member

It sounds like reverting that PR would be a good first step, since the bugs it fixes look less critical to me given that diagnosis.

(Of course, maybe there is a more forward-moving fix, but a revert seems like something we can merge with less caution).

cc @joshtriplett @tavianator

@tavianator
Copy link
Contributor

I'll take a look. @tmiasko do you mean the entry: *entry_ptr part? I didn't expect d_reclen < sizeof(struct dirent) but maybe it's possible.

@tavianator
Copy link
Contributor

Oh indeed that seems to happen all the time. One sec I'll put up a patch

tavianator added a commit to tavianator/rust that referenced this issue Jan 29, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 29, 2022
… r=cuviper

fs: Don't copy d_name from struct dirent

The dirent returned from readdir() is only guaranteed to be valid for
d_reclen bytes on common platforms.  Since we copy the name separately
anyway, we can copy everything except d_name into DirEntry::entry.

Fixes rust-lang#93384.
@bors bors closed this as completed in f8f4c40 Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) P-critical Critical priority T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants