Closed falconwoods closed 6 years ago
In the future can you build with make
? If you do, the startup message for siad will include the commit number, so that we can more easily track down the issue.
This is probably enough for us to trace though.
Here is the output with Git Revision:
Running with debugging enabled Sia Daemon v1.3.3 Git Revision 156bf265
Here is the complete output:
./siad -M gctwh
Running with debugging enabled
Sia Daemon v1.3.3
Git Revision 156bf265
Loading...
(0/5) Loading siad...
(1/5) Loading gateway...
(2/5) Loading consensus...
(3/5) Loading transaction pool...
(4/5) Loading wallet...
(5/5) Loading host...
Finished loading in 0.258022928 seconds
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x11f6c]
goroutine 683 [running]:
sync/atomic.addUint64(0x1205429c, 0x100000, 0x0, 0x7, 0x8)
/home/pi/openSource/go-go1.10.2/src/sync/atomic/64bit_arm.go:31 +0x4c
github.com/NebulousLabs/Sia/sync.(*TryRWMutex).Lock(0x1205429c)
/home/pi/go/src/github.com/NebulousLabs/Sia/sync/tryrwmutex.go:29 +0x30
github.com/NebulousLabs/Sia/modules/host/contractmanager.(*writeAheadLog).managedAddStorageFolder(0x122f0e88, 0x12054240, 0x0, 0x0)
/home/pi/go/src/github.com/NebulousLabs/Sia/modules/host/contractmanager/storagefolderadd.go:97 +0x38
github.com/NebulousLabs/Sia/modules/host/contractmanager.(*ContractManager).AddStorageFolder(0x122f0e00, 0x120443a0, 0x18, 0xd0000000, 0x45, 0x0, 0x0)
/home/pi/go/src/github.com/NebulousLabs/Sia/modules/host/contractmanager/storagefolderadd.go:370 +0x260
github.com/NebulousLabs/Sia/node/api.(*API).storageFoldersAddHandler(0x123070e0, 0x66a660, 0x12054120, 0x11f9e200, 0x0, 0x0, 0x0)
/home/pi/go/src/github.com/NebulousLabs/Sia/node/api/host.go:315 +0xfc
github.com/NebulousLabs/Sia/node/api.(*API).(github.com/NebulousLabs/Sia/node/api.storageFoldersAddHandler)-fm(0x66a660, 0x12054120, 0x11f9e200, 0x0, 0x0, 0x
0)
/home/pi/go/src/github.com/NebulousLabs/Sia/node/api/routes.go:53 +0x4c
github.com/julienschmidt/httprouter.(*Router).ServeHTTP(0x12448e20, 0x66a660, 0x12054120, 0x11f9e200)
/home/pi/go/src/github.com/julienschmidt/httprouter/router.go:334 +0x658
github.com/NebulousLabs/Sia/node/api.RequireUserAgent.func1(0x66a660, 0x12054120, 0x11f9e200)
/home/pi/go/src/github.com/NebulousLabs/Sia/node/api/routes.go:177 +0x98
net/http.HandlerFunc.ServeHTTP(0x12448ee0, 0x66a660, 0x12054120, 0x11f9e200)
/home/pi/openSource/go-go1.10.2/src/net/http/server.go:1947 +0x34
github.com/NebulousLabs/Sia/node/api.cleanCloseHandler.func1.1(0x123a22c0, 0x668818, 0x12448ee0, 0x66a660, 0x12054120, 0x11f9e200)
/home/pi/go/src/github.com/NebulousLabs/Sia/node/api/routes.go:148 +0x60
created by github.com/NebulousLabs/Sia/node/api.cleanCloseHandler.func1
/home/pi/go/src/github.com/NebulousLabs/Sia/node/api/routes.go:146 +0x78
I really want to run sia on my raspberry with raspberry os. I know about that there is a special image for pi which based on geento to run sia. I haven't tried that image yet but I prefer raspberry os.
It will be fantastic if we can success running sia on raspberry pi! There will be more fellows join sia.
@wxlcat I suspect that this is due to a 64-bit field not being properly aligned on ARM. Can you apply the following patch and try again?
diff --git a/modules/host/contractmanager/storagefolder.go b/modules/host/contractmanager/storagefolder.go
index 7208fc5..131099f 100644
--- a/modules/host/contractmanager/storagefolder.go
+++ b/modules/host/contractmanager/storagefolder.go
@@ -82,6 +82,11 @@ var (
// sectors are being stored in the folder. What sectors are being stored is
// managed by the contract manager's sectorLocations map.
type storageFolder struct {
+ // mu needs to be RLocked to safetly write new sectors into the storage
+ // folder. mu needs to be Locked when the folder is being added, removed,
+ // or resized.
+ mu sync.TryRWMutex
+
// Progress statistics that can be reported to the user. Typically for long
// running actions like adding or resizing a storage folder.
atomicProgressNumerator uint64
@@ -113,11 +118,6 @@ type storageFolder struct {
availableSectors map[sectorID]uint32
sectors uint64
- // mu needs to be RLocked to safetly write new sectors into the storage
- // folder. mu needs to be Locked when the folder is being added, removed,
- // or resized.
- mu sync.TryRWMutex
-
// An open file handle is kept so that writes can easily be made to the
// storage folder without needing to grab a new file handle. This also
// makes it easy to do delayed-syncing.
It works,Thanks a lot! Will this issue be fixed in the next version?
Yes, we can include this in the next release. Just need to PR the patch above.
BUG REPORT
Stack Trace or error message sudo siad -M gctwh Sia Daemon v1.3.3 WARN: compiled without build commit or version. To compile correctly, please use the makefile Loading... (0/5) Loading siad... (1/5) Loading gateway... (2/5) Loading consensus... (3/5) Loading transaction pool... (4/5) Loading wallet... (5/5) Loading host... Finished loading in 1.335164035 seconds panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x123bc]
goroutine 528 [running]: sync/atomic.addUint64(0x11c6644c, 0x100000, 0x0, 0x7, 0x8) /home/pi/openSource/go-go1.10.2/src/sync/atomic/64bit_arm.go:31 +0x4c github.com/NebulousLabs/Sia/sync.(TryRWMutex).Lock(0x11c6644c) /home/pi/go/src/github.com/NebulousLabs/Sia/sync/tryrwmutex.go:29 +0x30 github.com/NebulousLabs/Sia/modules/host/contractmanager.(writeAheadLog).managedAddStorageFolder(0x11567ba8, 0x11c663f0, 0x0, 0x0) /home/pi/go/src/github.com/NebulousLabs/Sia/modules/host/contractmanager/storagefolderadd.go:97 +0x38 github.com/NebulousLabs/Sia/modules/host/contractmanager.(ContractManager).AddStorageFolder(0x11567b20, 0x119261e0, 0x18, 0xd0000000, 0x45, 0x0, 0x0) /home/pi/go/src/github.com/NebulousLabs/Sia/modules/host/contractmanager/storagefolderadd.go:370 +0x260 github.com/NebulousLabs/Sia/node/api.(API).storageFoldersAddHandler(0x115ac0a0, 0x641fc8, 0x11c662d0, 0x11d80000, 0x0, 0x0, 0x0) /home/pi/go/src/github.com/NebulousLabs/Sia/node/api/host.go:315 +0xfc github.com/NebulousLabs/Sia/node/api.(API).(github.com/NebulousLabs/Sia/node/api.storageFoldersAddHandler)-fm(0x641fc8, 0x11c662d0, 0x11d80000, 0x0, 0x0, 0x0) /home/pi/go/src/github.com/NebulousLabs/Sia/node/api/routes.go:53 +0x4c github.com/julienschmidt/httprouter.(Router).ServeHTTP(0x117ce800, 0x641fc8, 0x11c662d0, 0x11d80000) /home/pi/go/src/github.com/julienschmidt/httprouter/router.go:334 +0x658 github.com/NebulousLabs/Sia/node/api.RequireUserAgent.func1(0x641fc8, 0x11c662d0, 0x11d80000) /home/pi/go/src/github.com/NebulousLabs/Sia/node/api/routes.go:177 +0x98 net/http.HandlerFunc.ServeHTTP(0x117ce8c0, 0x641fc8, 0x11c662d0, 0x11d80000) /home/pi/openSource/go-go1.10.2/src/net/http/server.go:1947 +0x34 github.com/NebulousLabs/Sia/node/api.cleanCloseHandler.func1.1(0x11c500c0, 0x640190, 0x117ce8c0, 0x641fc8, 0x11c662d0, 0x11d80000) /home/pi/go/src/github.com/NebulousLabs/Sia/node/api/routes.go:148 +0x60 created by github.com/NebulousLabs/Sia/node/api.cleanCloseHandler.func1 /home/pi/go/src/github.com/NebulousLabs/Sia/node/api/routes.go:146 +0x78
Expected Behavior
How to reproduce it (as minimally and precisely as possible)
Environment