Skip to content

Instantly share code, notes, and snippets.

@progval
Created April 19, 2020 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save progval/ab6b6bfa69a8accfb9ff34367b0a158f to your computer and use it in GitHub Desktop.
Save progval/ab6b6bfa69a8accfb9ff34367b0a158f to your computer and use it in GitHub Desktop.
mrustc segfault
[nix-shell:~/nixpkgs/source]$ tools/bin/minicargo rustc-1.29.0-src/src/vendor/libssh2-sys/ --vendor-dir rustc-1.29.0-src/src/vendor/ --output-dir output/cargo-build -L output/
(0/7) BUILDING cc v1.0.18
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/cc/src/lib.rs -o output/cargo-build/libcc-1_0_18.rlib --crate-name cc --crate-type rlib -C emit-depfile=output/cargo-build/libcc-1_0_18.rlib.d --crate-tag 1_0_18 -g --cfg debug_assertions -O -L output -L output/cargo-build
(1/7) BUILDING cmake v0.1.31
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/cmake/src/lib.rs -o output/cargo-build/libcmake-0_1_31.rlib --crate-name cmake --crate-type rlib -C emit-depfile=output/cargo-build/libcmake-0_1_31.rlib.d --crate-tag 0_1_31 -g --cfg debug_assertions -O -L output -L output/cargo-build --extern cc=output/cargo-build/libcc-1_0_18.rlib
(2/7) BUILDING pkg_config from pkg-config v0.3.11
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/pkg-config/src/lib.rs -o output/cargo-build/libpkg_config-0_3_11.rlib --crate-name pkg_config --crate-type rlib -C emit-depfile=output/cargo-build/libpkg_config-0_3_11.rlib.d --crate-tag 0_3_11 -g --cfg debug_assertions -O -L output -L output/cargo-build
(3/7) BUILDING libc v0.2.42 with features [use_std]
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/libc/src/lib.rs -o output/cargo-build/liblibc-0_2_42.rlib --crate-name libc --crate-type rlib -C emit-depfile=output/cargo-build/liblibc-0_2_42.rlib.d --crate-tag 0_2_42 -g --cfg debug_assertions -O -L output -L output/cargo-build --cfg feature=use_std
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/openssl-sys/build/main.rs --crate-name build --crate-type bin -o output/cargo-build/openssl-sys_build -L output/cargo-build -g -L output --extern cc=output/cargo-build/libcc-1_0_18.rlib --extern pkg_config=output/cargo-build/libpkg_config-0_3_11.rlib
> /home/val/nixpkgs/source/output/cargo-build/openssl-sys_build
(4/7) BUILDING openssl_sys from openssl-sys v0.9.35
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/openssl-sys/src/lib.rs -o output/cargo-build/libopenssl_sys-0_9_35.rlib --crate-name openssl_sys --crate-type rlib -C emit-depfile=output/cargo-build/libopenssl_sys-0_9_35.rlib.d --crate-tag 0_9_35 -g --cfg debug_assertions -O -L output -L output/cargo-build -L /nix/store/fjzrhkjiwvv9n3vwwcf0r6dczn56bg66-openssl-1.1.1f/lib -l ssl -l crypto --cfg osslconf="OPENSSL_NO_SSL3_METHOD" --cfg ossl101 --cfg ossl102 --cfg ossl102h --cfg ossl110 --cfg ossl110f --cfg ossl110g --cfg ossl111 --extern libc=output/cargo-build/liblibc-0_2_42.rlib
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/libz-sys/build.rs --crate-name build --crate-type bin -o output/cargo-build/libz-sys_build -L output/cargo-build -g -L output --extern pkg_config=output/cargo-build/libpkg_config-0_3_11.rlib --extern cc=output/cargo-build/libcc-1_0_18.rlib
> /home/val/nixpkgs/source/output/cargo-build/libz-sys_build
(5/7) BUILDING libz_sys from libz-sys v1.0.18
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/libz-sys/src/lib.rs -o output/cargo-build/liblibz_sys-1_0_18.rlib --crate-name libz_sys --crate-type rlib -C emit-depfile=output/cargo-build/liblibz_sys-1_0_18.rlib.d --crate-tag 1_0_18 -g --cfg debug_assertions -O -L output -L output/cargo-build -L /nix/store/xihlc3qk2if6r1ffvnm9n6ijpiqcy3vi-zlib-1.2.11/lib -l z --extern libc=output/cargo-build/liblibc-0_2_42.rlib
> /home/val/nixpkgs/source/bin/mrustc rustc-1.29.0-src/src/vendor/libssh2-sys/build.rs --crate-name build --crate-type bin -o output/cargo-build/libssh2-sys_build -L output/cargo-build -g -L output --extern cmake=output/cargo-build/libcmake-0_1_31.rlib --extern pkg_config=output/cargo-build/libpkg_config-0_3_11.rlib
> /home/val/nixpkgs/source/output/cargo-build/libssh2-sys_build
Calling /home/val/nixpkgs/source/output/cargo-build/libssh2-sys_build failed
>
BUILD FAILED
[nix-shell:~/nixpkgs/source]$ PROFILE=release OUT_DIR=foo HOST=foo TARGET=foo gdb /home/val/nixpkgs/source/output/cargo-build/libssh2-sys_build
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 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 "aarch64-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 /home/val/nixpkgs/source/output/cargo-build/libssh2-sys_build...done.
(gdb) run
Starting program: /home/val/nixpkgs/source/output/cargo-build/libssh2-sys_build
warning: File "/nix/store/i24d8mknqz4vqpbd5hnhgl0z4p90zp8n-glibc-2.30/lib/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /nix/store/i24d8mknqz4vqpbd5hnhgl0z4p90zp8n-glibc-2.30/lib/libthread_db-1.0.so
line to your configuration file "/home/val/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/val/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[Detaching after vfork from child process 4042]
Program received signal SIGSEGV, Segmentation fault.
0x0000007fb7e765ec in __memcpy_generic () from /nix/store/i24d8mknqz4vqpbd5hnhgl0z4p90zp8n-glibc-2.30/lib/libc.so.6
(gdb) bt
#0 0x0000007fb7e765ec in __memcpy_generic () from /nix/store/i24d8mknqz4vqpbd5hnhgl0z4p90zp8n-glibc-2.30/lib/libc.so.6
#1 0x0000000000468c90 in ZRING2c5alloc3vec3Vec1gCa17extend_from_slice0g (arg1=..., arg0=0x7fffff7080) at output/cargo-build/libcmake-0_1_31.rlib.c:29003
#2 ZRG3c5alloc5slice4hack6to_vec1gCa (arg0=...) at output/cargo-build/libcmake-0_1_31.rlib.c:10405
#3 0x000000000046a34c in ZRING3c3std10sys_common7process10CommandEnv1gNG3c3std10sys_common7process13DefaultEnvKey0g3set0g (arg0=arg0@entry=0x7fffff8770, arg1=..., arg2=...) at output/cargo-build/libcmake-0_1_31.rlib.c:28819
#4 0x000000000046ef18 in ZRING2c3std7process7Command0g3env2gBsCyNG3c3std3ffi6os_str8OsString0g (arg2=..., arg1=..., arg0=0x7fffff8730) at output/cargo-build/libcmake-0_1_31.rlib.c:28579
#5 ZRING1ch5cmake60_1_316Config0g5build0g (arg0=<optimized out>) at output/cargo-build/libcmake-0_1_31.rlib.c:21784
#6 0x0000000000405728 in ZRG1c04main0g () at output/cargo-build/libssh2-sys_build.c:6103
#7 0x00000000004029a8 in ZRQNG2c3std2rth7closure12lang_start_01gT03c4core3ops8function2Fn1gT04call0g (arg0=<optimized out>, arg1=...) at output/cargo-build/libssh2-sys_build.c:20731
#8 0x0000000000407380 in ZRG3c3std9panickingh0137do_call2gNG2c3std2rth7closure21lang_start_internal_10gCf (arg0=0x7fffff9b98 "@\235\377\377\177", arg0@entry=<error reading variable: value has been optimized out>) at output/libstd.rlib.c:76491
#9 0x000000000045070c in __rust_maybe_catch_panic (arg0=<optimized out>, arg1=arg1@entry=0x7fffff9b98 "@\235\377\377\177", arg2=arg2@entry=0x7fffff9b70, arg3=arg3@entry=0x7fffff9b78) at output/libpanic_abort.rlib.c:137
#10 0x0000000000421418 in ZRG2c3std9panicking3try2gCfNG2c3std2rth7closure21lang_start_internal_10g (arg0=...) at output/libstd.rlib.c:77398
#11 0x000000000042e804 in ZRG2c3std2rt19lang_start_internal0g (arg0=..., arg1=1, arg2=0x7fffff9e98) at output/libstd.rlib.c:78211
#12 0x0000000000402804 in ZRG2c3std2rt10lang_start0g (arg2=<optimized out>, arg1=<optimized out>, arg0=<optimized out>) at output/cargo-build/libssh2-sys_build.c:21182
#13 main (argc=<optimized out>, argv=<optimized out>) at output/cargo-build/libssh2-sys_build.c:21182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment