Skip to content

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

Closed
@lht

Description

@lht
Contributor

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.

Activity

nikomatsakis

nikomatsakis commented on Jan 18, 2012

@nikomatsakis
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

brson commented on Jan 18, 2012

@brson
Contributor

Mysterious.

brson

brson commented on Feb 6, 2012

@brson
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lht@brson@nikomatsakis

        Issue actions

          rustctest Segmentation fault when fs::path_is_dir uses type c_int · Issue #1558 · rust-lang/rust