Ximin Luo: > [..] > > The segfault occurs on various commands at different frequencies and after > differing amounts of time (but all less than a few seconds). The stack traces > are all different too. [..]
With some help from arielby from #rust-internals, we noticed that the stack getting allocated was always 192KB even though `ulimit -s` says 8192 (i.e. 8MB), and when the program tries to grow beyond this, is when the segfaults occur. Hope that's useful. (sid_ppc64el-dchroot)infinity0@plummer:~/test/rust-1.18.0-powerpc64le-unknown-linux-gnu$ gdb -q -d ~/glibc-2.24/debian/ -d ~/glibc-2.24/malloc/ -d ~/glibc-2.24/stdio-common/ -ex 'set disable-randomization off' -ex 'run install regex' cargo/bin/cargo Reading symbols from cargo/bin/cargo...done. Starting program: /home/infinity0/test/rust-1.18.0-powerpc64le-unknown-linux-gnu/cargo/bin/cargo install regex [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/powerpc64le-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000000028ada598 in regex_syntax::parser::Parser::parse_expr::h69b18aabf3de27d8 () (gdb) info inferiors Num Description Executable * 1 process 30272 /home/infinity0/test/rust-1.18.0-powerpc64le-unknown-linux-gnu/cargo/bin/cargo (gdb) shell command grep stack /proc/30272/maps 3fffcf960000-3fffcf990000 rw-p 00000000 00:00 0 [stack] (gdb) shell command grep stack /proc/29614/maps 3ffff4360000-3ffff4390000 rw-p 00000000 00:00 0 [stack] (gdb) shell command grep stack /proc/29586/maps 3fffe2800000-3fffe2830000 rw-p 00000000 00:00 0 [stack] Also, I earlier stated that this could be worked around by disabling ASLR (which gdb does implicitly, so we had to re-enable it). This was true on a deb8u1 kernel, but seems no longer to be true on the newer deb8u2 kernels - i.e. now when disabling ASLR I still see the segfaults. :( Running using the Debian rustc and cargo package, with the same command line that the rustc build would run: (sid_ppc64el-dchroot)infinity0@plummer:~/rustc$ gdb -q -ex 'run build --manifest-path /home/infinity0/rustc/src/bootstrap/Cargo.toml --frozen' cargo Reading symbols from cargo...Reading symbols from /usr/lib/debug/.build-id/e9/f3607a78a9b60bc2112c3810f72b42b9a5e1f9.debug...done. done. Starting program: /usr/bin/cargo build --manifest-path /home/infinity0/rustc/src/bootstrap/Cargo.toml --frozen [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/powerpc64le-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000000020376b78 in regex::exec::ExecBuilder::build::h46818bd83e889eca () (gdb) info inferiors Num Description Executable * 1 process 32472 /usr/bin/cargo (gdb) shell command grep stack /proc/32472/maps 3ffffffd0000-400000000000 rw-p 00000000 00:00 0 [stack] Setting `ulimit -s 24576` still works, though. X -- GPG: ed25519/56034877E1F87C35 GPG: rsa4096/1318EFAC5FBBDBCE https://github.com/infinity0/pubkeys.git

