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

nil dereference in CanSpeak #2063

Closed
slingamn opened this issue May 22, 2023 · 3 comments · Fixed by #2064
Closed

nil dereference in CanSpeak #2063

slingamn opened this issue May 22, 2023 · 3 comments · Fixed by #2064
Labels
Milestone

Comments

@slingamn
Copy link
Member

eeec481

May 21 22:20:39 vps-44cdd8fc oragono[2007632]: 2023-05-21T22:20:39.716Z : error : internal   : Client caused panic: runtime error: invalid memory address or nil pointer dereference
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: goroutine 4004014 [running]:
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: runtime/debug.Stack()
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /usr/local/go/src/runtime/debug/stack.go:24 +0x65
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: github.com/ergochat/ergo/irc.(*Client).run.func1()
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/client.go:614 +0x5d
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: panic({0x8da720, 0xcff6e0})
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /usr/local/go/src/runtime/panic.go:884 +0x213
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: github.com/ergochat/ergo/irc.(*Channel).CanSpeak(0xc0000d3c00, 0xc000335c00)
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/channel.go:1231 +0xb4
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: github.com/ergochat/ergo/irc.(*Channel).SendSplitMessage(0xc0000d3c00, {0xc000436e80, 0x6}, 0x0, 0x0, 0xc000335c00, {{0xc000436e90, 0x21}, {0xc000284800, 0x1a}, ...}, ...)
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/channel.go:1284 +0xf0
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: github.com/ergochat/ergo/irc.dispatchMessageToTarget(0xc000335c00, 0x0, 0x2, {0xc000436e80, 0x6}, {0xc000436e87?, 0x4b4dbc?}, {{0xc000436e90, 0x21}, {0xc000284800, ...}, ...}, ...)
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/handlers.go:2266 +0x102a
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: github.com/ergochat/ergo/irc.messageHandler(0xc00009f680, 0x5aee29?, {{0x0, 0x0}, {0xc000436e80, 0x6}, {0xc0003dd900, 0x2, 0x2}, 0x0, ...}, ...)
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/handlers.go:2245 +0x74e
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: github.com/ergochat/ergo/irc.(*Command).Run.func1(0xc000166800, 0xc000335c00, 0x0?, 0xc00009f680, {{0x0, 0x0}, {0xc000436e80, 0x6}, {0xc0003dd900, 0x2, ...}, ...}, ...)
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/commands.go:47 +0x287
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: github.com/ergochat/ergo/irc.(*Command).Run(0xc000436e80?, 0xc0002f9c58?, 0xc000335c00, 0xc000251080, {{0x0, 0x0}, {0xc000436e80, 0x6}, {0xc0003dd900, 0x2, ...}, ...})
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/commands.go:48 +0x178
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: github.com/ergochat/ergo/irc.(*Client).run(0xc000335c00, 0xc000251080)
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/client.go:714 +0x6eb
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: github.com/ergochat/ergo/irc.(*Server).RunClient(0xc00009f680, {0xa23690, 0xc0004424e0})
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/client.go:388 +0xc65
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: created by github.com/ergochat/ergo/irc.(*NetListener).serve
May 21 22:20:39 vps-44cdd8fc oragono[2007632]:         /home/oragono/src/ergo/irc/listeners.go:99 +0x2ea
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: 2023-05-21T22:20:39.717Z : error : internal   : Disconnecting client and attempting to recover
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: 2023-05-21T22:20:39.717Z : info  : connect-ip : disconnecting session of grzegorz from [redacted]
May 21 22:20:39 vps-44cdd8fc oragono[2007632]: 2023-05-21T22:20:39.717Z : info  : quit       : grzegorz is no longer on the server
@slingamn slingamn added the bug label May 22, 2023
@slingamn slingamn added this to the v2.12.0 milestone May 22, 2023
@slingamn
Copy link
Member Author

This may go back to 4a48e52. We should get an irctest for -n channels...

@slingamn
Copy link
Member Author

Bisect attributes this to eeec481 / #2058

slingamn added a commit to slingamn/ergo that referenced this issue May 22, 2023
In ergochat#2058 we introduced two bugs:

* A nil dereference when an outside user attempts to speak
* Ordinary copy of a modes.ModeSet (which should only be accessed via atomics)

This fixes both issues.
@slingamn slingamn linked a pull request May 22, 2023 that will close this issue
slingamn added a commit to slingamn/ergo that referenced this issue May 23, 2023
slingamn added a commit that referenced this issue May 23, 2023
@slingamn
Copy link
Member Author

This does not get a changelog entry, since it was never in a release version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant