decred / gominer

Go (golang) based GPU miner for Decred.
GNU General Public License v3.0
162 stars 80 forks source link

Panic when miner can't start #44

Closed jcvernaleo closed 1 year ago

jcvernaleo commented 8 years ago

If mining can't start due (for example no permission to use the GPU) gominer panics. It should error gracefully with some sort of message:

20:03:59 2016-08-02 [WRN] MAIN: open /home/jcv/.gominer/gominer.conf: no such file or directory
20:03:59 2016-08-02 [INF] MAIN: Version 0.2.0-beta
No protocol specified
Error: No root privilege. Please check with the system-admin.
Error: No root privilege. Please check with the system-admin.
No protocol specified
No protocol specified
Error: No root privilege. Please check with the system-admin.
Error: No root privilege. Please check with the system-admin.
20:03:59 2016-08-02 [INF] POOL: Using pool: stratum+tcp://yiimp.ccminer.org:4252
No protocol specified
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x0 pc=0x7fe8381172fb]

runtime stack:
runtime.throw(0xcaca60, 0x2a)
    /home/jcv/code/golang/src/runtime/panic.go:547 +0x90
runtime.sigpanic()
    /home/jcv/code/golang/src/runtime/sigpanic_unix.go:12 +0x5a

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0xa0e160, 0xc8203f5aa0, 0x0)
    /home/jcv/code/golang/src/runtime/cgocall.go:123 +0xc2 fp=0xc8203f5a50 sp=0xc8203f5a28
github.com/decred/gominer/cl._Cfunc_clGetPlatformIDs(0xc800000000, 0x0, 0xc820462490, 0xc800000000)
    ??:0 +0x61 fp=0xc8203f5aa0 sp=0xc8203f5a50
github.com/decred/gominer/cl.CLGetPlatformIDs(0x0, 0x0, 0x0, 0x0, 0xc8203f5b94, 0xc82044a000)
    /home/jcv/code/go/src/github.com/decred/gominer/cl/platform.go:34 +0xce fp=0xc8203f5b60 sp=0xc8203f5aa0
main.getCLPlatforms(0x0, 0x0, 0x0, 0x0, 0x0)
    /home/jcv/code/go/src/github.com/decred/gominer/miner.go:19 +0x77 fp=0xc8203f5bc8 sp=0xc8203f5b60
main.NewMiner(0xc82007bda8, 0x0, 0x0)
    /home/jcv/code/go/src/github.com/decred/gominer/miner.go:78 +0x520 fp=0xc8203f5e08 sp=0xc8203f5bc8
main.gominerMain(0x0, 0x0)
    /home/jcv/code/go/src/github.com/decred/gominer/main.go:75 +0x7c0 fp=0xc8203f5f20 sp=0xc8203f5e08
main.main()
    /home/jcv/code/go/src/github.com/decred/gominer/main.go:99 +0x38 fp=0xc8203f5f48 sp=0xc8203f5f20
runtime.main()
    /home/jcv/code/golang/src/runtime/proc.go:188 +0x247 fp=0xc8203f5f90 sp=0xc8203f5f48
runtime.goexit()
    /home/jcv/code/golang/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc8203f5f98 sp=0xc8203f5f90

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /home/jcv/code/golang/src/runtime/asm_amd64.s:1998 +0x1

goroutine 20 [semacquire]:
sync.runtime_Syncsemacquire(0xc8200716d0)
    /home/jcv/code/golang/src/runtime/sema.go:241 +0x201
sync.(*Cond).Wait(0xc8200716c0)
    /home/jcv/code/golang/src/sync/cond.go:63 +0xb3
github.com/decred/gominer/vendor/github.com/btcsuite/seelog.(*asyncLoopLogger).processItem(0xc82006e7e0, 0x0)
    /home/jcv/code/go/src/github.com/decred/gominer/vendor/github.com/btcsuite/seelog/behavior_asynclooplogger.go:50 +0x179
github.com/decred/gominer/vendor/github.com/btcsuite/seelog.(*asyncLoopLogger).processQueue(0xc82006e7e0)
    /home/jcv/code/go/src/github.com/decred/gominer/vendor/github.com/btcsuite/seelog/behavior_asynclooplogger.go:63 +0x4b
created by github.com/decred/gominer/vendor/github.com/btcsuite/seelog.newAsyncLoopLogger
    /home/jcv/code/go/src/github.com/decred/gominer/vendor/github.com/btcsuite/seelog/behavior_asynclooplogger.go:40 +0xd7

goroutine 21 [semacquire]:
sync.runtime_Syncsemacquire(0xc820071850)
    /home/jcv/code/golang/src/runtime/sema.go:241 +0x201
sync.(*Cond).Wait(0xc820071840)
    /home/jcv/code/golang/src/sync/cond.go:63 +0xb3
github.com/decred/gominer/vendor/github.com/btcsuite/seelog.(*asyncLoopLogger).processItem(0xc82006e900, 0x0)
    /home/jcv/code/go/src/github.com/decred/gominer/vendor/github.com/btcsuite/seelog/behavior_asynclooplogger.go:50 +0x179
github.com/decred/gominer/vendor/github.com/btcsuite/seelog.(*asyncLoopLogger).processQueue(0xc82006e900)
    /home/jcv/code/go/src/github.com/decred/gominer/vendor/github.com/btcsuite/seelog/behavior_asynclooplogger.go:63 +0x4b
created by github.com/decred/gominer/vendor/github.com/btcsuite/seelog.newAsyncLoopLogger
    /home/jcv/code/go/src/github.com/decred/gominer/vendor/github.com/btcsuite/seelog/behavior_asynclooplogger.go:40 +0xd7

goroutine 22 [syscall]:
os/signal.signal_recv(0x48c481)
    /home/jcv/code/golang/src/runtime/sigqueue.go:116 +0x132
os/signal.loop()
    /home/jcv/code/golang/src/os/signal/signal_unix.go:22 +0x26
created by os/signal.init.1
    /home/jcv/code/golang/src/os/signal/signal_unix.go:28 +0x45

goroutine 4 [chan receive]:
github.com/decred/gominer/vendor/github.com/btcsuite/seelog.(*asyncAdaptiveLogger).processQueue(0xc8200a2180)
    /home/jcv/code/go/src/github.com/decred/gominer/vendor/github.com/btcsuite/seelog/behavior_adaptivelogger.go:127 +0xac
created by github.com/decred/gominer/vendor/github.com/btcsuite/seelog.newAsyncAdaptiveLogger
    /home/jcv/code/go/src/github.com/decred/gominer/vendor/github.com/btcsuite/seelog/behavior_adaptivelogger.go:84 +0x6a9

goroutine 25 [IO wait]:
net.runtime_pollWait(0x7fe838b3a828, 0x72, 0x43e0c9)
    /home/jcv/code/golang/src/runtime/netpoll.go:160 +0x63
net.(*pollDesc).Wait(0xc820478140, 0x72, 0x0, 0x0)
    /home/jcv/code/golang/src/net/fd_poll_runtime.go:73 +0x56
net.(*pollDesc).WaitRead(0xc820478140, 0x0, 0x0)
    /home/jcv/code/golang/src/net/fd_poll_runtime.go:78 +0x44
net.(*netFD).Read(0xc8204780e0, 0xc8204b4000, 0x1000, 0x1000, 0x0, 0x7fe83ce48000, 0xc820074000)
    /home/jcv/code/golang/src/net/fd_unix.go:250 +0x27b
net.(*conn).Read(0xc82044a000, 0xc8204b4000, 0x1000, 0x1000, 0xc82002d000, 0x0, 0x0)
    /home/jcv/code/golang/src/net/net.go:172 +0x121
net.(*TCPConn).Read(0xc82044a000, 0xc8204b4000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    <autogenerated>:68 +0x7d
bufio.(*Reader).fill(0xc8204b2000)
    /home/jcv/code/golang/src/bufio/bufio.go:97 +0x365
bufio.(*Reader).ReadSlice(0xc8204b2000, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/jcv/code/golang/src/bufio/bufio.go:328 +0x5a9
bufio.(*Reader).ReadBytes(0xc8204b2000, 0xc820074f0a, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/jcv/code/golang/src/bufio/bufio.go:406 +0xc0
bufio.(*Reader).ReadString(0xc8204b2000, 0xc820074f0a, 0x0, 0x0, 0x0, 0x0)
    /home/jcv/code/golang/src/bufio/bufio.go:446 +0x5b
github.com/decred/gominer/stratum.(*Stratum).Listen(0xc82007a000)
    /home/jcv/code/go/src/github.com/decred/gominer/stratum/stratum.go:255 +0x1c2
created by github.com/decred/gominer/stratum.StratumConn
    /home/jcv/code/go/src/github.com/decred/gominer/stratum/stratum.go:201 +0xa51
N3KA commented 7 years ago

Am not sure what this means or where it belongs but it seems similar to the original issue. GoMiner never gets far when I try to run it. Always the same results listed below. Not sure if there's any hope heh.

C:\decred\GoMiner\gominer-windows-amd64-cuda-v0.6.0>gominer.exe 15:23:08 2017-03-26 [INF] MAIN: Version 0.6.0-beta CUDA panic: Unknown CUresult: 35

goroutine 28 [running, locked to thread]: panic(0x81e680, 0xc0423cc408) C:/Go/src/runtime/panic.go:500 +0x1af github.com/decred/gominer/vendor/github.com/jcvernaleo/3/cuda/cu.DeviceReset() C:/Users/jolan/go/src/github.com/decred/gominer/vendor/github.com/jcvern aleo/3/cuda/cu/runtimeapi.go:26 +0x7b main.(Device).runDevice(0xc0423a6000, 0x0, 0x0) C:/Users/jolan/go/src/github.com/decred/gominer/cudevice.go:284 +0x146 main.(Device).Run(0xc0423a6000) C:/Users/jolan/go/src/github.com/decred/gominer/device.go:95 +0x36 main.(Miner).Run.func1(0xc0423a6000, 0xc04202b030) C:/Users/jolan/go/src/github.com/decred/gominer/miner.go:212 +0x32 created by main.(Miner).Run C:/Users/jolan/go/src/github.com/decred/gominer/miner.go:215 +0xa4

C:\decred\GoMiner\gominer-windows-amd64-cuda-v0.6.0>

jolan commented 7 years ago

@N3KA Your drivers are out of date or you have a really old card that doesn't support modern CUDA.