Skip to content

Segv fault with nested closure #1566

Closed
Closed
@lht

Description

@lht

7ffb2cb adds a nest closure invocation (7ffb2cb#L1R206), boxed closure calls another closure. This leads a segv fault when "--time-passes" option is specified.

$ gdb --args rustc --time-passes hello.rs 
GNU gdb (GDB) 7.4.50.20111220-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /opt/apps/rust/bin/rustc...(no debugging symbols found)...done.
(gdb) r
Starting program: /opt/apps/rust/bin/rustc --time-passes hello.rs
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff50f9700 (LWP 18787)]
[New Thread 0x7ffff4ff8700 (LWP 18788)]
time: parsing took 0.001 s
time: configuration took 0. s
time: maybe building test harness took 0. s
time: expansion took 0.002 s
time: ast indexing took 0. s
time: external crate/lib resolution took 0.001 s
time: resolution took 0.001 s
time: freevar finding took 0. s
time: const checking took 0. s
time: typechecking took 0. s
time: block-use checking took 0. s
time: function usage took 0. s
time: alt checking took 0. s
time: typestate checking took 0. s
time: mutability checking took 0. s
time: alias checking took 0. s
time: last use finding took 0. s
time: kind checking took 0.001 s
time: ctypes usage checking took 0. s

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff4ff8700 (LWP 18788)]
0x00007ffff716f003 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt full
#0  0x00007ffff716f003 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x00007ffff7aa5555 in driver::driver::time::_2925275cd6f877c9 () from /opt/apps/rust/bin/../lib/librustc-4171d83aef249987-0.1.so
No symbol table info available.
#2  0x00007ffff7bb96dc in driver::driver::compile_upto::thunk11768 () from /opt/apps/rust/bin/../lib/librustc-4171d83aef249987-0.1.so
No symbol table info available.
#3  0x00007ffff7b46881 in middle::lint::check_crate::anon5102 () from /opt/apps/rust/bin/../lib/librustc-4171d83aef249987-0.1.so
No symbol table info available.
#4  0x00007ffff7fb6fea in vec::iter::anon417 () from /opt/apps/rust/bin/../lib/libcore-14bd852465126fe7-0.1.so
No symbol table info available.
#5  0x00007ffff7f7d568 in vec::iteri::_f9f61fe679ead286 () from /opt/apps/rust/bin/../lib/libcore-14bd852465126fe7-0.1.so
No symbol table info available.
#6  0x00007ffff7f7d258 in vec::iter::_c0bc561ba6abbe10 () from /opt/apps/rust/bin/../lib/libcore-14bd852465126fe7-0.1.so
No symbol table info available.
#7  0x00007ffff78bcf3a in middle::lint::check_crate::_763f5f30f3e3fa4c () from /opt/apps/rust/bin/../lib/librustc-4171d83aef249987-0.1.so
No symbol table info available.
#8  0x00007ffff7aaa0ef in driver::driver::compile_upto::_32e1431ba4116c47 () from /opt/apps/rust/bin/../lib/librustc-4171d83aef249987-0.1.so
No symbol table info available.
#9  0x00007ffff7bc726c in __morestack () from /opt/apps/rust/bin/../lib/librustc-4171d83aef249987-0.1.so
No symbol table info available.
#10 0x00007ffff7aabd49 in driver::driver::compile_input::_c737a0a9ebec1b6f () from /opt/apps/rust/bin/../lib/librustc-4171d83aef249987-0.1.so
No symbol table info available.
#11 0x00007ffff7bc726c in __morestack () from /opt/apps/rust/bin/../lib/librustc-4171d83aef249987-0.1.so
No symbol table info available.
#12 0x00000000004073ae in run_compiler::_7aa956a87f74f861 ()
No symbol table info available.
#13 0x000000000040d0bc in __morestack ()
No symbol table info available.
#14 0x000000000040cbbb in main::anon241 ()
No symbol table info available.
#15 0x000000000040c116 in monitor::anon205 ()
No symbol table info available.
#16 0x00007ffff7fc1dc9 in task::try::anon705 () from /opt/apps/rust/bin/../lib/libcore-14bd852465126fe7-0.1.so
No symbol table info available.
#17 0x00007ffff76349d2 in task_start_wrapper (a=0x43441c) at ../src/rt/rust_task.cpp:356
        task = 0x42ed90
        threw_exception = false
        env = <optimized out>
        ca = {spargs = 0x0, threw_exception = false}
#18 0x0000000000000000 in ?? ()
No symbol table info available.

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

    Issue actions