Add a bool on MasterClient to describe if the item is being deleted, and use it on isAddressSame. (#3456)

#76 Open
Repository
Pol_M
Branch
default
Repository
Doomseeker
Branch
default

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update default
hg pull -r e0ab61a87437 https://bitbucket.org/Pol_M/doomseeker
hg merge e0ab61a87437
hg commit -m 'Merged in Pol_M/doomseeker (pull request #76)'
Author
  1. Pol Marcet
Reviewers
Description

This prevents segfaults on the edge case of the ticket. This does not solve the ticket, it just prevents one of the two causes for a segfault in said situation. There was a 50% chance of either of the two happening (roughly estimated), so now it’s less likely that a segfault happens.

Comments (2)

  1. Zalewa

    This seems to be a “use after free” scenario which your flag possibly fixes by accident only. When the object is deleted you can technically still read from its old memory address and it has a very high chance of evaluating to boolean true, however sometimes it won’t.

    I'm not sure why use-after-free could be happening here, however it appears that Refresher::d->flushPendingDatagramsTimer still fires after the MasterManager is deleted. You could see if that’s the case and see what can be done about that.

    1. Pol Marcet author

      I’ll look into it on 5 days. This week I have final exams, and these count ~64% of the final mark, so I’m gonna be kinda occupied.