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

x86_64 to i686 cross compile: down-with-thread-dtors.stage2 SEGVs only under valgrind #31328

Closed
nodakai opened this issue Jan 31, 2016 · 9 comments
Labels
A-cross Area: Cross compilation

Comments

@nodakai
Copy link
Contributor

nodakai commented Jan 31, 2016

Not even sure if this is a real bug or not, but it's 100% reproducible in my environment, even after make clean.

$ uname -a
Linux d9 4.2.0-1-amd64 #1 SMP Debian 4.2.5-1 (2015-10-27) x86_64 GNU/Linux
$ valgrind --version
valgrind-3.11.0
$ ./configure --prefix=$HOME/local/rust --enable-local-rust --local-rust-root=$HOME/local/rust0 --target=x86_64-unknown-linux-gnu,i686-unknown-linux-gnu
...
$ make check-stage2-rpass-valgrind VERBOSE=1 RUST_BACKTRACE=1
cfg: version 1.8.0-dev (9a07087bc 2016-01-30)
cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu i686-unknown-linux-gnu
cfg: non-build target triples i686-unknown-linux-gnu
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: host for i686-unknown-linux-gnu is i386
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: os for i686-unknown-linux-gnu is unknown-linux-gnu
cfg: have good valgrind for x86_64-unknown-linux-gnu
cfg: have good valgrind for i686-unknown-linux-gnu
cfg: using CC=gcc (CFG_CC)
cfg: enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS)
cfg: valgrind-rpass command set to "/usr/bin/valgrind" --error-exitcode=100 --fair-sched=try --quiet --soname-synonyms=somalloc=NONE --suppressions=/home/nodakai/src/rust-HEAD/src/etc/x86.supp  --tool=memcheck --leak-check=full
cfg: including test rules
cfg: lexer tooling not available, skipping lexer test...
touch tmp/check-stage2-T-i686-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rpass-valgrind.ok.start_time
LD_LIBRARY_PATH=/home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/stage2/lib:/home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/llvm/Release/lib:$LD_LIBRARY_PATH x86_64-unknown-linux-gnu/stage2/bin/compiletest --compile-lib-path x86_64-unknown-linux-gnu/stage2/lib --run-lib-path x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib --rustc-path x86_64-unknown-linux-gnu/stage2/bin/rustc --rustdoc-path x86_64-unknown-linux-gnu/stage2/bin/rustdoc --llvm-bin-path /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/llvm/Release/bin --aux-base /home/nodakai/src/rust-HEAD/src/test/auxiliary/ --stage-id stage2-i686-unknown-linux-gnu --target i686-unknown-linux-gnu --host x86_64-unknown-linux-gnu --python "/usr/bin/python2.7" --gdb-version="GNU gdb (Debian 7.10-1+b1) 7.10" --lldb-version="" --android-cross-path=/opt/ndk_standalone --adb-path= --adb-test-dir= --host-rustcflags "   --cfg rtopt -C rpath -O -L x86_64-unknown-linux-gnu/rt" --lldb-python-dir= --target-rustcflags "-C linker=gcc -C ar=ar     --cfg rtopt -C rpath -O -L i686-unknown-linux-gnu/rt"  --verbose --valgrind-path ""/usr/bin/valgrind" --error-exitcode=100 --fair-sched=try --quiet --soname-synonyms=somalloc=NONE --suppressions=/home/nodakai/src/rust-HEAD/src/etc/x86.supp  --tool=memcheck --leak-check=full" --force-valgrind --src-base /home/nodakai/src/rust-HEAD/src/test/run-pass-valgrind/ --build-base x86_64-unknown-linux-gnu/test/run-pass-valgrind/ --mode run-pass-valgrind  --logfile tmp/check-stage2-T-i686-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rpass-valgrind.log && touch -r tmp/check-stage2-T-i686-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rpass-valgrind.ok.start_time tmp/check-stage2-T-i686-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rpass-valgrind.ok && rm tmp/check-stage2-T-i686-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rpass-valgrind.ok.start_time
configuration:
compile_lib_path: "x86_64-unknown-linux-gnu/stage2/lib"
run_lib_path: "x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib"
rustc_path: "x86_64-unknown-linux-gnu/stage2/bin/rustc"
rustdoc_path: "x86_64-unknown-linux-gnu/stage2/bin/rustdoc"
src_base: "/home/nodakai/src/rust-HEAD/src/test/run-pass-valgrind/"
build_base: "x86_64-unknown-linux-gnu/test/run-pass-valgrind/"
stage_id: stage2-i686-unknown-linux-gnu
mode: run-pass-valgrind
run_ignored: false
filter: (none)
runtool: (none)
host-rustcflags:    --cfg rtopt -C rpath -O -L x86_64-unknown-linux-gnu/rt
target-rustcflags: -C linker=gcc -C ar=ar     --cfg rtopt -C rpath -O -L i686-unknown-linux-gnu/rt
target: i686-unknown-linux-gnu
host: x86_64-unknown-linux-gnu
android-cross-path: "/opt/ndk_standalone"
adb_path: ""
adb_test_dir: "/i686-unknown-linux-gnu"
adb_device_status: false
verbose: true



