Skip to content

SEGV in unix::stack_overflow::signal_handler #54294

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

Closed
aep opened this issue Sep 17, 2018 · 8 comments
Closed

SEGV in unix::stack_overflow::signal_handler #54294

aep opened this issue Sep 17, 2018 · 8 comments
Labels
O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-musl Target: The musl libc

Comments

@aep
Copy link

aep commented Sep 17, 2018

with --target arm-unknown-linux-musleabi i get a SEGV in env_logger::Format::into_boxed_fn::_$u7b$$u7b$closure$u7d$$u7d$::ha67fa042fe85d5e5 which contains no unsafe code

rust-cli/env_logger#106

but i suspect its actually crashing in unix::stack_overflow::signal_handler according to this qemu cpu trace

https://gist.github.com/4b83c01143f582e95c77a526710f18e3

this only happens with musl, not with glibc, so might be TLS related?

@sfackler
Copy link
Member

sfackler commented Sep 17, 2018

The signal handler doesn't log, so I think the env_logger symbol may be a red herring.

@sfackler sfackler reopened this Sep 17, 2018
@aep
Copy link
Author

aep commented Sep 17, 2018

This is happening when log is called from somewhere else. Maybe env_logger::Format::into_boxed_fn is actually crashing, which triggers the signal handler? I don't quite understand what the handler actually does.

btw also only happens in --release mode. debug is fine.

  • release
  • arm
  • musleabi

any more debug info i can obtain to help figure this out?

@sfackler
Copy link
Member

Oh, I read that trace as a stacktrace, not as a sequence of instructions. The stack overflow handler handles all SEGVs - if the signal was not due to a stack overflow it deregisters itself and the signal is re-emitted and handled as usual. That's what happened in this case, so it's not a stack overflow, just a "normal" SEGV.

@aep
Copy link
Author

aep commented Sep 19, 2018

yeah looks like it. i'm confused why musl is even related to this. Is it possible that there's an incorrectly emitted reloc?

@sfackler
Copy link
Member

There are some MUSL-specific issues with unwind info, but I don't know if that's related here: #47551.

@jonas-schievink jonas-schievink added O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-musl Target: The musl libc labels Jan 27, 2019
@steveklabnik
Copy link
Member

Triage: are you, or is anyone else, still seeing this problem? Any chance of getting a smaller reproduction?

@aep
Copy link
Author

aep commented Dec 26, 2019

We're no longer using rust. But it's unlikely to be fixed since rust still ships the wrong musl crt and uses TLS excessively.

@steveklabnik
Copy link
Member

Okay! I'm going to close this then; we'll see if anyone else runs into it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-musl Target: The musl libc
Projects
None yet
Development

No branches or pull requests

4 participants