gchilders / msieve_nfsathome

3 stars 5 forks source link

Segmentation Fault during singleton removal #2

Closed NyanCatTW1 closed 2 years ago

NyanCatTW1 commented 2 years ago

Tested on commit ef9c03e Built with make all ECM=1 CUDA=75 NO_ZLIB=1

(gdb) bt
#0  0x00000000004469ce in filter_purge_singletons_core._omp_fn.2 () at common/filter/singleton.c:574
#1  0x00007f556bd560ae in __kmp_api_GOMP_parallel_40_alias () from /usr/lib64/libomp.so
#2  0x0000000000447443 in filter_purge_singletons_core (obj=0x1fbd730, obj@entry=0x7f556bd50e80 <__kmp_GOMP_microtask_wrapper(int*, int*, void (*)(void*), void*)>, filter=filter@entry=0x3000000030) at common/filter/singleton.c:569
#3  0x0000000000447c22 in filter_read_lp_file (obj=0x7f556bd50e80 <__kmp_GOMP_microtask_wrapper(int*, int*, void (*)(void*), void*)>, obj@entry=0x1fbd730, filter=0x3000000030, filter@entry=0x7ffe62a3a870, max_ideal_weight=1654892656, 
    max_ideal_weight@entry=0) at common/filter/singleton.c:139
#4  0x000000000042b44c in nfs_filter_relations (obj=obj@entry=0x1fbd730, n=n@entry=0x7ffe62a3abf0) at gnfs/filter/filter.c:376
#5  0x0000000000418515 in factor_gnfs (obj=obj@entry=0x1fbd730, input_n=input_n@entry=0x7ffe62a3b0b0, factor_list=factor_list@entry=0x7ffe62a3b260) at gnfs/gnfs.c:153
#6  0x0000000000407cc8 in msieve_run_core (factor_list=0x7ffe62a3b260, n=0x7ffe62a3b0b0, obj=0x1fbd730) at common/driver.c:158
#7  msieve_run (obj=0x1fbd730) at common/driver.c:278
#8  0x000000000040666b in factor_integer (buf=buf@entry=0x7ffe62a3bbc0 "14132808201520204578813892668326213464924067810664854585119702903005027767549631914683", flags=flags@entry=1025, savefile_name=savefile_name@entry=0x0, 
    logfile_name=logfile_name@entry=0x0, nfs_fbfile_name=nfs_fbfile_name@entry=0x0, seed1=seed1@entry=0x7ffe62a3bba4, seed2=0x7ffe62a3bba8, max_relations=0, cpu=cpu_core, cache_size1=32768, cache_size2=9437184, num_threads=0, 
    which_gpu=0, nfs_args=0x0) at demo.c:240
#9  0x000000000040624e in main (argc=1654897576, argv=0x7ffe62a3bbc0) at demo.c:617

Reproduce: https://mega.nz/file/Gxh0jBbR#A_oXvGebJ3ZTXGjK0WkQCiAUWTBG_qJ92pg4DtmnzS0 Command: msieve -nc1 -i N.txt

This error does not occur on commit 2b24147; git bisect shows that this error started occuring after commit dfd59c7.

gchilders commented 2 years ago

Thank you for the clear reproduction. It's fixed in commit 6ddf5ec.

gchilders commented 2 years ago

Turns out that was only a partial fix. It's now properly fixed in commit 66b8174aebcdfb410337d7c209c61c5677f0640a.