running 8 tests
test [run-pass-valgrind] run-pass-valgrind/dst-dtor-1.rs ... ok
test [run-pass-valgrind] run-pass-valgrind/cleanup-auto-borrow-obj.rs ... ok
test [run-pass-valgrind] run-pass-valgrind/dst-dtor-2.rs ... ok
test [run-pass-valgrind] run-pass-valgrind/cast-enum-with-dtor.rs ... ok
test [run-pass-valgrind] run-pass-valgrind/osx-frameworks.rs ... ok
test [run-pass-valgrind] run-pass-valgrind/cleanup-stdin.rs ... ok
test [run-pass-valgrind] run-pass-valgrind/exit-flushes.rs ... ok
test [run-pass-valgrind] run-pass-valgrind/down-with-thread-dtors.rs ... FAILED

failures:

---- [run-pass-valgrind] run-pass-valgrind/down-with-thread-dtors.rs stdout ----


executing x86_64-unknown-linux-gnu/stage2/bin/rustc /home/nodakai/src/rust-HEAD/src/test/run-pass-valgrind/down-with-thread-dtors.rs -L x86_64-unknown-linux-gnu/test/run-pass-valgrind/ --target=i686-unknown-linux-gnu -L x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu.run-pass-valgrind.libaux -C prefer-dynamic -o x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu -C linker=gcc -C ar=ar --cfg rtopt -C rpath -O -L i686-unknown-linux-gnu/rt
------stdout------------------------------

------stderr------------------------------

------------------------------------------
executing /usr/bin/valgrind --error-exitcode=100 --fair-sched=try --quiet --soname-synonyms=somalloc=NONE --suppressions=/home/nodakai/src/rust-HEAD/src/etc/x86.supp --tool=memcheck --leak-check=full x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu
------stdout------------------------------

