aionnetwork / aion_miner

aion miner
57 stars 25 forks source link

Segmentation fault thrown after sending SIGINT #9

Closed synapsics-sergiu closed 6 years ago

synapsics-sergiu commented 6 years ago

Sending SIGINT (pressing CTRL+C) will crash the app by throwing SegFault.

sergiufalcusan@sergiufalcusan:~/Projects/aion_miner/build$ gdb --args ./aionminer -cd 0 -cv 1 -cb 64 -ct 64
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./aionminer...done.
(gdb) r
Starting program: /home/sergiufalcusan/Projects/aion_miner/build/aionminer -cd 0 -cv 1 -cb 64 -ct 64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

    ============================= aion reference miner======================
            Equihash<210,9> CPU&GPU Miner for AION v0.1.8
            Base on NiceHash equihash miner.
    ============================= aion reference miner======================

Setting log level to 2
[16:37:54][0x00007ffff7fcb740] Using SSE2: YES
[16:37:54][0x00007ffff7fcb740] Using AVX: YES
[16:37:54][0x00007ffff7fcb740] Using AVX2: YES
[New Thread 0x7ffff5d56700 (LWP 16792)]
[New Thread 0x7ffff5555700 (LWP 16793)]
[16:37:54][0x00007ffff7fcb740] SIGINT REGISTERED
[16:37:54][0x00007ffff5555700] stratum | Starting miner
[New Thread 0x7ffff4d54700 (LWP 16794)]
[16:37:54][0x00007ffff5555700] stratum | Connecting to stratum server localhost:3333
[16:37:54][0x00007ffff4d54700] miner#0 | Starting thread #0 (CUDA-TROMP) GeForce GTX 950M (#0) BLOCKS=64, THREADS=64
[New Thread 0x7fffeffff700 (LWP 16795)]
[16:37:54][0x00007ffff5555700] stratum | Connected!
[16:37:54][0x00007ffff5555700] stratum | Subscribed to stratum server
[16:37:54][0x00007ffff5555700] miner | Extranonce is 68000001
[16:37:54][0x00007ffff5555700] stratum | Received new job #25
[16:37:54][0x00007ffff5555700] stratum | Authorized worker 0x0000000000000000000000000000000000000000000000000000000000000000
[New Thread 0x7fffef7fe700 (LWP 16796)]
[16:38:03][0x00007ffff5555700] stratum | Received new job #26
[16:38:04][0x00007ffff5555700] stratum | Received new job #27
[16:38:04][0x00007ffff7fcb740] Speed [15 sec]: 1.18835 I/s, 2.77283 Sols/s
^C
Thread 1 "aionminer" received signal SIGINT, Interrupt.
0x00007ffff7bcac1d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
84  ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) signal 2
Continuing with signal SIGINT.

Thread 4 "aionminer" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff4d54700 (LWP 16794)]
0x000000000157e2b0 in ?? ()
(gdb) bt
#0  0x000000000157e2b0 in ?? ()
#1  0x00000000004a9808 in AionMinerThread(AionMiner*, int, int, ISolver*) ()
#2  0x00007ffff76ecc80 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff7bc16ba in start_thread (arg=0x7ffff4d54700) at pthread_create.c:333
#4  0x00007ffff6e5241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
synapsics-sergiu commented 6 years ago

Created a pull request.

synapsics-sergiu commented 6 years ago

Fixed in #10