Fixing a crash in IqSender
We are seeing a crash in M65 where the Heartbeat sender attempts to resend a heartbeat after a timeout and the iq_sender_ member is null. The SendHeartbeat call is being triggered via a callback and that only occurs when the previous heartbeat times out. This is odd because the code which resets the iq_sender_ member also stops the timer. After some digging, I *think* what is happening is that timer_.Stop() does not clear any pending tasks if they have already been posted. In this case the timer is stopped but the posted task runs shortly afterwards with iq_sender_ being null and it crashes. I only have access to the minidump for the crash so this is the most likely scenario I can think of. To address this, I have done two things: - I've updated the Stop calls to use AbandonAndStop (this will clear any posted tasks) - I've added a null check for iq_sender_ The second step may not be required but I don't want to find out in M67 that the Abandon and stop change was not enough : P Note: I also cleaned up some old coding conventions around callback use in the file. If they are too distracting I can make a follow-up CL. BUG=812261 Change-Id: I742d6ce27bc4a83ea42520c5cd8a14e911fc90e2 Reviewed-on: https://chromium-review.googlesource.com/924590Reviewed-by:Jamie Walch <jamiewalch@chromium.org> Commit-Queue: Joe Downing <joedow@chromium.org> Cr-Commit-Position: refs/heads/master@{#537517}
Showing
Please register or sign in to comment