Closed Bug 1088848 Opened 5 years ago Closed 5 years ago

DirectShow causes Firefox crashes when compiled with mingw-w64

Categories

(Core :: Audio/Video, defect)

31 Branch
x86
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: gk, Unassigned)

References

Details

Attachments

(2 files)

Compiling Firefox with mingw-w64 causes crashes on sites if DirectShow is enabled. Bisecting the issue shows that this happens since the DirectShow code landed in https://hg.mozilla.org/mozilla-central/rev/e7fef018f421. (for a history of the investigation see: https://bugs.torproject.org/13443)

Steps to reproduce:
1) Take https://developer.mozilla.org/en-US/docs/Cross_Compile_Mozilla_for_Mingw32 and get a cross-compiler (I used GCC 4.9.1, Binutils 2.24 and mingw-w64 commit 469ed5d227202b373409c8a3b4c1358be39b9983)

2) Checkout rev 142393 of mozilla-central
3) Take a .mozconfig similar to the one mentioned in the link above (I WebGL disabled, too)
4) Convince the code to avoid building ICU, fix bug 1059725 and compile Firefox with your cross-compiler
5) Take, e.g. a Windows 7 machine and try to open https://tweetdeck.twitter.com (there are numerous other URLs that crash the browser as well; see the bug in the Tor Project bugtracker for more examples.)
6) Firefox crashes (this does not happen with rev 142391) and this can be avoided by setting "media.directshow.enabled" to "false"

Attached is the output WinDbg gives me when compiling ESR 31 with debug symbols enabled.
Attached patch mingw-w64 fixSplinter Review
I gebugged it and it is a problem of _com_ptr_t implementation in mingw-w64. Templates are wrongly used, which makes the code use wrong version of functions, leading to infinite recusions. The attached (mingw-w64) patch fixes the problem for me. I will upstream it, but I'd like to review the whole _com_ptr_t first. It seems like there may be more similar problems.
Patch committed to mingw-w64:

http://sourceforge.net/p/mingw-w64/mingw-w64/ci/e712bb8b106d059914388e6ccd93c584a6416082/
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.