On Wed, May 02, 2018 at 03:53:54PM +0300, Paul Irofti wrote: > On Wed, May 02, 2018 at 02:23:06PM +0200, Sebastien Marie wrote: > > Hi, > > > > I recently received a pine64 board for doing Rust work on it (thanks > > danj@) and I have some problems with it. > > > > One of them is random crash or dead-lock when running rustc, which is a > > multi-threaded program. > > > > I dunno how to debug it, but the difference between running on bsd.mp > > (the default) or bsd.sp is important. > > You could start by running ktrace -di and showing us the output.
here some elements. sorry for the delay. the build is ran with ulimit -d 16777216. the same compiled library could crash or dead-lock in a way or another (or just compile fine) at each call. Running with GENERIC make the build advance (it crashes later when building librustc, but I assume it should be another problem). Here it didn't pass the building of rustbuild (the "make" equiv) and fail quickly (less than 5 minutes). ====> Dead-lock Program manually interrupted with Ctrl+C. 5 threads: - __thrsleep() x4 - poll(INFTIM) x1 kdump -HTR (per thread) 75280/262373 rustc.bin 0.207776 CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0) 75280/262373 rustc.bin 0.207797 RET mmap 81054846976/0x12df3ed000 75280/262373 rustc.bin 0.207865 CALL mmap(0,0x1001000,0x3<PROT_READ|PROT_WRITE>,0x5002<MAP_PRIVATE|MAP_ANON|MAP_STACK>,-1,0) 75280/262373 rustc.bin 0.207885 RET mmap 82709213184/0x1341da7000 75280/262373 rustc.bin 0.207892 CALL mprotect(0x1341da7000,0x1000,0<PROT_NONE>) 75280/262373 rustc.bin 0.207908 RET mprotect 0 75280/262373 rustc.bin 0.207929 CALL __tfork(0x3ffffe13f0,24) 75280/262373 rustc.bin 0.207938 STRU struct __tfork { tcb=0x12dc3f22f8, tid=0x12dc3f22dc, stack=0x1342da7e50 } 75280/262373 rustc.bin 0.208011 RET __tfork 609078/0x94b36 75280/262373 rustc.bin 0.208099 CALL __thrsleep(0x12dc3f2204,CLOCK_REALTIME,0,0x12dc3f2200,0x12d12f3590) 75280/273129 rustc.bin 15.046433 CALL mprotect(0x12baa4a000,0x1000,0<PROT_NONE>) 75280/273129 rustc.bin 15.046453 RET mprotect 0 75280/273129 rustc.bin 15.046461 CALL __tfork(0x1280fd3450,24) 75280/273129 rustc.bin 15.046471 STRU struct __tfork { tcb=0x12dc3f2af8, tid=0x12dc3f2adc, stack=0x12bac4a5f0 } 75280/273129 rustc.bin 15.046543 RET __tfork 357860/0x575e4 75280/273129 rustc.bin 15.046607 CALL __thrsleep(0x12b9bc1800,CLOCK_REALTIME,0,0x12fe8e65c0,0x12b9bc18c8) 75280/273129 rustc.bin 15.359440 RET __thrsleep 0 75280/273129 rustc.bin 15.359479 CALL sched_yield() 75280/273129 rustc.bin 15.359494 RET sched_yield 0 75280/273129 rustc.bin 15.359501 CALL __thrsleep(0x12b9bc1800,CLOCK_REALTIME,0,0x12d12f23b0,0) 75280/357860 rustc.bin 15.359166 CALL munmap(0x1334eba000,0x1000) 75280/357860 rustc.bin 15.359196 RET munmap 0 75280/357860 rustc.bin 15.359292 CALL munmap(0x126bb53000,0x1000) 75280/357860 rustc.bin 15.359326 RET munmap 0 75280/357860 rustc.bin 15.359339 CALL munmap(0x12e3a16000,0x1000) 75280/357860 rustc.bin 15.359373 RET munmap 0 75280/357860 rustc.bin 15.359414 CALL __thrwakeup(0x12b9bc1800,1) 75280/357860 rustc.bin 15.359431 RET __thrwakeup 0 75280/357860 rustc.bin 15.359461 CALL __thrsleep(0x12dc3f2a00,CLOCK_REALTIME,0,0x12d12f23b0,0) 75280/357860 rustc.bin 60.784270 PSIG SIGINT SIG_DFL 75280/375128 rustc.bin 6.935120 CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0) 75280/375128 rustc.bin 6.935142 RET mmap 81455423488/0x12f71f2000 75280/375128 rustc.bin 6.935229 CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0) 75280/375128 rustc.bin 6.935286 RET mmap 81670062080/0x1303ea4000 75280/375128 rustc.bin 6.935325 CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0) 75280/375128 rustc.bin 6.935363 RET mmap 79714951168/0x128f61a000 75280/375128 rustc.bin 6.935470 CALL __thrsleep(0x1305e9f000,CLOCK_REALTIME,0,0x13232132c0,0x1305e9f0c8) 75280/375128 rustc.bin 6.936372 RET __thrsleep 0 75280/375128 rustc.bin 6.936398 CALL poll(0x12f4477378,1,INFTIM) 75280/375128 rustc.bin 60.784529 STRU struct pollfd { fd=4, events=0x1<POLLIN>, revents=0<> } 75280/609078 rustc.bin 14.958281 RET clock_gettime 0 75280/609078 rustc.bin 15.045940 CALL clock_gettime(CLOCK_MONOTONIC,0x1342d9c2a8) 75280/609078 rustc.bin 15.045997 STRU struct timespec { 14991.306034652 } 75280/609078 rustc.bin 15.046006 RET clock_gettime 0 75280/609078 rustc.bin 15.046033 CALL __thrwakeup(0x12b9bc1800,1) 75280/609078 rustc.bin 15.046052 RET __thrwakeup 0 75280/609078 rustc.bin 15.046080 CALL clock_gettime(CLOCK_MONOTONIC,0x1342d9d758) 75280/609078 rustc.bin 15.046090 STRU struct timespec { 14991.306129572 } 75280/609078 rustc.bin 15.046096 RET clock_gettime 0 75280/609078 rustc.bin 15.046125 CALL __thrsleep(0x12dc3f2200,CLOCK_REALTIME,0,0x12bed1f900,0x12dc3f22c8) ====> Segmentation fault Segmentation fault error: Could not compile `serde`. Caused by: process didn't exit successfully: `/usr/ports/pobj/rust-1.25.0/rustc-bootstrap-aarch64-1.25.0-20180502/bin/rustc --crate-name serde vendor/serde/src/lib.rs --crate-type lib --emit=dep-info,link -C debug-assertions=off -C overflow-checks=on --cfg feature="default" --cfg feature="std" -C metadata=2282a8f1156dafb5 -C extra-filename=-2282a8f1156dafb5 --out-dir /home/semarie/repos/openbsd/ports/pobj/rust-1.25.0/build-aarch64/build/bootstrap/debug/deps -L dependency=/home/semarie/repos/openbsd/ports/pobj/rust-1.25.0/build-aarch64/build/bootstrap/debug/deps --cap-lints warn -Cdebuginfo=2` (exit code: 139) kdump -HTR: 17058/136030 rustc.bin 167.190890 RET mmap 25976352768/0x60c4fb000 17058/136030 rustc.bin 167.191103 CALL mmap(0,0x4000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0) 17058/136030 rustc.bin 167.191135 RET mmap 25191485440/0x5dd879000 17058/136030 rustc.bin 167.191392 CALL sched_yield() 17058/136030 rustc.bin 167.191418 RET sched_yield 0 17058/136030 rustc.bin 167.191950 PSIG SIGSEGV caught handler=0x5bad3ff4c mask=0<> code SEGV_MAPERR<1> addr=0x5613ae000 trapno=0 17058/553252 rustc.bin 167.191995 CALL sched_yield() 17058/553252 rustc.bin 167.192036 RET sched_yield 0 17058/136030 rustc.bin 167.192043 CALL sigaction(SIGSEGV,0x5505f2bc0,0) 17058/553252 rustc.bin 167.192056 CALL sched_yield() 17058/136030 rustc.bin 167.192067 STRU struct sigaction { handler=SIG_DFL, mask=0<>, flags=0<> } 17058/136030 rustc.bin 167.192076 RET sigaction 0 17058/553252 rustc.bin 167.192082 RET sched_yield 0 17058/136030 rustc.bin 167.192088 CALL sigreturn(0x5505f2e58) 17058/553252 rustc.bin 167.192097 CALL sched_yield() 17058/136030 rustc.bin 167.192110 RET sigreturn JUSTRETURN 17058/553252 rustc.bin 167.192116 RET sched_yield 0 17058/553252 rustc.bin 167.192128 CALL sched_yield() 17058/136030 rustc.bin 167.192145 PSIG SIGSEGV SIG_DFL code SEGV_MAPERR<1> addr=0x5613ae000 trapno=0 17058/553252 rustc.bin 167.192159 RET sched_yield 0 17058/474627 rustc.bin 167.192209 STRU struct pollfd { fd=4, events=0x1<POLLIN>, revents=0<> } ====> Abort trap error: Could not compile `serde`. Caused by: process didn't exit successfully: `/usr/ports/pobj/rust-1.25.0/rustc-bootstrap-aarch64-1.25.0-20180502/bin/rustc --crate-name serde vendor/serde/src/lib.rs --crate-type lib --emit=dep-info,link -C debug-assertions=off -C overflow-checks=on --cfg feature="default" --cfg feature="std" -C metadata=2282a8f1156dafb5 -C extra-filename=-2282a8f1156dafb5 --out-dir /home/semarie/repos/openbsd/ports/pobj/rust-1.25.0/build-aarch64/build/bootstrap/debug/deps -L dependency=/home/semarie/repos/openbsd/ports/pobj/rust-1.25.0/build-aarch64/build/bootstrap/debug/deps --cap-lints warn -Cdebuginfo=2` (exit code: 139) kdump -HTR (per thread) 45845/111412 rustc.bin 0.192376 CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0) 45845/111412 rustc.bin 0.192398 RET mmap 39780188160/0x943158000 45845/111412 rustc.bin 0.192458 CALL mmap(0,0x1001000,0x3<PROT_READ|PROT_WRITE>,0x5002<MAP_PRIVATE|MAP_ANON|MAP_STACK>,-1,0) 45845/111412 rustc.bin 0.192479 RET mmap 39756308480/0x941a92000 45845/111412 rustc.bin 0.192486 CALL mprotect(0x941a92000,0x1000,0<PROT_NONE>) 45845/111412 rustc.bin 0.192503 RET mprotect 0 45845/111412 rustc.bin 0.192522 CALL __tfork(0x3ffffd79e0,24) 45845/111412 rustc.bin 0.192532 STRU struct __tfork { tcb=0x94076d2f8, tid=0x94076d2dc, stack=0x942a928a0 } 45845/111412 rustc.bin 0.192615 RET __tfork 262821/0x402a5 45845/111412 rustc.bin 0.192708 CALL __thrsleep(0x94076d204,CLOCK_REALTIME,0,0x94076d200,0x909128590) 45845/235451 rustc.bin 165.173232 CALL munmap(0x8afa33000,0x1000) 45845/235451 rustc.bin 165.173257 RET munmap 0 45845/235451 rustc.bin 165.173415 CALL munmap(0x92e851000,0x1000) 45845/235451 rustc.bin 165.173472 RET munmap 0 45845/235451 rustc.bin 165.173599 CALL munmap(0x95d903000,0x1000) 45845/235451 rustc.bin 165.173644 RET munmap 0 45845/235451 rustc.bin 165.173664 CALL sigprocmask(SIG_SETMASK,~0x20<SIGABRT>) 45845/235451 rustc.bin 165.173685 RET sigprocmask 0<> 45845/235451 rustc.bin 165.173756 CALL thrkill(0,SIGABRT,0) 45845/235451 rustc.bin 165.173789 PSIG SIGABRT SIG_DFL 45845/262821 rustc.bin 165.172896 CALL munmap(0x927c45000,0x2000) 45845/262821 rustc.bin 165.172973 RET munmap 0 45845/262821 rustc.bin 165.173274 CALL munmap(0x8ebf9a000,0x2000) 45845/262821 rustc.bin 165.173349 RET munmap 0 45845/262821 rustc.bin 165.173359 CALL munmap(0x9967ec000,0x2000) 45845/262821 rustc.bin 165.173428 RET munmap 0 45845/262821 rustc.bin 165.173463 CALL munmap(0x981c18000,0xc000) 45845/262821 rustc.bin 165.173610 RET munmap 0 45845/262821 rustc.bin 165.173674 CALL getpid() 45845/262821 rustc.bin 165.173691 RET getpid 45845/0xb315 45845/409631 rustc.bin 161.466630 CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0) 45845/409631 rustc.bin 161.466664 RET mmap 40181518336/0x95b015000 45845/409631 rustc.bin 161.466803 CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0) 45845/409631 rustc.bin 161.466855 RET mmap 40434515968/0x96a15c000 45845/409631 rustc.bin 161.466942 CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,-1,0) 45845/409631 rustc.bin 161.467034 RET mmap 40030756864/0x95204e000 45845/409631 rustc.bin 161.467099 CALL __thrsleep(0x94076da00,CLOCK_REALTIME,0,0x8c5edba40,0x94076dac8) 45845/409631 rustc.bin 161.467922 RET __thrsleep 0 45845/409631 rustc.bin 161.467949 CALL poll(0x9a4f2bb98,1,INFTIM) 45845/409631 rustc.bin 165.173870 STRU struct pollfd { fd=4, events=0x1<POLLIN>, revents=0<> } 45845/462087 rustc.bin 165.089563 CALL munmap(0x9a512d000,0x201000) 45845/462087 rustc.bin 165.089746 RET munmap 0 45845/462087 rustc.bin 165.091536 CALL mmap(0,0x201000,0x3<PROT_READ|PROT_WRITE>,0x5002<MAP_PRIVATE|MAP_ANON|MAP_STACK>,-1,0) 45845/462087 rustc.bin 165.091651 RET mmap 41424179200/0x9a512d000 45845/462087 rustc.bin 165.092257 CALL mprotect(0x9a512d000,0x1000,0<PROT_NONE>) 45845/462087 rustc.bin 165.092297 RET mprotect 0 45845/462087 rustc.bin 165.094831 CALL __tfork(0x9a512b540,24) 45845/462087 rustc.bin 165.094855 STRU struct __tfork { tcb=0x8fa4280f8, tid=0x8fa4280dc, stack=0x9a532d020 } 45845/462087 rustc.bin 165.094941 RET __tfork 235451/0x397bb 45845/462087 rustc.bin 165.094995 CALL __thrsleep(0x91fdd4600,CLOCK_REALTIME,0,0x900ecf0c0,0x91fdd46c8) -- Sebastien Marie