------stderr------------------------------
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/ld-2.21.so:
--6449-- Ignoring non-Dwarf2/3/4 block in .debug_info
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/ld-2.21.so:
--6449-- Last block truncated in .debug_info; ignoring
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/ld-2.21.so:
--6449-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/libc-2.21.so:
--6449-- Ignoring non-Dwarf2/3/4 block in .debug_info
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/libc-2.21.so:
--6449-- Last block truncated in .debug_info; ignoring
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/libc-2.21.so:
--6449-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/libdl-2.21.so:
--6449-- Ignoring non-Dwarf2/3/4 block in .debug_info
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/libdl-2.21.so:
--6449-- Last block truncated in .debug_info; ignoring
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/libdl-2.21.so:
--6449-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/libm-2.21.so:
--6449-- Ignoring non-Dwarf2/3/4 block in .debug_info
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/libm-2.21.so:
--6449-- Last block truncated in .debug_info; ignoring
--6449-- WARNING: Serious error when reading debug info
--6449-- When reading debug info from /lib/i386-linux-gnu/libm-2.21.so:
--6449-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
==6449== Can't extend stack to 0x4bb9880 during signal delivery for thread 2:
==6449==   no stack segment                                         
==6449==                                                            
==6449== Process terminating with default action of signal 11 (SIGSEGV)
==6449==  Access not within mapped region at address 0x4BB9880      
==6449==    at 0x10936F: Bar::drop.4321::h008b747fa83237a8 (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu)
==6449==    by 0x4C42A3B: __call_tls_dtors (in /lib/i386-linux-gnu/libc-2.21.so)
==6449==    by 0x4BDFF78: start_thread (pthread_create.c:343)       
==6449==    by 0x4CE7C5D: clone (in /lib/i386-linux-gnu/libc-2.21.so)
==6449==  If you believe this happened as a result of a stack       
==6449==  overflow in your program's main thread (unlikely but      
==6449==  possible), you can try to increase the size of the        
==6449==  main thread stack using the --main-stacksize= flag.       
==6449==  The main thread stack size used in this run was 8388608.  
==6449== 152 bytes in 1 blocks are possibly lost in loss record 6 of 7
==6449==    at 0x482E118: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6449==    by 0x4010B06: allocate_dtv (in /lib/i386-linux-gnu/ld-2.21.so)
==6449==    by 0x40114EB: _dl_allocate_tls (in /lib/i386-linux-gnu/ld-2.21.so)
==6449==    by 0x4BE07B4: allocate_stack (allocatestack.c:587)      
==6449==    by 0x4BE07B4: pthread_create@@GLIBC_2.1 (pthread_create.c:537)
==6449==    by 0x48E1BB6: sys::thread::Thread::new::h2db9ab5f5bc239c37ux (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-db5a760f.so)
==6449==    by 0x1096D0: main::h225df9f85db6309aGfa (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu)
==6449==    by 0x48F2ECA: sys_common::unwind::try::try_fn::h17787564768047935801 (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-db5a760f.so)
==6449==    by 0x48E9DE7: __rust_try (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-db5a760f.so)
==6449==    by 0x48F29CF: rt::lang_start::hed30906487dce269Wxy (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-db5a760f.so)
==6449==    by 0x10A57D: main (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu)
==6449==                                                            

------------------------------------------                          

error: test run failed!                                             
status: signal: 9                                                   
command: /usr/bin/valgrind --error-exitcode=100 --fair-sched=try --quiet --soname-synonyms=somalloc=NONE --suppressions=/home/nodakai/src/rust-HEAD/src/etc/x86.supp --tool=memcheck --leak-check=full x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu                                                     
stdout:                                                             
------------------------------------------                          

