Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(840)

Issue 2168283002: Fix a crash in the event tracing shutdown path (Closed)

Created:
4 years, 5 months ago by skvlad
Modified:
4 years, 2 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Fix a crash in the event tracing shutdown path This CL fixes a crash that could happen when JSON event tracing is shutting down. The cause of the crash was the fact that the logger thread function was returning 'true', causing the platform thread to run it repeatedly even though that wasn't the intention. Usually the EventLogger::Stop() function would set the event requesting the logging thread to clean up and close the file, and then immediately call PlatformThread::Stop() which would stop the outer loop. The Log() function would only run once and everything behaves as expected. However, if a context switch happens between the shutdown_event_.Set() and logging_thread_.Stop() calls in EventLogger::Stop(), the logger thread function would close the file and exit the Log() method, while PlatformThread will rerun it again. So the Log() function runs twice, and the second time output_file_ is NULL which either causes the DCHECK to fail (in debug builds) or the fprintf() to crash with SIGSEGV (in release builds). The fix simply changes the return value of the thread function to false so it never runs twice. R=pthatcher@webrtc.org Committed: https://crrev.com/843b6f503f151753842d447b2d2c33ca548e01aa Cr-Commit-Position: refs/heads/master@{#13510}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -1 line) Patch
M webrtc/base/event_tracer.cc View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 12 (6 generated)
skvlad
4 years, 5 months ago (2016-07-22 00:09:31 UTC) #2
pthatcher1
lgtm
4 years, 5 months ago (2016-07-22 08:41:42 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2168283002/1
4 years, 5 months ago (2016-07-23 03:35:14 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: linux_libfuzzer_rel on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_libfuzzer_rel/builds/4038)
4 years, 5 months ago (2016-07-23 03:45:45 UTC) #7
skvlad
Committed patchset #1 (id:1) manually as 843b6f503f151753842d447b2d2c33ca548e01aa (presubmit successful).
4 years, 5 months ago (2016-07-23 04:45:52 UTC) #9
henrika_webrtc
4 years, 5 months ago (2016-07-25 11:46:48 UTC) #11
Message was sent while issue was closed.
Don't know the detail well here. LGTM.

Powered by Google App Engine
This is Rietveld 408576698