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

rustctest Segmentation fault when fs::path_is_dir uses type c_int #1558

Closed
lht opened this issue Jan 18, 2012 · 3 comments
Closed

rustctest Segmentation fault when fs::path_is_dir uses type c_int #1558

lht opened this issue Jan 18, 2012 · 3 comments
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@lht
Copy link
Contributor

lht commented Jan 18, 2012

When fixing #1403, fs::path_is_dir is left using a number 0i32 instead of 0 as c_int (see commit 7b1724f), otherwise, I see a segv fault with backtrace as below:

$ gdb x86_64-unknown-linux-gnu/test/rustctest.stage2-x86_64-unknown-linux-gnu
Reading symbols from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/rustctest.stage2-x86_64-unknown-linux-gnu...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/rustctest.stage2-x86_64-unknown-linux-gnu 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5878700 (LWP 20741)]
[New Thread 0x7ffff5777700 (LWP 20742)]

running 29 tests
test back::rpath::test::test_get_absolute1 ... FAILED

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff5878700 (LWP 20741)]
0x00007ffff7eeda4b in glue_free2021 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
(gdb) bt
#0  0x00007ffff7eeda4b in glue_free2021 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#1  0x00007ffff7eed9df in glue_drop2020 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#2  0x00007ffff7eed965 in glue_drop2019 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#3  0x00007ffff7ef57db in glue_drop2198 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#4  0x00007ffff7ef6504 in glue_drop2212 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#5  0x00007ffff7ef7042 in glue_drop2225 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#6  0x00007ffff7eb7d62 in glue_free253 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#7  0x00007ffff7eb7ccd in glue_drop252 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#8  0x00007ffff7ef28d5 in glue_drop2127 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#9  0x00007ffff7ef2853 in glue_drop2126 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#10 0x00007ffff7eacb4e in test::run_tests::_b2b4944147f45824 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#11 0x00007ffff7ef8fcc in __morestack () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#12 0x00007ffff7ea503e in test::run_tests_console_::_20a312bb6a70b92c () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#13 0x00007ffff7ef8fcc in __morestack () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#14 0x00007ffff7ea48c0 in test::run_tests_console::_b640772086d1e9b7 () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#15 0x00007ffff7ea3c6c in test::test_main::_938cbc5ad8bceb7e () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#16 0x00007ffff7ef8fcc in __morestack () from /home/lht/code/rust/build/x86_64-unknown-linux-gnu/test/../stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-79ca5fac56b63fde-0.1.so
#17 0x00000000007be546 in __test::main::_6178e9efa23b8931 ()
#18 0x00000000007be622 in _rust_main ()
#19 0x00007ffff677aa02 in task_start_wrapper (a=0x9fbc4c) at ../src/rt/rust_task.cpp:356
#20 0x0000000000000000 in ?? (

Apparently, this firstly happened after applying the applying the patches of #1403 on commit 6e27b27.

@nikomatsakis
Copy link
Contributor

I am digging into this a bit. Somehow what ends up happening is that the env ptr of a closure is equal to "1" (it probably ought to be "0"). Not yet sure why.

@brson
Copy link
Contributor

brson commented Jan 18, 2012

Mysterious.

@brson
Copy link
Contributor

brson commented Feb 6, 2012

The issue seems to have resolved itself. I checked in the change to use c_int there.

@brson brson closed this as completed Feb 6, 2012
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
…ust-lang#1558)

* add sorting of harnesses

* add mult harnesses test

* remove --harness from existing tests

* remove --harness from docs page

* add better comment for sort_harnesses

* refactor: switch tests to use 'print' flag

* refactor: copy harnesses instead of in-place modification

* refactor: update sort fn name
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

3 participants