------------------------------------------                          
stderr:                                                             
------------------------------------------                          
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/ld-2.21.so:
--6449-- Ignoring non-Dwarf2/3/4 block in .debug_info               
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/ld-2.21.so:
--6449-- Last block truncated in .debug_info; ignoring              
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/ld-2.21.so:
--6449-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4   
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/libc-2.21.so:
--6449-- Ignoring non-Dwarf2/3/4 block in .debug_info               
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/libc-2.21.so:
--6449-- Last block truncated in .debug_info; ignoring              
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/libc-2.21.so:
--6449-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4   
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/libdl-2.21.so:
--6449-- Ignoring non-Dwarf2/3/4 block in .debug_info               
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/libdl-2.21.so:
--6449-- Last block truncated in .debug_info; ignoring              
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/libdl-2.21.so:
--6449-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4   
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/libm-2.21.so:
--6449-- Ignoring non-Dwarf2/3/4 block in .debug_info               
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/libm-2.21.so:
--6449-- Last block truncated in .debug_info; ignoring              
--6449-- WARNING: Serious error when reading debug info             
--6449-- When reading debug info from /lib/i386-linux-gnu/libm-2.21.so:
--6449-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4   
==6449== Can't extend stack to 0x4bb9880 during signal delivery for thread 2:
==6449==   no stack segment                                         
==6449==                                                            
==6449== Process terminating with default action of signal 11 (SIGSEGV)
==6449==  Access not within mapped region at address 0x4BB9880      
==6449==    at 0x10936F: Bar::drop.4321::h008b747fa83237a8 (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu)
==6449==    by 0x4C42A3B: __call_tls_dtors (in /lib/i386-linux-gnu/libc-2.21.so)
==6449==    by 0x4BDFF78: start_thread (pthread_create.c:343)       
==6449==    by 0x4CE7C5D: clone (in /lib/i386-linux-gnu/libc-2.21.so)
==6449==  If you believe this happened as a result of a stack       
==6449==  overflow in your program's main thread (unlikely but      
==6449==  possible), you can try to increase the size of the        
==6449==  main thread stack using the --main-stacksize= flag.       
==6449==  The main thread stack size used in this run was 8388608.  
==6449== 152 bytes in 1 blocks are possibly lost in loss record 6 of 7
==6449==    at 0x482E118: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6449==    by 0x4010B06: allocate_dtv (in /lib/i386-linux-gnu/ld-2.21.so)
==6449==    by 0x40114EB: _dl_allocate_tls (in /lib/i386-linux-gnu/ld-2.21.so)
==6449==    by 0x4BE07B4: allocate_stack (allocatestack.c:587)      
==6449==    by 0x4BE07B4: pthread_create@@GLIBC_2.1 (pthread_create.c:537)
==6449==    by 0x48E1BB6: sys::thread::Thread::new::h2db9ab5f5bc239c37ux (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-db5a760f.so)
==6449==    by 0x1096D0: main::h225df9f85db6309aGfa (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu)
==6449==    by 0x48F2ECA: sys_common::unwind::try::try_fn::h17787564768047935801 (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-db5a760f.so)
==6449==    by 0x48E9DE7: __rust_try (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-db5a760f.so)
==6449==    by 0x48F29CF: rt::lang_start::hed30906487dce269Wxy (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-db5a760f.so)
==6449==    by 0x10A57D: main (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu)
==6449==                                                            

------------------------------------------                          

thread '[run-pass-valgrind] run-pass-valgrind/down-with-thread-dtors.rs' panicked at 'explicit panic', /home/nodakai/src/rust-HEAD/src/compiletest/runtest.rs:1516
stack backtrace:                                                    
   1:     0x7f1fd1f267d0 - sys::backtrace::tracing::imp::write::h97e6ef5c751bdc2c5nu
   2:     0x7f1fd1f2d3eb - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.42840
   3:     0x7f1fd1f2cf41 - panicking::default_handler::h1a504cc1542efa12IFy
   4:     0x7f1fd1ef67ec - sys_common::unwind::begin_unwind_inner::hc99232f5c6b52a5bDgt
   5:     0x5640e608cd2f - sys_common::unwind::begin_unwind::h1666939853081061408
   6:     0x5640e60a7f06 - runtest::fatal_proc_rec::h394fb6b8ac10e5882Hc
   7:     0x5640e609643e - runtest::run::h02546a4866f603e34La       
   8:     0x5640e6097717 - boxed::F.FnBox<A>::call_box::h9005184255364516560
   9:     0x7f1fd262c66b - sys_common::unwind::try::try_fn::h2545155071472818957
  10:     0x7f1fd1f2439b - __rust_try                               
  11:     0x7f1fd1f1be2d - sys_common::unwind::inner_try::h1728cfeb22ee0311Fdt
  12:     0x7f1fd262c9ea - boxed::F.FnBox<A>::call_box::h4996586291295678521
  13:     0x7f1fd1f2b993 - sys::thread::Thread::new::thread_start::h43844f68128dea4bsCx
  14:     0x7f1fd145c283 - start_thread                             
  15:     0x7f1fd199497c - clone                                    
  16:                0x0 - <unknown>                                



failures:                                                           
    [run-pass-valgrind] run-pass-valgrind/down-with-thread-dtors.rs 

test result: FAILED. 7 passed; 1 failed; 0 ignored; 0 measured      

