This repository was archived by the owner on Jul 3, 2025. It is now read-only.
Description I was debugging an NDF in skyd and ran into the following race condition while running commit 7df49efeb198ce8d27d7ac5a91ce1c4da9cf7311.
I haven't looked into it any further yet because it only happend once so far but there might be something wrong in managedAddPhysicalSector since we are calling defer sf.mu.RUnlock suggesting that we only have a read lock on the storage folder while calling setUsage.
WARNING: DATA RACE
Read at 0x00c000784090 by goroutine 225:
go.sia.tech/siad/modules/host/contractmanager.(*ContractManager).StorageFolders()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/contractmanager/storagefolder.go:439 +0x45c
go.sia.tech/siad/modules/host.(*Host).capacity()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/negotiatesettings.go:19 +0x6f
go.sia.tech/siad/modules/host.(*Host).externalSettings()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/negotiatesettings.go:32 +0xf3
go.sia.tech/siad/modules/host.(*Host).managedUpdatePriceTable()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/host.go:334 +0xfa
go.sia.tech/siad/modules/host.(*Host).managedPriceTableForRenter()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/rpcupdatepricetable.go:96 +0x4a
go.sia.tech/siad/modules/host.(*Host).managedRPCUpdatePriceTable()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/rpcupdatepricetable.go:115 +0x64
go.sia.tech/siad/modules/host.(*Host).threadedHandleStream()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/network.go:415 +0x19a7
go.sia.tech/siad/modules/host.(*Host).threadedHandleStream-fm()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/network.go:349 +0x4d
gitlab.com/NebulousLabs/siamux.(*Handler).threadedHandleNext()
/Users/cschinnerl/go/pkg/mod/gitlab.com/!nebulous!labs/[email protected] /listener.go:82 +0x4a3
gitlab.com/NebulousLabs/siamux.(*SiaMux).threadedAccept.func2()
/Users/cschinnerl/go/pkg/mod/gitlab.com/!nebulous!labs/[email protected] /listener.go:280 +0x85
Previous write at 0x00c000784090 by goroutine 87:
go.sia.tech/siad/modules/host/contractmanager.(*storageFolder).setUsage()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/contractmanager/storagefolder.go:276 +0x317
go.sia.tech/siad/modules/host/contractmanager.(*writeAheadLog).managedAddPhysicalSector.func1()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/contractmanager/sectorupdate.go:93 +0x260
go.sia.tech/siad/modules/host/contractmanager.(*writeAheadLog).managedAddPhysicalSector()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/contractmanager/sectorupdate.go:148 +0x31e
go.sia.tech/siad/modules/host/contractmanager.(*ContractManager).AddSector()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/contractmanager/sectorupdate.go:460 +0x484
go.sia.tech/siad/modules/host.(*Host).managedModifyStorageObligation()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/storageobligations.go:889 +0xa71
go.sia.tech/siad/modules/host.(*Host).managedRPCLoopWrite()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/newrpc.go:389 +0x4b44
go.sia.tech/siad/modules/host.(*Host).managedRPCLoopWrite-fm()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/newrpc.go:162 +0x44
go.sia.tech/siad/modules/host.(*Host).managedRPCLoop()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/rpcloop.go:145 +0x1875
go.sia.tech/siad/modules/host.(*Host).threadedHandleConn()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/network.go:321 +0x23ba
go.sia.tech/siad/modules/host.(*Host).threadedListen·dwrap·63()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/network.go:452 +0x58
Goroutine 225 (running) created at:
gitlab.com/NebulousLabs/siamux.(*SiaMux).threadedAccept()
/Users/cschinnerl/go/pkg/mod/gitlab.com/!nebulous!labs/[email protected] /listener.go:278 +0x804
gitlab.com/NebulousLabs/siamux.(*SiaMux).managedUpgradeConn.func3()
/Users/cschinnerl/go/pkg/mod/gitlab.com/!nebulous!labs/[email protected] /siamux.go:608 +0x3e
Goroutine 87 (running) created at:
go.sia.tech/siad/modules/host.(*Host).threadedListen()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/network.go:452 +0x284
go.sia.tech/siad/modules/host.(*Host).initNetworking·dwrap·54()
/Users/cschinnerl/go/src/github.com/ChrisSchinnerl/siad/modules/host/network.go:246 +0x47
==================
Reactions are currently unavailable
I was debugging an NDF in skyd and ran into the following race condition while running commit
7df49efeb198ce8d27d7ac5a91ce1c4da9cf7311.I haven't looked into it any further yet because it only happend once so far but there might be something wrong in
managedAddPhysicalSectorsince we are callingdefer sf.mu.RUnlocksuggesting that we only have a read lock on the storage folder while callingsetUsage.