rust-lang / rust

Empowering everyone to build reliable and efficient software.

Home Page:https://www.rust-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unhandled panic during parsing

kmcallister opened this issue · comments

Found with american fuzzy lop.

fn main() {
    [c||"ted"%; 2]
}
1:2:15: 2:16 error: unexpected token: `;`
1:2     [c||"ted"%; 2]
                  ^
fatal runtime error: Could not unwind stack, error = 5

Program received signal SIGILL, Illegal instruction.
[Switching to Thread 0x7fffef3ff700 (LWP 13149)]
0x00007ffff74972bf in rust_panic () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-4e7c5e5c.so
(gdb) bt
#0  0x00007ffff74972bf in rust_panic () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-4e7c5e5c.so
#1  0x00007ffff73cf5bb in rt::unwind::begin_unwind_inner::h01964e4bf420981ehzI () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-4e7c5e5c.so
#2  0x00007ffff73cf900 in rt::unwind::begin_unwind_fmt::hc10d5bfd6c2d0e48VxI () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-4e7c5e5c.so
#3  0x00007ffff74973e8 in rust_begin_unwind () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-4e7c5e5c.so
#4  0x00007ffff74f3b95 in panicking::panic_fmt::h0bca819b6eed914c5jC () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-4e7c5e5c.so
#5  0x00007ffff74eb3c5 in panicking::panic::he4dce1a833b2e2c2CiC () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libstd-4e7c5e5c.so
#6  0x00007ffff46de9f9 in alloc..rc..Rc$LT$collections..string..String$GT$::drop.50002::h91f7094dcbfb1c94 () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libsyntax-4e7c5e5c.so
#7  0x00007ffff46debf2 in collections..vec..Vec$LT$util..interner..RcStr$GT$::drop.50119::h14134897e0ba359f () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libsyntax-4e7c5e5c.so
#8  0x00007ffff46eae0d in alloc..rc..Rc$LT$util..interner..StrInterner$GT$::drop.51510::hd31f6daea199de99 () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libsyntax-4e7c5e5c.so
#9  0x00007ffff48015ae in thread::__local::imp::destroy_value::h16820672892060373536 () from /home/keegan/rust-master/x86_64-unknown-linux-gnu/stage2/bin/../lib/libsyntax-4e7c5e5c.so
#10 0x00007ffff6f8b1b6 in __GI___call_tls_dtors () at cxa_thread_atexit_impl.c:88
#11 0x00007ffff13dd0b2 in start_thread (arg=0x7fffef3ff700) at pthread_create.c:319
#12 0x00007ffff703904d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Tested on rustc 1.0.0-dev (f207ecb 2015-04-03) (built 2015-04-04). Also happens on play.rust-lang.org

Does not affect new (e4f9ddb 2015-04-10) rustc.

Confirmed fixed on rustc 1.0.0-dev (6b95d8b 2015-04-09) (built 2015-04-10).