Closed
Description
Smallest sample code I could come up with: https://gist.github.com/d679876d14dd6990494ca65440800dad
When the program reaches main.cpp,L8 (env::args().nth(0).unwrap();
), it crashes with a segfault. This did not happen in v1.19.0.
Version:
rustc 1.20.0 (f3d6973f4 2017-08-27)
binary: rustc
commit-hash: f3d6973f41a7d1fb83029c9c0ceaf0f5d4fd7208
commit-date: 2017-08-27
host: x86_64-apple-darwin
release: 1.20.0
LLVM version: 4.0
Backtrace with rust-lldb:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
* frame #0: 0x00000001003f0ca9 libsystem_platform.dylib`OSSpinLockLock + 7
frame #1: 0x00000001000091ad what`je_arena_dalloc_small [inlined] je_malloc_mutex_lock at mutex.h:83 [opt]
frame #2: 0x0000000100009195 what`je_arena_dalloc_small [inlined] je_arena_dalloc_bin(arena=&0x1000007feedfacf, chunk=&0x100400000, ptr=&0x100502cc0, pageind=<unavailable>) at arena.c:2760 [opt]
frame #3: 0x000000010000915a what`je_arena_dalloc_small(tsd=&0x10120c008, arena=&0x1000007feedfacf, chunk=&0x100400000, ptr=&0x100502cc0, pageind=<unavailable>) at arena.c:2777 [opt]
frame #4: 0x0000000100003783 what`je_sdallocx at arena.h:1428 [opt]
frame #5: 0x00000001000036a2 what`je_sdallocx [inlined] je_isdalloct at jemalloc_internal.h:1086 [opt]
frame #6: 0x00000001000036a2 what`je_sdallocx [inlined] je_isqalloc(ptr=<unavailable>) at jemalloc_internal.h:1096 [opt]
frame #7: 0x0000000100003694 what`je_sdallocx [inlined] isfree(tcache=<unavailable>) at jemalloc.c:1842 [opt]
frame #8: 0x000000010000368f what`je_sdallocx(ptr=<unavailable>, size=<unavailable>, flags=<unavailable>) at jemalloc.c:2532 [opt]
frame #9: 0x0000000100002645 what`alloc::heap::{{impl}}::dealloc(self=&0x7fff5fbff690, ptr=&0x100502cc0, layout=Layout {
size: 19,
align: 1
}) at heap.rs:103
frame #10: 0x00000001000015af what`alloc::raw_vec::{{impl}}::dealloc_buffer<u8,alloc::heap::Heap>(self=&0x7fff5fbff680) at raw_vec.rs:637
frame #11: 0x0000000100002bcd what`alloc::raw_vec::{{impl}}::drop<u8,alloc::heap::Heap>(self=&0x7fff5fbff680) at raw_vec.rs:645
frame #12: 0x0000000100001b75 what`core::ptr::drop_in_place<alloc::raw_vec::RawVec<u8, alloc::heap::Heap>>((null)=&0x7fff5fbff680) at ptr.rs:60
frame #13: 0x0000000100001be0 what`core::ptr::drop_in_place<alloc::vec::Vec<u8>>((null)=&0x7fff5fbff680) at ptr.rs:60
frame #14: 0x0000000100001ce5 what`core::ptr::drop_in_place<alloc::string::String>((null)=&0x7fff5fbff680) at ptr.rs:60
frame #15: 0x0000000100002c68 what`what::main at main.rs:8
frame #16: 0x000000010010630d libfoo.so`__rust_maybe_catch_panic + 29
frame #17: 0x0000000100100809 libfoo.so`std::rt::lang_start::heed3cc6f59fb65ca + 473
frame #18: 0x0000000100002cca what`main + 42
frame #19: 0x00000001002f3235 libdyld.dylib`start + 1