Closed Bug 1088848 Opened 5 years ago Closed 5 years ago

DirectShow causes Firefox crashes when compiled with mingw-w64


(Core :: Audio/Video, defect)

31 Branch
Windows 7
Not set





(Reporter: gk, Unassigned)




(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 (for a history of the investigation see:

Steps to reproduce:
1) Take 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 (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:
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.