Closed Bug 1115438 Opened 10 years ago Closed 9 years ago

Toolhelp32 snapshot janking plugin module init

Categories

(Core Graveyard :: Plug-ins, defect)

x86
Windows 7
defect
Not set
normal

Tracking

(firefox39 fixed)

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: bugzilla, Assigned: bugzilla)

References

Details

Attachments

(1 file, 2 obsolete files)

On my 2012-vintage ThinkPad this causes about 35-40ms of jank. Can we move the call to CreateToolhelp32Shapsot off the main thread? I know that this would race with the plugin container but I don't think we do anything to prevent that right now anyway.
dmajor, bsmedberg: Do you have any comments or concerns re: this bug?
Flags: needinfo?(dmajor)
Flags: needinfo?(benjamin)
I notice that we leak the snapshot handle :) Other than that I'm not super familiar with this code. Bsmedberg would know more about how long we can safely delay this stuff.

Kinda sad that we have to enumerate all system processes in order to look up some children. I don't know of a better way though.
Flags: needinfo?(dmajor)
(In reply to David Major [:dmajor] (UTC+13) from comment #2)
> I notice that we leak the snapshot handle :)
Filed bug 1118031. Nice catch!

> Kinda sad that we have to enumerate all system processes in order to look up
> some children. I don't know of a better way though.
Me neither. I went digging to see if there were other APIs that could narrow the scope but from what I could see the alternatives weren't any better. :(
This is the crash injector code? I don't think it would be a big deal to make that asynchronous, as long as `InjectCrashReporterIntoProcess` happens on the main thread.
Flags: needinfo?(benjamin)
Depends on: 1119060
Assignee: nobody → aklotz
Mentor: aklotz
Status: NEW → ASSIGNED
Wrote a patch but I need to retest with my fix for bug 1119060.
Comment on attachment 8546278 [details] [diff] [review]
Move toolhelp32 snapshot off the main thread

Georg hasn't been able to get to this and is now on vacation.
Attachment #8546278 - Flags: review?(gfritzsche) → review?(jmathies)
Comment on attachment 8546278 [details] [diff] [review]
Move toolhelp32 snapshot off the main thread

Review of attachment 8546278 [details] [diff] [review]:
-----------------------------------------------------------------

Generally looks good. I'm a little wary of the use of QueueUserWorkItem for the first time, but I imagine anything negative from that will have ample time to show up in testing.

Just out of curiosity, have you tested any of this flash process injection code with e10s recently? We have bug 1096080 filed indicating it doesn't work but I haven't tested that in a while.

::: dom/plugins/ipc/PluginModuleParent.cpp
@@ +106,5 @@
>      return PPluginModule::Bridge(aContentParent, chromeParent);
>  }
>  
>  /**
> + * Use for executing CreateToolhelp32Snapshot off main thread (bug 1115438)

nit - no need for bug number comments about resolved bugs. blame takes care of that.
Attachment #8546278 - Flags: review?(jmathies) → review+
(In reply to Jim Mathies [:jimm] from comment #8)
> Comment on attachment 8546278 [details] [diff] [review]
> Move toolhelp32 snapshot off the main thread
> 
> Review of attachment 8546278 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Generally looks good. I'm a little wary of the use of QueueUserWorkItem for
> the first time, but I imagine anything negative from that will have ample
> time to show up in testing.

I've used it extensively in another code base so I'm not too concerned.

> 
> Just out of curiosity, have you tested any of this flash process injection
> code with e10s recently? We have bug 1096080 filed indicating it doesn't
> work but I haven't tested that in a while.

No idea. :-/

> 
> ::: dom/plugins/ipc/PluginModuleParent.cpp
> @@ +106,5 @@
> >      return PPluginModule::Bridge(aContentParent, chromeParent);
> >  }
> >  
> >  /**
> > + * Use for executing CreateToolhelp32Snapshot off main thread (bug 1115438)
> 
> nit - no need for bug number comments about resolved bugs. blame takes care
> of that.

Will do.
Addressed comment and fixed merge conflicts. Carrying forward r+.

https://hg.mozilla.org/integration/mozilla-inbound/rev/2812517c3814
Attachment #8546278 - Attachment is obsolete: true
Attachment #8573678 - Flags: review+
> > Just out of curiosity, have you tested any of this flash process injection
> > code with e10s recently? We have bug 1096080 filed indicating it doesn't
> > work but I haven't tested that in a while.
> 
> No idea. :-/

Resolved wfm the other day, appears to be working.
Missed an #ifdef for MOZ_CRASHREPORTER_INJECTOR, so only Win32 built.

https://hg.mozilla.org/integration/mozilla-inbound/rev/717f0399930e
Attachment #8573678 - Attachment is obsolete: true
Attachment #8574149 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/717f0399930e
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Depends on: 1141093
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: