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

Issue 460144: Fix leak of ShutdownDetector. (Closed)

Created:
11 years ago by willchan no longer on Chromium
Modified:
9 years, 7 months ago
Reviewers:
Mark Mentovai
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Fix leak of ShutdownDetector. For some reason I thought that non-joinable threads would always delete their delegates. I was wrong. BUG=http://crbug.com/29675 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=34110

Patch Set 1 #

Patch Set 2 : Remove suppression. #

Patch Set 3 : Handle clean shutdowns (not SIG* initiatied) properly. #

Patch Set 4 : Reverse condition for readability. Fix a comment. #

Total comments: 2

Patch Set 5 : Addressed Mark's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -38 lines) Patch
M chrome/browser/browser_main.cc View 1 2 3 4 5 chunks +48 lines, -30 lines 0 comments Download
M tools/valgrind/memcheck/suppressions.txt View 1 chunk +0 lines, -8 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
willchan no longer on Chromium
The linux_valgrind bot is being stupid, it keeps timing out, but I'm pretty confident this ...
11 years ago (2009-12-08 20:52:00 UTC) #1
Mark Mentovai
I don't think this is right. This only deletes the thread object if we take ...
11 years ago (2009-12-08 20:56:03 UTC) #2
Mark Mentovai
Suggest: Close the pipe in BrowserMain when things are shutting down. Pick the close (zero-length ...
11 years ago (2009-12-08 20:57:30 UTC) #3
willchan no longer on Chromium
Hm, I think you're pointing out a separate leak. I'll implement your suggestion too, but ...
11 years ago (2009-12-08 21:04:05 UTC) #4
Mark Mentovai
William Chan (陈智昌) wrote: > Hm, I think you're pointing out a separate leak. I'll ...
11 years ago (2009-12-08 21:06:03 UTC) #5
Mark Mentovai
I wrote: > The thread when it exits? I don't recall what the internals there ...
11 years ago (2009-12-08 21:07:37 UTC) #6
willchan no longer on Chromium
I think I've fixed the normal shutdown path now. Let me know if this seems ...
11 years ago (2009-12-08 22:17:06 UTC) #7
Mark Mentovai
11 years ago (2009-12-08 22:21:37 UTC) #8
LG with three changes.

http://codereview.chromium.org/460144/diff/3004/3005
File chrome/browser/browser_main.cc (right):

http://codereview.chromium.org/460144/diff/3004/3005#newcode174
chrome/browser/browser_main.cc:174: int g_shutdown_pipe_read_fd = -1;
I realized that this variable is unnecessary.  We should get rid of it.  It can
be closed by the thread but still wind up holding a value other than -1. 
Maintaining it as a global doesn't seem useful.

http://codereview.chromium.org/460144/diff/3004/3005#newcode982
chrome/browser/browser_main.cc:982: ret = close(g_shutdown_pipe_write_fd);
HANDLE_EINTR.

I'd also set g_shutdown_pipe_write_fd to -1 here to avoid anyone trying to use
it.

Powered by Google App Engine
This is Rietveld 408576698