thread '<main>' panicked at 'Some tests failed', /home/nodakai/src/rust-HEAD/src/compiletest/compiletest.rs:244
stack backtrace:                                                    
   1:     0x7f1fd1f267d0 - sys::backtrace::tracing::imp::write::h97e6ef5c751bdc2c5nu
   2:     0x7f1fd1f2d3eb - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.42840
   3:     0x7f1fd1f2cff6 - panicking::default_handler::h1a504cc1542efa12IFy
   4:     0x7f1fd1ef67ec - sys_common::unwind::begin_unwind_inner::hc99232f5c6b52a5bDgt
   5:     0x5640e608cd2f - sys_common::unwind::begin_unwind::h1666939853081061408
   6:     0x5640e607eeef - main::h2ba9907fd693c4472Ad               
   7:     0x7f1fd1f2cab4 - sys_common::unwind::try::try_fn::h7253349451187764956
   8:     0x7f1fd1f2439b - __rust_try
   9:     0x7f1fd1f2c52e - rt::lang_start::hf226f4e667a8968eOxy
  10:     0x7f1fd18cc86f - __libc_start_main
  11:     0x5640e6079e48 - _start
  12:                0x0 - <unknown>
/home/nodakai/src/rust-HEAD/mk/tests.mk:743: recipe for target 'tmp/check-stage2-T-i686-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rpass-valgrind.ok' failed
make: *** [tmp/check-stage2-T-i686-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rpass-valgrind.ok] Error 101
$ valgrind x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu                                                                                                                        (git)-heads/master 
==9775== Memcheck, a memory error detector                                                  
==9775== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==9775== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==9775== Command: x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu
==9775== 
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/ld-2.21.so:
--9775-- Ignoring non-Dwarf2/3/4 block in .debug_info
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/ld-2.21.so:
--9775-- Last block truncated in .debug_info; ignoring
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/ld-2.21.so:
--9775-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/libc-2.21.so:
--9775-- Ignoring non-Dwarf2/3/4 block in .debug_info
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/libc-2.21.so:
--9775-- Last block truncated in .debug_info; ignoring
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/libc-2.21.so:
--9775-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/libdl-2.21.so:
--9775-- Ignoring non-Dwarf2/3/4 block in .debug_info
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/libdl-2.21.so:
--9775-- Last block truncated in .debug_info; ignoring
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/libdl-2.21.so:
--9775-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/libm-2.21.so:
--9775-- Ignoring non-Dwarf2/3/4 block in .debug_info
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/libm-2.21.so:
--9775-- Last block truncated in .debug_info; ignoring
--9775-- WARNING: Serious error when reading debug info
--9775-- When reading debug info from /lib/i386-linux-gnu/libm-2.21.so:
--9775-- parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4
==9775== Can't extend stack to 0x4bb9880 during signal delivery for thread 2:
==9775==   no stack segment
==9775== 
==9775== Process terminating with default action of signal 11 (SIGSEGV)
==9775==  Access not within mapped region at address 0x4BB9880
==9775==    at 0x10936F: Bar::drop.4321::h008b747fa83237a8 (in /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu)
==9775==    by 0x4C41A3B: __call_tls_dtors (in /lib/i386-linux-gnu/libc-2.21.so)
==9775==    by 0x4BDFF78: start_thread (pthread_create.c:343)
==9775==    by 0x4CE6C5D: clone (in /lib/i386-linux-gnu/libc-2.21.so)
==9775==  If you believe this happened as a result of a stack
==9775==  overflow in your program's main thread (unlikely but
==9775==  possible), you can try to increase the size of the
==9775==  main thread stack using the --main-stacksize= flag.
==9775==  The main thread stack size used in this run was 8388608.
==9775== 
==9775== HEAP SUMMARY:
==9775==     in use at exit: 692 bytes in 16 blocks
==9775==   total heap usage: 30 allocs, 14 frees, 1,668 bytes allocated
==9775== 
==9775== LEAK SUMMARY:
==9775==    definitely lost: 0 bytes in 0 blocks
==9775==    indirectly lost: 0 bytes in 0 blocks
==9775==      possibly lost: 152 bytes in 1 blocks
==9775==    still reachable: 540 bytes in 15 blocks
==9775==         suppressed: 0 bytes in 0 blocks
==9775== Rerun with --leak-check=full to see details of leaked memory
==9775== 
==9775== For counts of detected and suppressed errors, rerun with: -v
==9775== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
zsh: killed     valgrind 
$ gdb x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu -ex r
GNU gdb (Debian 7.10-1+b1) 7.10
Copyright (C) 2015 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu...(no debugging symbols found)...done.
Starting program: /home/nodakai/src/rust-HEAD/x86_64-unknown-linux-gnu/test/run-pass-valgrind/down-with-thread-dtors.stage2-i686-unknown-linux-gnu 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0xf7a2ab40 (LWP 14912)]
[Thread 0xf7a2ab40 (LWP 14912) exited]
[Inferior 1 (process 14625) exited normally]
(gdb) q
@steveklabnik steveklabnik added the A-cross Area: Cross compilation label Feb 2, 2016
@infinity0
Copy link
Contributor

This is also reproducible on a completely i686 toolchain and environment (only the processor is x64, edit: also the kernel), see Debian bug 812825 and some build logs:

I currently have an uncleaned build tree with the failing compiled test files intact, in case you have further ideas on how to debug this. (I already tried setting --main-stacksize to 10x the default value and it's still failing.)

@alexcrichton
Copy link
Member

I can reproduce this outside of the bootstrap as well. By downloading the i686 linux nightlies and compiling this tests I get the same valgrind error.

I'm not really sure if it's legitimate or not, as it only causes weird behavior in valgrind...

@infinity0
Copy link
Contributor

Here's the proc-mem map from vgdb https://paste.debian.net/394367/

alexcrichton added a commit to alexcrichton/rust that referenced this issue Feb 20, 2016
It's unclear to me whether this test failing under valgrind is actually legit.
The test only fails in valgrind when everything is dynamically linked, and it
appears to work when statically linked.

For now just add the `// no-prefer-dynamic` directive and let's just chalk it up
to a weird valgrind issue.

Closes rust-lang#31328
bors added a commit that referenced this issue Feb 20, 2016
It's unclear to me whether this test failing under valgrind is actually legit.
The test only fails in valgrind when everything is dynamically linked, and it
appears to work when statically linked.

For now just add the `// no-prefer-dynamic` directive and let's just chalk it up
to a weird valgrind issue.

Closes #31328
@infinity0
Copy link
Contributor

Hm, shouldn't we at least file a bug upstream to valgrind?

@alexcrichton
Copy link
Member

Perhaps, yeah, but I'm also not confident that it's a bug in valgrind, so it may be premature to do so

@sylvestre
Copy link
Contributor

I can confirm that it fixed the test failure on Debian i386 and the build is now green on this arch.
Thanks

@infinity0
Copy link
Contributor

Also fixed on my rust-nightly ubuntu builds.

However, I'd suggest that we file this to valgrind even if we're "not sure" if it's a bug, since otherwise this is going to get lost to history - the issue is "closed" and nobody looks at these afterwards.

@sylvestre
Copy link
Contributor

Sure, go ahead @infinity0 !

@infinity0
Copy link
Contributor

Alright I filed https://bugs.kde.org/show_bug.cgi?id=359705 feel free to add details, I'm not an expert in this topic.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Feb 29, 2016
This applies the same fix as added in 595d5b2 which is to just compile all
valgrind tests statically instead of dynamically. It looks like this is a
resurgence of either rust-lang#30383 or rust-lang#31328 in some weird fashion.

I'm not actually sure what's going on with the bots, and it's unclear whether
this is a valgrind bug or a libstd bug, but for now let's just get things
landing again.

Closes rust-lang#30383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cross Area: Cross compilation
Projects
None yet
Development

No branches or pull requests

5 participants