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

Issue 10949027: Close leaking FDs. (Closed)

Created:
8 years, 3 months ago by Jay Civelli
Modified:
4 years, 1 month ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, acleung1
Visibility:
Public.

Description

Close leaking FDs. When starting a SandboxedProcess the resource file descriptors were leaked in the browser process, eventually causing crashers. BUG=None TEST=When using the Android content shell for a long time, it should not crash. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=158456

Patch Set 1 #

Total comments: 3

Patch Set 2 : Change the ContentBrowserClient API and more #

Patch Set 3 : Fixed comments. #

Total comments: 4

Patch Set 4 : Implemented the Linux part. #

Patch Set 5 : Updated gypi file #

Total comments: 2

Patch Set 6 : Addressed piman comment. #

Total comments: 10

Patch Set 7 : Addressed Yaron's comments #

Total comments: 3

Patch Set 8 : Addressed last comments and synced. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+213 lines, -140 lines) Patch
M chrome/browser/chrome_content_browser_client.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -3 lines 0 comments Download
M content/app/android/sandboxed_process_service.cc View 1 2 chunks +17 lines, -23 lines 0 comments Download
M content/browser/android/sandboxed_process_launcher.h View 1 2 chunks +2 lines, -3 lines 0 comments Download
M content/browser/android/sandboxed_process_launcher.cc View 1 2 3 4 5 6 7 3 chunks +33 lines, -19 lines 0 comments Download
M content/browser/child_process_launcher.cc View 1 2 3 4 5 2 chunks +18 lines, -15 lines 0 comments Download
M content/browser/zygote_host/zygote_host_impl_linux.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/zygote_host/zygote_host_impl_linux.cc View 1 2 3 4 5 6 7 3 chunks +15 lines, -4 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/app/SandboxedProcessService.java View 1 5 chunks +18 lines, -23 lines 0 comments Download
A content/public/android/java/src/org/chromium/content/browser/FileDescriptorInfo.java View 1 2 3 4 5 6 1 chunk +20 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/SandboxedProcessConnection.java View 1 2 3 4 5 6 4 chunks +30 lines, -37 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/SandboxedProcessLauncher.java View 1 2 3 4 5 6 2 chunks +14 lines, -5 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
A content/public/browser/file_descriptor_info.h View 1 2 1 chunk +29 lines, -0 lines 0 comments Download
M content/shell/shell_content_browser_client.h View 1 1 chunk +1 line, -1 line 0 comments Download
M content/shell/shell_content_browser_client.cc View 1 2 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
Jay Civelli
https://codereview.chromium.org/10949027/diff/1/content/browser/child_process_launcher.cc File content/browser/child_process_launcher.cc (left): https://codereview.chromium.org/10949027/diff/1/content/browser/child_process_launcher.cc#oldcode171 content/browser/child_process_launcher.cc:171: kPrimaryIPCChannel, ipcfd)); Not sure why this was done. The ...
8 years, 3 months ago (2012-09-19 22:58:57 UTC) #1
Yaron
https://codereview.chromium.org/10949027/diff/1/content/browser/child_process_launcher.cc File content/browser/child_process_launcher.cc (left): https://codereview.chromium.org/10949027/diff/1/content/browser/child_process_launcher.cc#oldcode171 content/browser/child_process_launcher.cc:171: kPrimaryIPCChannel, ipcfd)); On 2012/09/19 22:58:57, Jay Civelli wrote: > ...
8 years, 3 months ago (2012-09-20 00:01:54 UTC) #2
jam
can you send this to an owner in content who's more familiar with posix? i.e. ...
8 years, 3 months ago (2012-09-20 06:50:58 UTC) #3
piman
https://codereview.chromium.org/10949027/diff/1/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/10949027/diff/1/chrome/browser/chrome_content_browser_client.cc#newcode1673 chrome/browser/chrome_content_browser_client.cc:1673: kCrashDumpSignal, dup(crash_signal_fd))); I don't get it. You're changing the ...
8 years, 3 months ago (2012-09-20 07:03:03 UTC) #4
Jay Civelli
On 2012/09/20 07:03:03, piman wrote: > https://codereview.chromium.org/10949027/diff/1/chrome/browser/chrome_content_browser_client.cc > File chrome/browser/chrome_content_browser_client.cc (right): > > https://codereview.chromium.org/10949027/diff/1/chrome/browser/chrome_content_browser_client.cc#newcode1673 > ...
8 years, 3 months ago (2012-09-20 17:59:26 UTC) #5
piman
On Thu, Sep 20, 2012 at 10:59 AM, <jcivelli@chromium.org> wrote: > On 2012/09/20 07:03:03, piman ...
8 years, 3 months ago (2012-09-20 18:07:25 UTC) #6
Jay Civelli
After talking with jam, I changed the ContentBrowserClient method so it uses a FileDescriptor as ...
8 years, 3 months ago (2012-09-21 01:42:01 UTC) #7
jam
new file lgtm, i defer to piman for the actual review https://codereview.chromium.org/10949027/diff/6002/content/public/browser/file_descriptor_info.h File content/public/browser/file_descriptor_info.h (right): ...
8 years, 3 months ago (2012-09-21 01:46:33 UTC) #8
piman
https://codereview.chromium.org/10949027/diff/6002/content/browser/child_process_launcher.cc File content/browser/child_process_launcher.cc (right): https://codereview.chromium.org/10949027/diff/6002/content/browser/child_process_launcher.cc#newcode194 content/browser/child_process_launcher.cc:194: GetAdditionalMappedFilesForChildProcess(*cmd_line, &files_to_register); Shouldn't this call site here change too?
8 years, 3 months ago (2012-09-21 02:31:02 UTC) #9
Jay Civelli
Adding Markus for the zygote_host part. Thanks. http://codereview.chromium.org/10949027/diff/6002/content/browser/child_process_launcher.cc File content/browser/child_process_launcher.cc (right): http://codereview.chromium.org/10949027/diff/6002/content/browser/child_process_launcher.cc#newcode194 content/browser/child_process_launcher.cc:194: GetAdditionalMappedFilesForChildProcess(*cmd_line, &files_to_register); ...
8 years, 3 months ago (2012-09-21 22:12:06 UTC) #10
piman
http://codereview.chromium.org/10949027/diff/10015/content/browser/child_process_launcher.cc File content/browser/child_process_launcher.cc (right): http://codereview.chromium.org/10949027/diff/10015/content/browser/child_process_launcher.cc#newcode199 content/browser/child_process_launcher.cc:199: } else So, in the zygote case, we'll close ...
8 years, 3 months ago (2012-09-21 22:30:48 UTC) #11
Jay Civelli
https://codereview.chromium.org/10949027/diff/10015/content/browser/child_process_launcher.cc File content/browser/child_process_launcher.cc (right): https://codereview.chromium.org/10949027/diff/10015/content/browser/child_process_launcher.cc#newcode199 content/browser/child_process_launcher.cc:199: } else On 2012/09/21 22:30:48, piman wrote: > So, ...
8 years, 3 months ago (2012-09-21 22:48:34 UTC) #12
piman
lgtm
8 years, 3 months ago (2012-09-22 01:07:27 UTC) #13
Yaron
+acleung as FYI as this conflicts with http://codereview.chromium.org/10876056/ https://codereview.chromium.org/10949027/diff/7007/content/browser/android/sandboxed_process_launcher.cc File content/browser/android/sandboxed_process_launcher.cc (right): https://codereview.chromium.org/10949027/diff/7007/content/browser/android/sandboxed_process_launcher.cc#newcode47 content/browser/android/sandboxed_process_launcher.cc:47: size_t ...
8 years, 2 months ago (2012-09-24 18:53:14 UTC) #14
Jay Civelli
https://codereview.chromium.org/10949027/diff/7007/content/browser/android/sandboxed_process_launcher.cc File content/browser/android/sandboxed_process_launcher.cc (right): https://codereview.chromium.org/10949027/diff/7007/content/browser/android/sandboxed_process_launcher.cc#newcode47 content/browser/android/sandboxed_process_launcher.cc:47: size_t file_count = files_to_register.size(); On 2012/09/24 18:53:14, Yaron wrote: ...
8 years, 2 months ago (2012-09-24 20:59:59 UTC) #15
Markus (顧孟勤)
lgtm LGTM (for zygote_host_impl.*) http://codereview.chromium.org/10949027/diff/19001/content/browser/zygote_host/zygote_host_impl_linux.cc File content/browser/zygote_host/zygote_host_impl_linux.cc (right): http://codereview.chromium.org/10949027/diff/19001/content/browser/zygote_host/zygote_host_impl_linux.cc#newcode258 content/browser/zygote_host/zygote_host_impl_linux.cc:258: // link_ptr. s/link/linked/ http://codereview.chromium.org/10949027/diff/19001/content/browser/zygote_host/zygote_host_impl_linux.cc#newcode267 content/browser/zygote_host/zygote_host_impl_linux.cc:267: ...
8 years, 2 months ago (2012-09-24 21:17:34 UTC) #16
Yaron
lgtm http://codereview.chromium.org/10949027/diff/19001/content/browser/android/sandboxed_process_launcher.cc File content/browser/android/sandboxed_process_launcher.cc (right): http://codereview.chromium.org/10949027/diff/19001/content/browser/android/sandboxed_process_launcher.cc#newcode81 content/browser/android/sandboxed_process_launcher.cc:81: base::android::CheckException(env); As this is a jni-generator function, you ...
8 years, 2 months ago (2012-09-24 21:27:02 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jcivelli@chromium.org/10949027/30001
8 years, 2 months ago (2012-09-24 22:01:15 UTC) #18
commit-bot: I haz the power
Change committed as 158456
8 years, 2 months ago (2012-09-25 00:20:14 UTC) #19
tonyg
On 2012/09/25 00:20:14, I haz the power (commit-bot) wrote: > Change committed as 158456 After ...
8 years, 2 months ago (2012-09-28 16:22:16 UTC) #20
Jay Civelli
Sorry for the breakage, known problem. Fix coming very soon (later on today). Jay On ...
8 years, 2 months ago (2012-09-28 16:57:22 UTC) #21
Jay Civelli
8 years, 2 months ago (2012-09-28 16:59:56 UTC) #22
And BTW, this should work in Debug mode (the bug is caused by a DCHECK
containing actual code that ends up not being run).

Jay


On Fri, Sep 28, 2012 at 9:57 AM, Jay Civelli <jcivelli@chromium.org> wrote:

> Sorry for the breakage, known problem.
> Fix coming very soon (later on today).
>
> Jay
>
>
> On Fri, Sep 28, 2012 at 9:22 AM, <tonyg@chromium.org> wrote:
>
>> On 2012/09/25 00:20:14, I haz the power (commit-bot) wrote:
>>
>>> Change committed as 158456
>>>
>>
>> After this patch, every time I start the content shell I get the below
>> crash
>> stack. Rolling back the patch fixes it.
>>
>> E/AndroidRuntime( 2784): FATAL EXCEPTION: main
>> E/AndroidRuntime( 2784): java.lang.RuntimeException: Unknown binder error
>> code.
>> 0xfffffff7
>> E/AndroidRuntime( 2784):        at android.os.Parcel.**
>> nativeWriteFileDescriptor(**Native
>> Method)
>> E/AndroidRuntime( 2784):        at
>> android.os.Parcel.**writeFileDescriptor(Parcel.**java:552)
>> E/AndroidRuntime( 2784):        at
>> android.os.**ParcelFileDescriptor.**writeToParcel(**
>> ParcelFileDescriptor.java:412)
>> E/AndroidRuntime( 2784):        at android.os.Parcel.**
>> writeParcelable(Parcel.java:**1254)
>> E/AndroidRuntime( 2784):        at android.os.Parcel.writeValue(**
>> Parcel.java:1173)
>> E/AndroidRuntime( 2784):        at android.os.Parcel.**
>> writeMapInternal(Parcel.java:**591)
>> E/AndroidRuntime( 2784):        at android.os.Bundle.**
>> writeToParcel(Bundle.java:**1619)
>> E/AndroidRuntime( 2784):        at
>> org.chromium.content.common.**ISandboxedProcessService$Stub$**
>> Proxy.setupConnection(**ISandboxedProcessService.java:**111)
>> E/AndroidRuntime( 2784):        at
>> org.chromium.content.browser.**SandboxedProcessConnection.**
>> doConnectionSetup(**SandboxedProcessConnection.**java:235)
>> E/AndroidRuntime( 2784):        at
>> org.chromium.content.browser.**SandboxedProcessConnection.**
>> onServiceConnected(**SandboxedProcessConnection.**java:183)
>> E/AndroidRuntime( 2784):        at
>> android.app.LoadedApk$**ServiceDispatcher.doConnected(**
>> LoadedApk.java:1097)
>> E/AndroidRuntime( 2784):        at
>> android.app.LoadedApk$**ServiceDispatcher$**RunConnection.run(LoadedApk.*
>> *java:1114)
>> E/AndroidRuntime( 2784):        at android.os.Handler.**
>> handleCallback(Handler.java:**615)
>> E/AndroidRuntime( 2784):        at android.os.Handler.**
>> dispatchMessage(Handler.java:**92)
>> E/AndroidRuntime( 2784):        at android.os.Looper.loop(Looper.**
>> java:142)
>> E/AndroidRuntime( 2784):        at
>> android.app.ActivityThread.**main(ActivityThread.java:4573)
>> E/AndroidRuntime( 2784):        at java.lang.reflect.Method.**
>> invokeNative(Native
>> Method)
>> E/AndroidRuntime( 2784):        at java.lang.reflect.Method.**
>> invoke(Method.java:511)
>> E/AndroidRuntime( 2784):        at
>> com.android.internal.os.**ZygoteInit$**MethodAndArgsCaller.run(**
>> ZygoteInit.java:786)
>> E/AndroidRuntime( 2784):        at
>> com.android.internal.os.**ZygoteInit.main(ZygoteInit.**java:553)
>> E/AndroidRuntime( 2784):        at dalvik.system.NativeStart.**main(Native
>> Method)
>>
>>
>>
>>
https://chromiumcodereview.**appspot.com/10949027/<https://chromiumcodereview...
>>
>
>

Powered by Google App Engine
This is Rietveld 408576698