You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
glibc malloc/free crash with destructors and util::ignore, only in coretest. #3161
Write mod crash; in libcore/core.rc, and add libcore/crash.rs:
#[test]
fn make_crash() {
struct defer {
x: &~();
new(x: &~()) { self.x = x; }
drop { // Get rid of the destructor and it doesn't crash.
}
}
let x = ~();
// If you just write let z = defer(~~()) it doesn't crash.
let z = defer(&x);
// If you just write util::ignore(defer(x)) it doesn't crash.
util::ignore(z);
// If you write "pure fn ignore<T>(+_x: T) { }" (i.e., exactly the same as
// it is in util) and call that instead, it doesn't crash.
}
Then make check-stage0-core.
Backtrace:
#3 0x00007ffff671a626 in malloc_printerr (action=3, str="free(): invalid pointer", ptr=<optimized out>)
#4 0x00007ffff6f9800d in __morestack ()
#5 0x00007ffff6f87028 in call_on_c_stack (fn_ptr=0x7ffff6f85e80, args=0x7fffec101330, this=0x7fffe8105a50)
#6 call_upcall_on_c_stack (fn_ptr=0x7ffff6f85e80, args=0x7fffec101330, task=<optimized out>)
#7 upcall_exchange_free (ptr=<optimized out>)
#8 0x0000000000540107 in __test::tests::anon ()
#9 0x00007ffff768f581 in task::spawn_raw::make_child_wrapper::anon ()
#10 0x00007ffff76d8d3c in __morestack ()
#11 0x00007ffff6f84564 in task_start_wrapper (a=0x7fffe81068a0)
For the life of me I could not get it to work outside of coretest. I tried std and I tried in its own module. Probably this means it's related to #2912.
you misunderstand; I am lamenting that the Bug Fairy never came along and told us the story out of the blue (with proverbial free lunch also provided). ;)
Activity
bblum commentedon Aug 9, 2012
Disassembly of
__test::tests::anon: http://pastebin.mozilla.org/1745826bblum commentedon Aug 18, 2012
More minimal:
The destructor just doesn't run.
bblum commentedon Aug 18, 2012
More minimal still:
catamorphism commentedon Dec 7, 2012
This appears to be fixed as of b60a0be (I only tried the most minimal test case).
bblum commentedon Dec 7, 2012
bummer we never figured out what it was
catamorphism commentedon Dec 7, 2012
You're welcome to check out a revision where it doesn't work and try to find the bug :-D
bblum commentedon Dec 7, 2012
you misunderstand; I am lamenting that the Bug Fairy never came along and told us the story out of the blue (with proverbial free lunch also provided). ;)
Auto merge of rust-lang#3161 - devnexen:freebsd_upd2, r=RalfJung
Upgrade toolchain to 2024-04-22 (rust-lang#3171)
Merge pull request rust-lang#3161 from Veetaha/feature/cicd-simplify-…