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

Crashfix: PART #1709

Merged
merged 3 commits into from
Dec 1, 2024
Merged

Crashfix: PART #1709

merged 3 commits into from
Dec 1, 2024

Conversation

michaelortmann
Copy link
Member

Found by: BigBadWouf
Patch by: michaelortmann
Fixes: #1708

One-line summary:
Crashfix gotpart(): If ismember() returns 0, fallback to get_user_by_host()

Additional description (if needed):
ismember() can returns 0 while the bot has not (yet) synched the channel, like when it just joined
This bug affects eggdrop version 1.10.0, older versions are not affected

Test cases demonstrating functionality (if applicable):
Fixes the following crash:

[22:08:48] [@] :testuser!~michael@localhost PART #test666
[22:08:48] * Please report problem to https://github.com/eggheads/eggdrop/issues
[22:08:48] * Check doc/BUG-REPORT on how to do so.
[22:08:48] * Last bind (may not be related): evnt:init_server
[22:08:48] * Wrote DEBUG
[22:08:48] * SEGMENT VIOLATION -- CRASHING!
Segmentation fault (core dumped)

@BigBadWouf
Copy link

BigBadWouf commented Oct 28, 2024

Hi,

Thank you, this perfectly fix the /part crash. However it's seem produce a lot call to killmember(). Don't know if related

@michaelortmann
Copy link
Member Author

Good find. The killmember() was already called before the regression.

So now, additionally this PR avoids calling killmember() if we just checked that the parting entity is not ismember()

ismember() already checks the very channel memberlist that killmember() would search through again.

Copy link
Member

@thommey thommey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix, just add that TODO comment please whenever we use straight get_user_from_host because we want to look at those instances again in the future to work with a possible account-tag we might've gotten (needs to change raw bind to rawt etc.), not part of this PR, just as a comment, we have similar ones in other places already.

src/mod/irc.mod/chan.c Show resolved Hide resolved
@vanosg vanosg merged commit ba2052f into eggheads:develop Dec 1, 2024
24 checks passed
@vanosg vanosg added this to the v1.10.1 milestone Dec 1, 2024
@michaelortmann michaelortmann deleted the gotpart branch December 2, 2024 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SEGMENT VIOLATION on user /part
4 participants