Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compiler segfaults after printing error in some tests #936

Closed
marijnh opened this issue Sep 16, 2011 · 11 comments
Closed

Compiler segfaults after printing error in some tests #936

marijnh opened this issue Sep 16, 2011 · 11 comments
Assignees
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@marijnh
Copy link
Contributor

marijnh commented Sep 16, 2011

I observed this in src/test/compile-fail/extft-non-literal.rs and src/test/compile-fail/extft-non-literal2.rs , might be happening in others. This is probably an unwinding bug.

With some changes to our generated code (I was working on making calls simpler), it hangs instead of segfaulting when extft-non-literal2.rs fails.

@ghost ghost assigned brson Sep 16, 2011
@brson
Copy link
Contributor

brson commented Sep 16, 2011

I don't see this, and a segfaulting compiler should cause tests to fail now. Was the crash in map perchance? I've seen that a number of times.

@marijnh
Copy link
Contributor Author

marijnh commented Sep 16, 2011

What happens when you try to compile one of these from the command-line? For me, it prints out the error, then segfaults with this stack trace:


#0  0x082d097f in glue_drop208 ()
#1  0x081d5dc1 in syntax::fold::noop_fold_local ()
#2  0x0830fdeb in syntax::fold::make_fold::thunk5295 ()
#3  0x0830cf72 in syntax::fold::noop_fold_decl::anon5136 ()
#4  0xf7f0e129 in vec::map () from stage1/libstd.so
#5  0x081d0821 in syntax::fold::noop_fold_decl ()
#6  0x0830f555 in syntax::fold::make_fold::thunk5285 ()
#7  0x081cf5e3 in syntax::fold::noop_fold_stmt ()
#8  0x0830f235 in syntax::fold::make_fold::thunk5282 ()
#9  0xf7f0e129 in vec::map () from stage1/libstd.so
#10 0x081cf311 in syntax::fold::noop_fold_block ()
#11 0x0830f13f in syntax::fold::make_fold::thunk5281 ()
#12 0x081d4efe in syntax::fold::noop_fold_fn ()
#13 0x0830fa74 in syntax::fold::make_fold::thunk5289 ()
#14 0x081cdd9d in syntax::fold::noop_fold_item_underscore ()
#15 0x0830efae in syntax::fold::make_fold::thunk5279 ()
#16 0x081cd81e in syntax::fold::noop_fold_item ()
#17 0x0830ef57 in syntax::fold::make_fold::thunk5278 ()
#18 0xf7f0e129 in vec::map () from stage1/libstd.so
#19 0x081d53fa in syntax::fold::noop_fold_mod ()
#20 0x0830fadd in syntax::fold::make_fold::thunk5290 ()
#21 0x081cc087 in syntax::fold::noop_fold_crate ()
#22 0x0830ebcf in syntax::fold::make_fold::thunk5274 ()
#23 0x0823b5a8 in syntax::ext::expand::expand_crate ()
#24 0x0833c769 in driver::rustc::compile_input::thunk7959 ()
#25 0x082a139d in driver::rustc::time ()
#26 0x082a2cd5 in driver::rustc::compile_input ()
#27 0x082bc567 in driver::rustc::main ()
#28 0x082c61b4 in _rust_main ()
#29 0x0834358c in _rust_main_wrap ()
#30 0xf7fa9b31 in task_start_wrapper (a=0xf6b9e010) at ./src/rt/rust_task.cpp:149
#31 0xdeadbeef in ?? ()

@brson
Copy link
Contributor

brson commented Sep 16, 2011

You are right, and the test runner isn't looking for a specific non-zero return value when it runs the compiler. I wonder how many of these compile failures are actually segfaults...

@brson
Copy link
Contributor

brson commented Sep 16, 2011

The anwser is 18. 18 compile-fail tests are segfaulting.

@brson
Copy link
Contributor

brson commented Sep 16, 2011

Also opened #938 to make the test runner catch this in the future

@marijnh
Copy link
Contributor Author

marijnh commented Sep 18, 2011

So this is not a symptom of #939 then?

@brson
Copy link
Contributor

brson commented Sep 18, 2011

#939 did fix one of them

@marijnh
Copy link
Contributor Author

marijnh commented Sep 18, 2011

Fair enough. I'm going to xfail a few that hang instead of segfaulting with a patch I'm trying to land. Will refer to this bug in the patch, so that we can be sure to re-enable the tests when the problem is found.

@brson
Copy link
Contributor

brson commented Sep 19, 2011

Now 14 failures:

    [compile-fail] ../src/test/compile-fail/ext-nonexistent.rs
    [compile-fail] ../src/test/compile-fail/extenv-no-args.rs
    [compile-fail] ../src/test/compile-fail/extenv-not-string-literal.rs
    [compile-fail] ../src/test/compile-fail/extenv-too-many-args.rs
    [compile-fail] ../src/test/compile-fail/extfmt-missing-type.rs
    [compile-fail] ../src/test/compile-fail/extfmt-no-args.rs
    [compile-fail] ../src/test/compile-fail/extfmt-non-literal.rs
    [compile-fail] ../src/test/compile-fail/extfmt-not-enough-args.rs
    [compile-fail] ../src/test/compile-fail/extfmt-unknown-type.rs
    [compile-fail] ../src/test/compile-fail/extfmt-unsigned-plus.rs
    [compile-fail] ../src/test/compile-fail/extfmt-unsigned-space.rs
    [compile-fail] ../src/test/compile-fail/extfmt-unterminated-conv.rs
    [compile-fail] ../src/test/compile-fail/macro-2.rs
    [compile-fail] ../src/test/compile-fail/macro.rs

brson added a commit that referenced this issue Sep 19, 2011
This converts the AST fold into a resource that breaks it's own circular
reference (just a temporary workaround until GC), so that failure during fold
will unwind correctly.

Issue #936
brson added a commit that referenced this issue Sep 19, 2011
@brson brson closed this as completed Sep 19, 2011
@brson brson reopened this Sep 19, 2011
@brson
Copy link
Contributor

brson commented Sep 19, 2011

Had to revert 6eabe6f. Works for me, not for the tinderbox.

@brson
Copy link
Contributor

brson commented Sep 19, 2011

Now these four fail with optimizations on, not with optimizations off:

    [compile-fail] /home/rustbuild/src/rust-tinderbox/srcdir-master-x86_64-unknown-linux-gnu/src/test/compile-fail/extfmt-non-literal.rs
    [compile-fail] /home/rustbuild/src/rust-tinderbox/srcdir-master-x86_64-unknown-linux-gnu/src/test/compile-fail/extfmt-non-literal2.rs
    [compile-fail] /home/rustbuild/src/rust-tinderbox/srcdir-master-x86_64-unknown-linux-gnu/src/test/compile-fail/extfmt-not-enough-args.rs
    [compile-fail] /home/rustbuild/src/rust-tinderbox/srcdir-master-x86_64-unknown-linux-gnu/src/test/compile-fail/extfmt-too-many-args.rs

# for free to join this conversation on GitHub. Already have an account? # 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

2 participants