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

rustc --ls segfaults on invalid files #11259

Closed
ghost opened this issue Jan 1, 2014 · 1 comment · Fixed by #11262
Closed

rustc --ls segfaults on invalid files #11259

ghost opened this issue Jan 1, 2014 · 1 comment · Fixed by #11262
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@ghost
Copy link

ghost commented Jan 1, 2014

$ echo > foo
$ rustc --ls foo
Segmentation fault (core dumped)
$ gdb -q --args rustc --ls foo
Reading symbols from /home/jurily/sys/bin/rustc...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/jurily/sys/bin/rustc --ls foo
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff7f5a700 (LWP 1017)]
[New Thread 0x7ffff2c59700 (LWP 1018)]
[New Thread 0x7ffff239e700 (LWP 1019)]
[New Thread 0x7ffff1b9d700 (LWP 1020)]
[New Thread 0x7ffff139c700 (LWP 1021)]
[New Thread 0x7ffff0b9b700 (LWP 1022)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7f5a700 (LWP 1017)]
0x00007ffff5377fad in LLVMDisposeMemoryBuffer () from /home/jurily/sys/bin/../lib/librustc-5b94a16f-0.9-pre.so
(gdb) bt
#0  0x00007ffff5377fad in LLVMDisposeMemoryBuffer () from /home/jurily/sys/bin/../lib/librustc-5b94a16f-0.9-pre.so
#1  0x00007ffff4830cf1 in metadata::loader::get_metadata_section::h3330abedea556404aF::v0.9.pre () from /home/jurily/sys/bin/../lib/librustc-5b94a16f-0.9-pre.so
#2  0x00007ffff4831714 in metadata::loader::list_file_metadata::hc98d9a2045147b9caN::v0.9.pre () from /home/jurily/sys/bin/../lib/librustc-5b94a16f-0.9-pre.so
#3  0x00007ffff484f40e in driver::driver::list_metadata::h8d94c62f4b32e7f4av::v0.9.pre () from /home/jurily/sys/bin/../lib/librustc-5b94a16f-0.9-pre.so
#4  0x00007ffff48627aa in run_compiler::h737284f8d64daad7aC::v0.9.pre () from /home/jurily/sys/bin/../lib/librustc-5b94a16f-0.9-pre.so
#5  0x00007ffff4870f9d in main_args::anon::expr_fn::at () from /home/jurily/sys/bin/../lib/librustc-5b94a16f-0.9-pre.so
#6  0x00007ffff486eff4 in monitor::anon::expr_fn::aO () from /home/jurily/sys/bin/../lib/librustc-5b94a16f-0.9-pre.so
#7  0x00007ffff486809e in task::TaskBuilder::try::anon::expr_fn::sEaCag () from /home/jurily/sys/bin/../lib/librustc-5b94a16f-0.9-pre.so
#8  0x00007ffff7422638 in task::__extensions__::build_start_wrapper::anon::anon::expr_fn::ab () from /home/jurily/sys/bin/../lib/libgreen-3b3a1962-0.9-pre.so
#9  0x00007ffff7767d08 in rt::task::__extensions__::run::anon::expr_fn::aW () from /home/jurily/sys/bin/../lib/libstd-04ff901e-0.9-pre.so
#10 0x00007ffff776f1dc in rust_try () from /home/jurily/sys/bin/../lib/libstd-04ff901e-0.9-pre.so
#11 0x00007ffff7767a75 in rt::task::Task::run::he7be25f7e8ea1d74YJaS::v0.9.pre () from /home/jurily/sys/bin/../lib/libstd-04ff901e-0.9-pre.so
#12 0x00007ffff74220fb in task::__extensions__::build_start_wrapper::anon::expr_fn::aV () from /home/jurily/sys/bin/../lib/libgreen-3b3a1962-0.9-pre.so
#13 0x0000000000000000 in ?? ()
@alexcrichton
Copy link
Member

Thanks for the backtrace! Looks like this is a bug in our usage of LLVM's archive bindings.

flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 7, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Don't pass extra generic arguments in `needless_borrow`

fixes rust-lang#10253

Also switches to using `implements_trait` which does ICE when clippy's debug assertions are enabled.

changelog: None
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

Successfully merging a pull request may close this issue.

1 participant