test_unit_LPC_inv_pred_gain fails on i686 gcc10
The test silk/tests/test_unit_LPC_inv_pred_gain fails when building the i686 package on NixOS with gcc10 and binutils-2.34 https://github.com/NixOS/nixpkgs/pull/89793.
All tests succeed with gcc9 and binutils-2.31.1.
Here is test-suite.log: https://termbin.com/c41r.
@luc65r I cannot reproduce it on GCC-10 x86_64 or i386. But I am building on ubuntu. Can you try to share more logs. Like config.log, give all build flags etc. Also if you could run the test under valgrind or some other tool and try to get more info would also be helpful.
Here is config.log: https://termbin.com/uhr0.
With -fsanitize=address, the tests do pass...
The backtrace from gdb:
#0 0xf7fcf5c9 in __kernel_vsyscall ()
#1 0xf7d15585 in raise () from /nix/store/vzwhgdhbyxahzxmyg571fcp3k914yzc3-glibc-2.32-10/lib/libc.so.6
#2 0xf7cfe2fd in abort () from /nix/store/vzwhgdhbyxahzxmyg571fcp3k914yzc3-glibc-2.32-10/lib/libc.so.6
#3 0xf7d567b4 in __libc_message () from /nix/store/vzwhgdhbyxahzxmyg571fcp3k914yzc3-glibc-2.32-10/lib/libc.so.6
#4 0xf7df24cc in __fortify_fail () from /nix/store/vzwhgdhbyxahzxmyg571fcp3k914yzc3-glibc-2.32-10/lib/libc.so.6
#5 0xf7df2499 in __stack_chk_fail () from /nix/store/vzwhgdhbyxahzxmyg571fcp3k914yzc3-glibc-2.32-10/lib/libc.so.6
#6 0x0807e044 in __stack_chk_fail_local ()
#7 0x08049637 in check_stability (A_Q12=0xffffcadc, order=16) at silk/tests/test_unit_LPC_inv_pred_gain.c:88
#8 0x00000000 in ?? ()
Is this an old version of Opus or does it occur with master?
Can you try to disable -fstack-protector-strong flag from opus build?
Should be doable with: -disable-stack-protector when building with autotools.
I tested it on 1.3.1 and master with the same behavior.
When disabling stack protection, it segfaults.
Can you get a stacktrace without stackprotection?
I'm just getting this with gdb
#0 0x00000000 in ?? ()
@luc65r do yo have instructions how to setup the environment to reproduce the issue?
@xnorpx Either you make a vm with NixOS or you install Nix directy. If you choose the second solution, which seems more convenient:
curl -L https://nixos.org/nix/install | sh(as told here https://nixos.org/download.html#nix-quick-install)- Clone my branch https://github.com/luc65r/nixpkgs/tree/staging, and maybe upstream's staging too
- Set
doChecktotrueinpkgs/development/libraries/libopus/default.nix nix-build -A pkgsi686Linux.libopusto build, and with-Kto keep the build directory in/tmp/nix-build-somethingnix-shell -A pkgsi686Linux.libopus -I nixpkgs=./to get an interactive shell where you can run phases manually (unpackPhase,cd source,configurePhase,buildPhase,checkPhase)- Add
NIX_CFLAGS_COMPILE = [ "-fno-stack-protector" ];inpkgs/development/libraries/libopus/default.nixto disable stack protection
Thanks, got it compiling and could reproduce the issue.
I tried to use the -K option to be able to go to the tmp/nix-build-libopus-1.3.1.drv-1/opus-1.3.1 and modify code.
When trying to make again from that directory it says: /usr/bin/ld: i386 architecture of input file `something.o' is incompatible with i386:x86-64 output.
Is it possible to reproduce the build again with make in that directory?
Or can I point nix to fetch fron local copy of opus?
Is it possible to reproduce the build again with make in that directory?
Not really. You can however modify the source in the nix-shell after the unpackPhase.
Or can I point nix to fetch fron local copy of opus?
Yes sure, you need to modify src in pkgs/development/libraries/libopus/default.nix:
src = ./path/to/source;
If you need to generate the configure script, you can add autoreconfHook to the arguments (at the top of the file) and add
nativeBuildInputs = [
autoreconfHook
];
You can also fetch the source from github by adding fetchFromGitHub to the arguments, and:
src = fetchFromGitHub {
owner = "xiph";
repo = "opus";
rev = "v1.3.1"; # tag or commit
sha256 = ""; # you can put 52 zeros, watch it fail and then replace it with the hash it gives
};
If you need gdb, you can add it to arguments and to nativeBuildInputs
thanks, will see if I can figure something out.
@luc65r can you test with this branch?
https://github.com/xnorpx/opus/tree/dev/gcc10-1
or use patch with this commit: https://github.com/xnorpx/opus/commit/6e2209d3dcdd4c4cf3b38f9357ce829d932c8b48
it passed for me locally
It passed for me too.
Thank you for your dedication!
@luc65r can you reopen the issue so I can use it to track until I get the change into master?
The fix I had was not good, my guess this is a compiler issue with inline optimization on i686 gcc10.