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

Segmentation fault: repr::write_repr(io::stdout(), &(0_i32, &42)); #3688

Closed
ben0x539 opened this issue Oct 7, 2012 · 1 comment
Closed
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Milestone

Comments

@ben0x539
Copy link
Contributor

ben0x539 commented Oct 7, 2012

I get a segmentation fault when trying to use repr::write_repr on a tuple of an i32 and a pointer of some sort.

I'm on linux x86_64, rustc from incoming at f96a2a2.

Here is a sample stack trace where the pointer is an &int, but it also fails with with strings and other boxes.

#0  0x00007ffff7a44ce0 in repr::__extensions__::meth_4972::visit_int::_bb314cd7b2d5487c::_04 () from /home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so
#1  0x0000000000403cf8 in glue_visit_1770 ()
#2  0x00007ffff7aadee0 in repr::__extensions__::meth_12173::visit_ptr_contents::_c16ac36288f708a::_04 ()
   from /home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so
#3  0x00007ffff7a45a9d in repr::__extensions__::meth_5018::visit_rptr::_c16ac36288f708a::_04 () from /home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so
#4  0x0000000000403ca7 in glue_visit_1766 ()
#5  0x00007ffff7a46868 in repr::__extensions__::meth_5048::visit_tup_field::_c16ac36288f708a::_04 () from /home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so
#6  0x0000000000403b94 in glue_visit_1758 ()
#7  0x00000000004050eb in intrinsic::rusti::visit_tydesc_1872::_dd21ad46516abf9c::_00 ()
#8  0x0000000000403666 in repr::write_repr_1718::_18cbcd4791f8cd::_00 ()
#9  0x0000000000405668 in __morestack ()
#10 0x00000000004032f9 in main::_461897b8e816aa::_00 ()
#11 0x000000000040332e in _rust_main ()
#12 0x00007ffff77bb644 in task_start_wrapper (a=0x60bff0)
    at /home/ben/code/repos/rust/src/rt/rust_task.cpp:150
#13 0x0000000000000000 in ?? ()
@ben0x539
Copy link
Contributor Author

I can't reproduce this with current incoming anymore.

flip1995 pushed a commit to flip1995/rust that referenced this issue May 27, 2020
…flip1995

Downgrade `match_wild_err_arm` to pedantic and update help messages

Hi,
This fixes rust-lang#3688 and downgrades `match_wild_err_arm` to pedantic.
There are a lot of different reasons in that issue, for me the biggest are:
1. Rust's errors aren't like Java's exceptions because they're type safe and in most cases the type of error can't change by itself.
2. Sometimes matching can be more ergonomic, and before the `track_caller` feature got introduced it was actually easier to track the panic location with explicit `panic!` than with `expect`.

Currently clippy is failing to build because of a breaking change in rust-lang#69171 I tried fixing it but it is too complex for my little knowledge of clippy and rustc so I'll leave that to people who know what they're doing :)

Another thing, if rustc is breaking clippy a lot then maybe it's better to use something like `miri` does, where it's hard codes the latest tested rustc commit and they keep bumping it, that way when you develop locally it should work even if there was a breaking change (https://github.com/rust-lang/miri/blob/master/rustup-toolchain#L23-L29)

changelog: Downgrade `match_wild_err_arm` to pedantic
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jul 14, 2024
…alfJung

Refactor float casting tests, add `f16` and `f128`

This is an attempt to remove the magic from a lot of the numbers tested, which makes things easier when adding `f16` and `f128`. A nice side effect is that these tests now cover all int <-> float conversions with the same amount of tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

1 participant