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

Issue 2932613002: Fix race causing crash in net::FileNetLogObserver shutdown (Closed)

Created:
3 years, 6 months ago by pauljensen
Modified:
3 years, 6 months ago
Reviewers:
eroman, wangyix1
CC:
chromium-reviews, cbentzel+watch_chromium.org, bnc+watch_chromium.org, eroman, net-reviews_chromium.org, mmenke
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix race causing crash in net::FileNetLogObserver shutdown The class must stop listening for NetLog events before it attempts to shut itself down. Without this fix these two things happen simultaneously: 1. FileNetLogObserver::StopObserving() posts FlushAndStop() to file thread. 2. FileNetLogObserver::OnAddEntry() posts Flush() to file thread. The file thread then runs FlushAndStop() which clears event_files_, then the file thread runs Flush() which indexes into event_files_ and crashes. Also, re-enable test that caught this crash. BUG=729257 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester Review-Url: https://codereview.chromium.org/2932613002 Cr-Commit-Position: refs/heads/master@{#478151} Committed: https://chromium.googlesource.com/chromium/src/+/316c57df2b949823a1fbd31d64150edb3d3af1e0

Patch Set 1 #

Total comments: 2

Patch Set 2 : add tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -9 lines) Patch
M components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java View 2 chunks +3 lines, -6 lines 0 comments Download
M net/log/file_net_log_observer.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M net/log/file_net_log_observer_unittest.cc View 1 1 chunk +69 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (12 generated)
pauljensen
Eric & Yixin, PTAL, thank you! I considered Eric's suggestion to make Flush() a no-op ...
3 years, 6 months ago (2017-06-08 00:39:20 UTC) #3
mmenke
Random driveby suggestion. https://codereview.chromium.org/2932613002/diff/1/net/log/file_net_log_observer.cc File net/log/file_net_log_observer.cc (right): https://codereview.chromium.org/2932613002/diff/1/net/log/file_net_log_observer.cc#newcode267 net/log/file_net_log_observer.cc:267: // StopObserving was not called. Maybe ...
3 years, 6 months ago (2017-06-08 00:45:53 UTC) #7
pauljensen
https://codereview.chromium.org/2932613002/diff/1/net/log/file_net_log_observer.cc File net/log/file_net_log_observer.cc (right): https://codereview.chromium.org/2932613002/diff/1/net/log/file_net_log_observer.cc#newcode267 net/log/file_net_log_observer.cc:267: // StopObserving was not called. On 2017/06/08 00:45:53, mmenke ...
3 years, 6 months ago (2017-06-08 00:48:57 UTC) #8
mmenke
On 2017/06/08 00:48:57, pauljensen wrote: > https://codereview.chromium.org/2932613002/diff/1/net/log/file_net_log_observer.cc > File net/log/file_net_log_observer.cc (right): > > https://codereview.chromium.org/2932613002/diff/1/net/log/file_net_log_observer.cc#newcode267 > ...
3 years, 6 months ago (2017-06-08 00:49:40 UTC) #9
eroman
lgtm, thanks! Can you add a test to net/log/file_net_log_observer_unittest.cc ? I realize there was some ...
3 years, 6 months ago (2017-06-08 00:54:40 UTC) #10
pauljensen
On 2017/06/08 00:54:40, eroman wrote: > Can you add a test to net/log/file_net_log_observer_unittest.cc ? Done, ...
3 years, 6 months ago (2017-06-08 11:48:58 UTC) #13
eroman
lgtm, thanks for the tests!
3 years, 6 months ago (2017-06-08 21:50:53 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2932613002/20001
3 years, 6 months ago (2017-06-08 22:34:20 UTC) #18
commit-bot: I haz the power
3 years, 6 months ago (2017-06-09 01:13:09 UTC) #21
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/316c57df2b949823a1fbd31d6415...

Powered by Google App Engine
This is Rietveld 408576698