hectorgimenez / koolo

Diablo II Resurrected bot written in Go
MIT License
64 stars 34 forks source link

Pit run invalid memory address or nil pointer derefence #279

Closed dmelia closed 1 month ago

dmelia commented 1 month ago

Details

Bot crashed and stopped during a pit run, cause seems to be the IsFinished function in file action.go

Version

dev

Logs

time=10:53:53 level=ERROR msg="fatal error detected, forcing shutdown" supervisor=sorc error="runtime error: invalid memory address or nil pointer dereference" stacktrace="goroutine 296 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x5e\ngithub.com/hectorgimenez/koolo/internal.(SupervisorManager).Start.func2.1()\n\tgithub.com/hectorgimenez/koolo/internal/manager.go:76 +0x108\npanic({0x11377c0?, 0x1888a80?})\n\truntime/panic.go:770 +0x132\ngithub.com/hectorgimenez/koolo/internal/action.(StepChainAction).IsFinished(0xc0010ee400?)\n\t:1 +0x9\ngithub.com/hectorgimenez/koolo/internal.(Bot).Run(0xc0010ee400, {0x1415480, 0xc0012220f0}, 0x1, {0xc001158200, 0x5, 0x0?})\n\tgithub.com/hectorgimenez/koolo/internal/bot.go:161 +0x1065\ngithub.com/hectorgimenez/koolo/internal.(SinglePlayerSupervisor).Start(0xc00009a350)\n\tgithub.com/hectorgimenez/koolo/internal/single_supervisor.go:70 +0x485\ngithub.com/hectorgimenez/koolo/internal.(SupervisorManager).Start.func2()\n\tgithub.com/hectorgimenez/koolo/internal/manager.go:82 +0xa2\ncreated by github.com/hectorgimenez/koolo/internal.(SupervisorManager).Start in goroutine 12\n\tgithub.com/hectorgimenez/koolo/internal/manager.go:69 +0x21d\n"

dmelia commented 1 month ago

The fix seems to be changing the IsFinished function in action.go to : func (b *basicAction) IsFinished() bool { if b == nil { return true } return b.isFinished }

dmelia commented 1 month ago

It seems this error was happening because I was too lazy to also copy the "tools" folder after compiling. The problem seems to be fixed. Ignore this issue.