Open amanusk opened 5 years ago
Update: Ran only library specific tests, without binding tests. The problem seems to occur since rust runs tests in parallel. Examples:
> cargo test tests::
Finished dev [unoptimized + debuginfo] target(s) in 0.16s
Running target/debug/deps/class_group-aae55a43ccd626bf
running 5 tests
test tests::test_bn_to_gen_to_bn ... ok
test primitives::tests::test_log ... ok
test tests::test_qf_to_pari_qf_to_qf ... ok
test primitives::tests::test_log_dlog ... ok
test primitives::tests::test_encryption ... ok
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 111 filtered out
--------------------------------------------------------------------------
> cargo test tests::
Finished dev [unoptimized + debuginfo] target(s) in 0.16s
Running target/debug/deps/class_group-aae55a43ccd626bf
running 5 tests
test primitives::tests::test_log ... ok
test tests::test_bn_to_gen_to_bn ... ok
*** Error in `/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf': double free or corruption (top): 0x00007ffb0c016a50 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7ffb15d2c7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7ffb15d3537a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7ffb15d3953c]
/usr/lib/x86_64-linux-gnu/libpari-gmp.so.6(initprimetable+0x52)[0x7ffb16d4d592]
/usr/lib/x86_64-linux-gnu/libpari-gmp.so.6(pari_init_opts+0x638)[0x7ffb1700b868]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0xa10bf)[0x55ae0af990bf]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0xa59ea)[0x55ae0af9d9ea]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0xa8b6e)[0x55ae0afa0b6e]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0xb45ff)[0x55ae0afac5ff]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(__rust_maybe_catch_panic+0x1a)[0x55ae0b00a01a]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0xceb1e)[0x55ae0afc6b1e]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0xa9eb5)[0x55ae0afa1eb5]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0xae055)[0x55ae0afa6055]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(__rust_maybe_catch_panic+0x1a)[0x55ae0b00a01a]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0xae5d2)[0x55ae0afa65d2]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0x104a4f)[0x55ae0affca4f]
/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf(+0x111750)[0x55ae0b009750]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7ffb1629c6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7ffb15dbc41d]
======= Memory map: ========
55ae0aef8000-55ae0b05d000 r-xp 00000000 08:01 805133 /home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf
55ae0b25c000-55ae0b272000 r--p 00164000 08:01 805133 /home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf
55ae0b272000-55ae0b273000 rw-p 0017a000 08:01 805133 /home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf
55ae0cbb6000-55ae0cbd7000 rw-p 00000000 00:00 0 [heap]
7ffb00000000-7ffb00022000 rw-p 00000000 00:00 0
7ffb00022000-7ffb04000000 ---p 00000000 00:00 0
7ffb06362000-7ffb08000000 rw-p 00000000 00:00 0
7ffb08000000-7ffb08021000 rw-p 00000000 00:00 0
7ffb08021000-7ffb0c000000 ---p 00000000 00:00 0
7ffb0c000000-7ffb0c021000 rw-p 00000000 00:00 0
7ffb0c021000-7ffb10000000 ---p 00000000 00:00 0
7ffb10000000-7ffb10021000 rw-p 00000000 00:00 0
7ffb10021000-7ffb14000000 ---p 00000000 00:00 0
7ffb14968000-7ffb14973000 r-xp 00000000 08:01 5376190 /lib/x86_64-linux-gnu/libnss_files-2.23.so
7ffb14973000-7ffb14b72000 ---p 0000b000 08:01 5376190 /lib/x86_64-linux-gnu/libnss_files-2.23.so
7ffb14b72000-7ffb14b73000 r--p 0000a000 08:01 5376190 /lib/x86_64-linux-gnu/libnss_files-2.23.so
7ffb14b73000-7ffb14b74000 rw-p 0000b000 08:01 5376190 /lib/x86_64-linux-gnu/libnss_files-2.23.so
7ffb14b74000-7ffb14b7a000 rw-p 00000000 00:00 0
7ffb14b7a000-7ffb14b85000 r-xp 00000000 08:01 5376178 /lib/x86_64-linux-gnu/libnss_nis-2.23.so
7ffb14b85000-7ffb14d84000 ---p 0000b000 08:01 5376178 /lib/x86_64-linux-gnu/libnss_nis-2.23.so
7ffb14d84000-7ffb14d85000 r--p 0000a000 08:01 5376178 /lib/x86_64-linux-gnu/libnss_nis-2.23.so
7ffb14d85000-7ffb14d86000 rw-p 0000b000 08:01 5376178 /lib/x86_64-linux-gnu/libnss_nis-2.23.so
7ffb14d86000-7ffb14d9c000 r-xp 00000000 08:01 5376188 /lib/x86_64-linux-gnu/libnsl-2.23.so
7ffb14d9c000-7ffb14f9b000 ---p 00016000 08:01 5376188 /lib/x86_64-linux-gnu/libnsl-2.23.so
7ffb14f9b000-7ffb14f9c000 r--p 00015000 08:01 5376188 /lib/x86_64-linux-gnu/libnsl-2.23.so
7ffb14f9c000-7ffb14f9d000 rw-p 00016000 08:01 5376188 /lib/x86_64-linux-gnu/libnsl-2.23.so
7ffb14f9d000-7ffb14f9f000 rw-p 00000000 00:00 0
7ffb14f9f000-7ffb14fa7000 r-xp 00000000 08:01 5376255 /lib/x86_64-linux-gnu/libnss_compat-2.23.so
7ffb14fa7000-7ffb151a6000 ---p 00008000 08:01 5376255 /lib/x86_64-linux-gnu/libnss_compat-2.23.so
7ffb151a6000-7ffb151a7000 r--p 00007000 08:01 5376255 /lib/x86_64-linux-gnu/libnss_compat-2.23.so
7ffb151a7000-7ffb151a8000 rw-p 00008000 08:01 5376255 /lib/x86_64-linux-gnu/libnss_compat-2.23.so
7ffb151a8000-7ffb151a9000 ---p 00000000 00:00 0
7ffb151a9000-7ffb153a9000 rw-p 00000000 00:00 0
7ffb153a9000-7ffb153aa000 ---p 00000000 00:00 0
7ffb153aa000-7ffb155aa000 rw-p 00000000 00:00 0
7ffb155aa000-7ffb155ab000 ---p 00000000 00:00 0
7ffb155ab000-7ffb157ab000 rw-p 00000000 00:00 0
7ffb157ab000-7ffb157ac000 ---p 00000000 00:00 0
7ffb157ac000-7ffb159ac000 rw-p 00000000 00:00 0
7ffb159ac000-7ffb15ab4000 r-xp 00000000 08:01 5376462 /lib/x86_64-linux-gnu/libm-2.23.so
7ffb15ab4000-7ffb15cb3000 ---p 00108000 08:01 5376462 /lib/x86_64-linux-gnu/libm-2.23.so
7ffb15cb3000-7ffb15cb4000 r--p 00107000 08:01 5376462 /lib/x86_64-linux-gnu/libm-2.23.so
7ffb15cb4000-7ffb15cb5000 rw-p 00108000 08:01 5376462 /lib/x86_64-linux-gnu/libm-2.23.so
7ffb15cb5000-7ffb15e75000 r-xp 00000000 08:01 5376208 /lib/x86_64-linux-gnu/libc-2.23.so
7ffb15e75000-7ffb16075000 ---p 001c0000 08:01 5376208 /lib/x86_64-linux-gnu/libc-2.23.so
7ffb16075000-7ffb16079000 r--p 001c0000 08:01 5376208 /lib/x86_64-linux-gnu/libc-2.23.so
7ffb16079000-7ffb1607b000 rw-p 001c4000 08:01 5376208 /lib/x86_64-linux-gnu/libc-2.23.so
7ffb1607b000-7ffb1607f000 rw-p 00000000 00:00 0
7ffb1607f000-7ffb16095000 r-xp 00000000 08:01 5378575 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffb16095000-7ffb16294000 ---p 00016000 08:01 5378575 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffb16294000-7ffb16295000 rw-p 00015000 08:01 5378575 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffb16295000-7ffb162ad000 r-xp 00000000 08:01 5376173 /lib/x86_64-linux-gnu/libpthread-2.23.so
7ffb162ad000-7ffb164ac000 ---p 00018000 08:01 5376173 /lib/x86_64-linux-gnu/libpthread-2.23.so
7ffb164ac000-7ffb164ad000 r--p 00017000 08:01 5376173 /lib/x86_64-linux-gnu/libpthread-2.23.so
7ffb164ad000-7ffb164ae000 rw-p 00018000 08:01 5376173 /lib/x86_64-linux-gnu/libpthread-2.23.so
7ffb164ae000-7ffb164b2000 rw-p 00000000 00:00 0
7ffb164b2000-7ffb164b9000 r-xp 00000000 08:01 5376158 /lib/x86_64-linux-gnu/librt-2.23.so
7ffb164b9000-7ffb166b8000 ---p 00007000 08:01 5376158 /lib/x86_64-linux-gnu/librt-2.23.so
7ffb166b8000-7ffb166b9000 r--p 00006000 08:01 5376158 /lib/x86_64-linux-gnu/librt-2.23.so
7ffb166b9000-7ffb166ba000 rw-p 00007000 08:01 5376158 /lib/x86_64-linux-gnu/librt-2.23.so
7ffb166ba000-7ffb166bd000 r-xp 00000000 08:01 5376163 /lib/x86_64-linux-gnu/libdl-2.23.so
7ffb166bd000-7ffb168bc000 ---p 00003000 08:01 5376163 /lib/x86_64-linux-gnu/libdl-2.23.so
7ffb168bc000-7ffb168bd000 r--p 00002000 08:01 5376163 /lib/x86_64-linux-gnu/libdl-2.23.so
7ffb168bd000-7ffb168be000 rw-p 00003000 08:01 5376163 /lib/x86_64-linux-gnu/libdl-2.23.so
7ffb168be000-7ffb1693d000 r-xp 00000000 08:01 3154632 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7ffb1693d000-7ffb16b3c000 ---p 0007f000 08:01 3154632 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7ffb16b3c000-7ffb16b3d000 r--p 0007e000 08:01 3154632 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7ffb16b3d000-7ffb16b3e000 rw-p 0007f000 08:01 3154632 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7ffb16b3e000-7ffb171a0000 r-xp 00000000 08:01 3150953 /usr/lib/x86_64-linux-gnu/libpari-gmp-tls.so.2.7.5
7ffb171a0000-7ffb1739f000 ---p 00662000 08:01 3150953 /usr/lib/x86_64-linux-gnu/libpari-gmp-tls.so.2.7.5
7ffb1739f000-7ffb173a1000 r--p 00661000 08:01 3150953 /usr/lib/x86_64-linux-gnu/libpari-gmp-tls.so.2.7.5
7ffb173a1000-7ffb173c0000 rw-p 00663000 08:01 3150953 /usr/lib/x86_64-linux-gnu/libpari-gmp-tls.so.2.7.5
7ffb173c0000-7ffb173de000 rw-p 00000000 00:00 0
7ffb173de000-7ffb17404000 r-xp 00000000 08:01 5376165 /lib/x86_64-linux-gnu/ld-2.23.so
7ffb174cb000-7ffb175d3000 rw-p 00000000 00:00 0
7ffb175f9000-7ffb17603000 rw-p 00000000 00:00 0
7ffb17603000-7ffb17604000 r--p 00025000 08:01 5376165 /lib/x86_64-linux-gnu/ld-2.23.so
7ffb17604000-7ffb17605000 rw-p 00026000 08:01 5376165 /lib/x86_64-linux-gnu/ld-2.23.so
7ffb17605000-7ffb17606000 rw-p 00000000 00:00 0
7ffd546c8000-7ffd546ea000 rw-p 00000000 00:00 0 [stack]
7ffd547f9000-7ffd547fc000 r--p 00000000 00:00 0 [vvar]
7ffd547fc000-7ffd547fe000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
error: process didn't exit successfully: `/home/amanusk/rust/class-groups/target/debug/deps/class_group-aae55a43ccd626bf 'tests::'` (signal: 6, SIGABRT: process abort signal)
---------------------------------------------------------------------------------
> cargo test tests::
Finished dev [unoptimized + debuginfo] target(s) in 0.10s
Running target/debug/deps/class_group-aae55a43ccd626bf
running 5 tests
test tests::test_bn_to_gen_to_bn ... ok
test primitives::tests::test_log ... ok
*** bug in PARI/GP (Segmentation Fault), please report.
*** Error in the PARI system. End of program.
error: test failed, to rerun pass '--lib'
----------------------------------------------------------------
When running:
cargo test tests -- --test-threads=1
Tests always pass successfuly
nice observation . I will update the readme to add -- --test-threads=1
Indeed! will try to use it.
Description: Running the tests seems to cause occasional errors. Some times the tests pass succesfully (as in the first example) and sometimes end with various errors, which seem related to PARI memory management.
System: Ubuntu 16.04 How to reproduce:
cargo test --lib
Each run result is separated by
-------------------------------------