Last Comment Bug 804511 - RegisterWaitForSingleObject from Chromium ObjectWatcher crashes in Visual Studio
: RegisterWaitForSingleObject from Chromium ObjectWatcher crashes in Visual Studio
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: IPC (show other bugs)
: 14 Branch
: x86_64 Windows 7
: -- normal (vote)
: mozilla19
Assigned To: rmkn85
:
: [PTO to Dec5] Bill McCloskey (:billm)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-23 01:38 PDT by rmkn85
Modified: 2012-11-02 17:23 PDT (History)
3 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
RegisterWaitForSingleObject - don't ExecuteInWaitThread (997 bytes, patch)
2012-10-24 08:19 PDT, rmkn85
bent.mozilla: review+
Details | Diff | Splinter Review

Description rmkn85 2012-10-23 01:38:03 PDT
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4

Steps to reproduce:

I ran a project with embedded XulRunner, using GeckoFX (https://bitbucket.org/geckofx/geckofx-14.0), in Visual Studio 2012, and loaded a website with Adobe Flash to the browser object.


Actual results:

Got the following error message, and page loading hanged, usually crashing my application:

"WARNING: RegisterWaitForSingleObject failed: 6: file e:/builds/moz2_slave/rel-m-rel-xr-w32-bld/build/ipc/chromium/src/base/object_watcher.cc, line 62"

The crash is from here:
http://lxr.mozilla.org/mozilla-central/source/ipc/chromium/src/base/object_watcher.cc#62


Expected results:

It should work without that error message, as it does when running as a standalone application and not from Visual Studio.

The bug is from the code borrowed from Chromium!
See Chromium bug about it:
http://code.google.com/p/chromium/issues/detail?id=131346

Someone reported that:
Exchanging WT_EXECUTEINWAITTHREAD for WT_EXECUTEDEFAULT resolves the issue.
Comment 1 rmkn85 2012-10-24 08:19:19 PDT
Created attachment 674666 [details] [diff] [review]
RegisterWaitForSingleObject - don't ExecuteInWaitThread

http://msdn.microsoft.com/en-us/library/windows/desktop/ms685061(v=vs.85).aspx

"The callback function is invoked by the wait thread itself. This flag should be used only for short tasks or it could affect other wait operations.
Deadlocks can occur if some other thread acquires an exclusive lock and calls the UnregisterWait or UnregisterWaitEx function while the callback function is trying to acquire the same lock."

Sometimes it indeed deadlocks (specifically when debugging from Visual Studio), so this flags should no be used.
Comment 2 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-10-24 10:28:55 PDT
Comment on attachment 674666 [details] [diff] [review]
RegisterWaitForSingleObject - don't ExecuteInWaitThread

This exceeds my win32-fu.
Comment 3 Ben Turner (not reading bugmail, use the needinfo flag!) 2012-10-29 11:32:46 PDT
Comment on attachment 674666 [details] [diff] [review]
RegisterWaitForSingleObject - don't ExecuteInWaitThread

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

After reading the docs I think this is fine.
Comment 4 Josh Matthews [:jdm] (on vacation until Dec 5) 2012-11-02 09:06:02 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/01f5586d2200
Comment 5 Ryan VanderMeulen [:RyanVM] 2012-11-02 17:23:01 PDT
https://hg.mozilla.org/mozilla-central/rev/01f5586d2200

Note You need to log in before you can comment on or make changes to this bug.