Skip to content

Compiler crashes when loading macros from a crate that contains syntax extensions #13474

Closed
@vosen

Description

@vosen

Rustc crashes when running following code:

#![feature(phase)]

#[phase(syntax)] extern crate fourcc;

fn main() { }

Here's gdb output:

(gdb) r fourcc-crash.rs
Starting program: D:\dev\Rust\bin\rustc.exe fourcc-crash.rs
[New Thread 3524.0x1894]
[New Thread 3524.0x14f4]

You've met with a terrible fate, haven't you?

fatal runtime error: runtime tls key not initialized
stack backtrace:
   1: 0x6eeb1a3f
   2: 0x6ef13a28
   3: 0x6eeb370f
   4: 0x712c12c3
   5:  0x18b8332

Program received signal SIGILL, Illegal instruction.
[Switching to Thread 3524.0x14f4]
0x6eeb1a59 in rt::util::abort::h439cebf64f55f5c1U4a::v0.11.pre () from D:\dev\Rust\bin\std-aad93cea-0.11-pre.dll
(gdb) bt
#0  0x6eeb1a59 in rt::util::abort::h439cebf64f55f5c1U4a::v0.11.pre () from D:\dev\Rust\bin\std-aad93cea-0.11-pre.dll
#1  0x6ef13a28 in rt::local_ptr::native::unsafe_borrow::h0d5317ed6ed9ce06fW9::v0.11.pre ()
   from D:\dev\Rust\bin\std-aad93cea-0.11-pre.dll
#2  0x6eeb370f in local_data::get_local_map::h6aadaf5daa81cd9c0pF::v0.11.pre () from D:\dev\Rust\bin\std-aad93cea-0.11-pre.dll
#3  0x678f52d7 in parse::token::get_ident_interner::h0bb6c51e2d627c67UjI::v0.11.pre ()
   from D:\dev\Rust\bin\syntax-5de2fc8e-0.11-pre.dll
#4  0x712c12c3 in macro_registrar::h5cf23ffc818750f9vaa::v0.11.pre ()
   from D:\dev\Rust\bin\rustlib\i686-pc-mingw32\lib\fourcc-e7a24ce8-0.11-pre.dll
#5  0x018b8332 in ext::expand::load_extern_macros::h08746a7dabbaf50avGR::v0.11.pre ()
#6  0x018b11bb in fold::noop_fold_mod::closure.26381 ()
#7  0x018b0eab in iter::Iterator::collect::ha510073717ed79ffV03::v0.11.pre ()
#8  0x018b0d03 in fold::Folder::fold_mod::h3063a8a13c6911b8d5x::v0.11.pre ()
#9  0x018d449d in ext::expand::expand_crate::h5be3510f9f4aeaebn4R::v0.11.pre ()
#10 0x00b838b6 in driver::driver::phase_2_configure_and_expand::closure.88027 ()
#11 0x00b832e9 in util::common::time::h176addc10893f0b78Pg::v0.11.pre ()
#12 0x00b812f5 in driver::driver::phase_2_configure_and_expand::h5264ff43d70fb058kye::v0.11.pre ()
#13 0x00bbe512 in driver::driver::compile_input::hda7d83b4f81d42b9D1e::v0.11.pre ()
#14 0x00be34c4 in run_compiler::hcafaeca05b1b783eIxm::v0.11.pre ()
#15 0x00bf5267 in main_args::closure.92185 ()
#16 0x00bf3c69 in monitor::closure.92070 ()
#17 0x00befefe in task::TaskBuilder::try::closure.91842 ()
#18 0x004274b3 in task::spawn_opts::closure.7691 ()
#19 0x01a5acac in rt::task::Task::run::closure.40013 ()
#20 0x01a5ed05 in rt::unwind::Unwinder::try::try_fn::he27cd916ec604645k79::v0.11.pre ()
#21 0x01a66016 in rust_try ()
#22 0x01a5ab84 in rt::task::Task::run::hd417a7b2504dfe98eA8::v0.11.pre ()
#23 0x00427360 in task::spawn_opts::closure.7664 ()
#24 0x01a5e0ed in rt::thread::thread_start::h63560cc2549b235dWe9::v0.11.pre ()
#25 0x74cb495d in KERNEL32!BaseThreadInitThunk () from C:\Windows\SysWOW64\kernel32.dll
#26 0x772598ee in ?? ()
#27 0x772598c4 in ?? ()
#28 0x00000000 in ?? ()

Note, it works fine with crates that use macros defined with macro_rules (e.g. log) or with phase(link) instead of phase(syntax).

I'm using Windows 8.1 x64 with nightly installer that I've had downloaded few hours ago, but I've also installed 0.10 and it has the same problem:

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensionsI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions