JayDDee / cpuminer-opt

Optimized multi algo CPU miner
Other
775 stars 545 forks source link

Release 3.12.6 segfaults during benchmark #254

Closed emerzon closed 4 years ago

emerzon commented 4 years ago

After building 3.12.6, I have a segfault when trying to run any algo. 3.12.5 builds and runs normally.

GDB output below:

Reading symbols from ./cpuminer... (gdb) run -a m7m --bench Starting program: /home/egomes/repos/cpuminer-opt/cpuminer -a m7m --bench [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

     **********  cpuminer-opt 3.12.6  *********** 
 A CPU miner with multi algo support and optimized for CPUs
 with AVX512, SHA and VAES extensions.
 BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT

CPU: AMD Ryzen 9 3900X 12-Core Processor . SW built on Mar 7 2020 with GCC 9.2.1 CPU features: AVX2 AES SHA SW features: AVX2 AES SHA Algo features: SHA

Starting miner with SHA...

Program received signal SIGSEGV, Segmentation fault. __strncasecmp_l_avx () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:199 199 ../sysdeps/x86_64/multiarch/strcmp-sse42.S: No such file or directory.

(gdb) backtrace

0 __strncasecmp_l_avx () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:199

1 0x000055555555c134 in main (argc=, argv=0x7fffffffde68) at cpu-miner.c:3514

(gdb) frame 1

1 0x000055555555c134 in main (argc=, argv=0x7fffffffde68) at cpu-miner.c:3514

3514 show_usage_and_exit(1); (gdb) print buf $1 = 0x0

JayDDee commented 4 years ago

Please change the title. Only benchmark is affected.

I'll investigate the crash.

JayDDee commented 4 years ago

You found where the problem was but reverting another fix is not the solution.

The logic in the CURL flag setting was flawed causing it to take the wrong path when benchmarking. It will be fixed in the next release.

Until then use v3.12.5 for benchmarking.

JayDDee commented 4 years ago

Here's the fix for curl flags, you can test it if you like.

flags = CURL_GLOBAL_ALL; if ( !opt_benchmark ) if ( strncasecmp( rpc_url, "https:", 6 ) && strncasecmp( rpc_url, "stratum+tcps://", 15 ) ) flags &= ~CURL_GLOBAL_SSL;

emerzon commented 4 years ago

Please change the title. Only benchmark is affected.

I'll investigate the crash.

Title changed. Sorry, I haven't tried normal operation before.

emerzon commented 4 years ago

flags = CURL_GLOBAL_ALL; if ( !opt_benchmark ) if ( strncasecmp( rpc_url, "https:", 6 ) && strncasecmp( rpc_url, "stratum+tcps://", 15 ) ) flags &= ~CURL_GLOBAL_SSL;

Thanks! Fix works nicely.

JayDDee commented 4 years ago

cpuminer-opt-3.12.6.1 is released with the fix.

Thanks for reporting.