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

0.25.0 segfaults when running the tests on Fedora rawhide #1

Closed
hegjon opened this issue Feb 24, 2022 · 6 comments
Closed

0.25.0 segfaults when running the tests on Fedora rawhide #1

hegjon opened this issue Feb 24, 2022 · 6 comments

Comments

@hegjon
Copy link

hegjon commented Feb 24, 2022

Build environment

autoconf      2.71-2
automake      1.16.5-4
gcc           12.0.1-0.9
gmp-devel     1:6.2.1-2
libtool       2.4.6-50
openssl-devel 1:3.0.0-1

Expanded build commands

+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/secp256k1-0.25.0/.package_note-libsecp256k1-0.25.0-1.fc37.x86_64.ld'
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ '[' -f /usr/lib/rpm/generate-rpm-note.sh ']'
+ /usr/lib/rpm/generate-rpm-note.sh libsecp256k1 0.25.0-1.fc37 x86_64
+ cd secp256k1-0.25.0
+ ./autogen.sh
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-static --enable-module-recovery --enable-experimental --enable-module-ecdh
+ /usr/bin/make -O -j6 V=1 VERBOSE=1

Test result

+ ./tests
test count = 64
random seed = efb9c5c3562d91d0bda2270e89f2a7ea
Failure 10 on 30 23 02 0a cc 00 00 00 00 00 08 00 f8 ff 02 15 00 ad ff ff ff ff 48 ff 03 f0 ff ff ff ff ff ff 7f ff ff ff ff 
src/tests.c:5179: test condition failed: ret == 0
/var/tmp/rpm-tmp.Boff5S: line 42: 2180192 Aborted                 (core dumped) ./tests

Build logs:

https://kojipkgs.fedoraproject.org//work/tasks/8573/83288573/build.log

@deadalnix
Copy link
Member

Thanks @hegjon . Does this happen consistently, even with other seeds?

@hegjon
Copy link
Author

hegjon commented Feb 26, 2022

It segfaults consistently on Fedora rawhide and works consistently on Fedora 35. Just let me know if you need help to setup an environment to test on.

@hegjon
Copy link
Author

hegjon commented Feb 26, 2022

Also fails on an earlier version of libsecp256k1

+ ./tests
test count = 64
random seed = 76c29f83ad729507adcebdf7ebc7dd44
Failure 10 on 30 14 02 08 ae ff ff ff ff ff ff ff 02 08 00 c3 00 00 00 00 00 00 
src/tests.c:4725: test condition failed: ret == 0
/var/tmp/rpm-tmp.7nyUvD: line 42: 441334 Aborted                 (core dumped) ./tests

More details: https://bugzilla.redhat.com/show_bug.cgi?id=2045833 (check build.log for stdout)

@deadalnix
Copy link
Member

Ok thanks, that's very helpful.

Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue Mar 6, 2022
Summary:
```
This removes the ability to test against OpenSSL, as well as the OpenSSL verification benchmark.

The motivation is that OpenSSL 3 is deprecating part of the API used here (see #869), and I'm not sure it's worth maintaining. We do lose the fact that this is the only test that verifies randomly-generated cases against an independent implementation. On the other hand, there are tons of existing fixed tests now that test all kinds of edge cases already.
```

Backport of [[bitcoin-core/secp256k1#983 | secp256k1#983]].

This fixes the issue Bitcoin-ABC/secp256k1#1

Test Plan:
  ninja check-secp256k1

Check there is no remaining use:
  git grep ENABLE_OPENSSL_TESTS

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D11135
deadalnix pushed a commit that referenced this issue Mar 7, 2022
Summary:
```
This removes the ability to test against OpenSSL, as well as the OpenSSL verification benchmark.

The motivation is that OpenSSL 3 is deprecating part of the API used here (see #869), and I'm not sure it's worth maintaining. We do lose the fact that this is the only test that verifies randomly-generated cases against an independent implementation. On the other hand, there are tons of existing fixed tests now that test all kinds of edge cases already.
```

Backport of [[bitcoin-core/secp256k1#983 | secp256k1#983]].

This fixes the issue #1

Test Plan:
  ninja check-secp256k1

Check there is no remaining use:
  git grep ENABLE_OPENSSL_TESTS

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D11135
@Fabcien
Copy link
Contributor

Fabcien commented Mar 14, 2022

This has been fixed in 0.25.1. Can you check out the latest version and confirm it works as expected ? Please re-open if you're still having issues.

@Fabcien Fabcien closed this as completed Mar 14, 2022
@hegjon
Copy link
Author

hegjon commented Mar 14, 2022

I confirm that the tests for 0.25.1 works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants