Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when running without a blocklist #50

Closed
Cellesti opened this issue Mar 10, 2024 · 1 comment
Closed

Panic when running without a blocklist #50

Cellesti opened this issue Mar 10, 2024 · 1 comment

Comments

@Cellesti
Copy link

Hi, on Tootik 0.9.2, i am seeing a panic on incoming activities when running without -blocklist:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5620b3f2a8b4]

goroutine 75 [running]:
github.com/dimkr/tootik/fed.(*BlockList).Contains(0x0, {0xc000198998?, 0xc0001e33a8?})
	github.com/dimkr/tootik/fed/blocklist.go:140 +0x54
github.com/dimkr/tootik/inbox.(*Queue).processCreateActivity(0xc000078fc0, {0x5620b42607e0, 0xc0001da150}, 0xc000184dd0, 0xc00019c680, 0xc0001f22d0, {0xc0001fe000, 0x427, 0x427}, 0xc0002ae000)
	github.com/dimkr/tootik/inbox/queue.go:116 +0x2fa
github.com/dimkr/tootik/inbox.(*Queue).processActivity(0xc000078fc0, {0x5620b42607e0, 0xc0001da150}, 0xc000184dd0, 0xc00019c680, 0xc0001f22d0, {0xc0001fe000, 0x427, 0x427})
	github.com/dimkr/tootik/inbox/queue.go:322 +0x1025
github.com/dimkr/tootik/inbox.(*Queue).processActivityWithTimeout(0xc000078fc0, {0x5620b4260770?, 0xc00007acd0?}, 0xc00019c680, 0xc0001f22d0, {0xc0001fe000, 0x427, 0x427})
	github.com/dimkr/tootik/inbox/queue.go:469 +0x1ae
github.com/dimkr/tootik/inbox.(*Queue).ProcessBatch.func1({0xc0001fe000, 0x427}, 0xc00019c680)
	github.com/dimkr/tootik/inbox/queue.go:521 +0x1df
github.com/dimkr/tootik/data.OrderedMap[...].Range(0x5620b42634e0, 0xc0001e3d20)
	github.com/dimkr/tootik/data/map.go:57 +0x17f
github.com/dimkr/tootik/inbox.(*Queue).ProcessBatch(0xc000078fc0, {0x5620b4260770, 0xc00007acd0})
	github.com/dimkr/tootik/inbox/queue.go:514 +0x605
github.com/dimkr/tootik/inbox.(*Queue).process(0xc000078fc0, {0x5620b4260770, 0xc00007acd0})
	github.com/dimkr/tootik/inbox/queue.go:537 +0xa8
github.com/dimkr/tootik/inbox.(*Queue).Process(0xc000078fc0, {0x5620b4260770, 0xc00007acd0})
	github.com/dimkr/tootik/inbox/queue.go:566 +0x105
main.main.func4()
	github.com/dimkr/tootik/cmd/tootik/main.go:297 +0x63
created by main.main in goroutine 1
	github.com/dimkr/tootik/cmd/tootik/main.go:296 +0x1a3a

I think maybe a nil check is needed in queue.go:116.

@dimkr
Copy link
Owner

dimkr commented Mar 10, 2024

Thanks for reporting, nice catch

dimkr added a commit that referenced this issue Mar 10, 2024
@dimkr dimkr closed this as completed Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants