Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Segv fault with nested closure #1566

Closed
lht opened this issue Jan 19, 2012 · 3 comments
Closed

Segv fault with nested closure #1566

lht opened this issue Jan 19, 2012 · 3 comments
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@lht
Copy link
Contributor

lht commented Jan 19, 2012

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.
lht added a commit that referenced this issue Jan 19, 2012
@catamorphism
Copy link
Contributor

Can't reproduce -- however, I'm on Mac. @lht , can you try to reproduce with a more recent revision?

@catamorphism
Copy link
Contributor

(or did your commit fix it?)

@lht
Copy link
Contributor Author

lht commented Apr 13, 2012

d699db6 was a work around.

Now the code is largely rewritten by graydon, so close this.

I'll try to submit a reduced test case if it's still an issue.

@lht lht closed this as completed Apr 13, 2012
nrc added a commit to nrc/rust that referenced this issue Sep 21, 2016
This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC rust-lang#1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too.

Supports both attribute-like and function-like macros.
bors added a commit that referenced this issue Sep 22, 2016
Adds a `ProcMacro` form of syntax extension

This commit adds syntax extension forms matching the types for procedural macros 2.0 (RFC #1566), these still require the usual syntax extension boiler plate, but this is a first step towards proper implementation and should be useful for macros 1.1 stuff too.

Supports both attribute-like and function-like macros.

Note that RFC #1566 has not been accepted yet, but I think there is consensus that we want to head in vaguely that direction and so this PR will be useful in any case. It is also fairly easy to undo and does not break any existing programs.

This is related to #35957 in that I hope it can be used in the implementation of macros 1.1, however, there is no direct overlap and is more of a complement than a competing proposal. There is still a fair bit of work to do before the two can be combined.

r? @jseyfried

cc @alexcrichton, @cgswords, @eddyb, @aturon
oli-obk pushed a commit to oli-obk/rust that referenced this issue May 2, 2020
Add lint for explicit deref and deref_mut method calls

This PR adds the lint `explicit_deref_method` that suggests replacing `deref()` and `deref_mut()` with `&*a` and `&mut *a`.

It doesn't lint inside macros.

This PR is the continuation of  rust-lang#3258.

changelog: Add lint `explicit_deref_method`.

Fixes: rust-lang#1566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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