Closed Bug 658359 Opened 13 years ago Closed 13 years ago

Register .frag and .vert extensions as text/plain to prevent crashing due to buggy plugins in WebGL mochitest

Categories

(Testing :: Mochitest, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bjacob, Assigned: bjacob)

Details

Attachments

(1 file)

(All the analysis here is thanks to Ehsan)

Running the WebGL mochitest, I ran into xpcshell crashes like that:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()

(gdb) bt
#0  0x0000000000000000 in ?? ()                                                                    
#1  0x00007fc6bf1acd70 in g_content_type_get_description () from /usr/lib/libgio-2.0.so.0          
#2  0x00007fc6b15bab33 in NP_GetMIMEDescription ()
   from /usr/lib/mozilla/plugins/libtotem-cone-plugin.so
#3  0x00007fc6c615319f in nsPluginFile::GetPluginInfo (this=0x7fff049aabe0, info=..., 
    outLibrary=0x7fff049aabd8)
    at /home/bjacob/mozilla-central/dom/plugins/base/nsPluginsDirUnix.cpp:361
#4  0x00007fc6c613ef10 in nsPluginHost::ScanPluginsDirectory (this=0x7fc6b4dedc50, 
    pluginsDir=0x7fc6b4dedda0, aCreatePluginList=1, aPluginsChanged=0x7fff049aad8c)
    at /home/bjacob/mozilla-central/dom/plugins/base/nsPluginHost.cpp:2208
#5  0x00007fc6c613f72c in nsPluginHost::ScanPluginsDirectoryList (this=0x7fc6b4dedc50, 
    dirEnum=0x7fc6b4dcf520, aCreatePluginList=1, aPluginsChanged=0x7fff049aaecc)
    at /home/bjacob/mozilla-central/dom/plugins/base/nsPluginHost.cpp:2332
#6  0x00007fc6c613fa7b in nsPluginHost::FindPlugins (this=0x7fc6b4dedc50, aCreatePluginList=1, 
    aPluginsChanged=0x7fff049aaf5c)
    at /home/bjacob/mozilla-central/dom/plugins/base/nsPluginHost.cpp:2417
#7  0x00007fc6c613f83c in nsPluginHost::LoadPlugins (this=0x7fc6b4dedc50)
    at /home/bjacob/mozilla-central/dom/plugins/base/nsPluginHost.cpp:2355
#8  0x00007fc6c613d138 in nsPluginHost::FindPluginEnabledForExtension (this=0x7fc6b4dedc50, 
    aExtension=0x7fff049ab250 "vert", aMimeType=@0x7fff049ab0c8)
    at /home/bjacob/mozilla-central/dom/plugins/base/nsPluginHost.cpp:1669
#9  0x00007fc6c613c665 in nsPluginHost::IsPluginEnabledForExtension (this=0x7fc6b4dedc50, 
    aExtension=0x7fff049ab250 "vert", aMimeType=@0x7fff049ab0c8)
    at /home/bjacob/mozilla-central/dom/plugins/base/nsPluginHost.cpp:1442
#10 0x00007fc6c5f807b5 in nsExternalHelperAppService::GetTypeFromExtension (this=0x7fc6b468bd10, 
    aFileExt=..., aContentType=...)
    at /home/bjacob/mozilla-central/uriloader/exthandler/nsExternalHelperAppService.cpp:2763
#11 0x00007fc6c5f81061 in nsExternalHelperAppService::GetTypeFromFile (this=0x7fc6b468bd10, 
---Type <return> to continue, or q <return> to quit---
    aFile=0x7fc6b4dcfff0, aContentType=...)                                                        
    at /home/bjacob/mozilla-central/uriloader/exthandler/nsExternalHelperAppService.cpp:2887       
#12 0x00007fc6c661f032 in NS_InvokeByIndex_P (that=0x7fc6b468bd28, methodIndex=6, paramCount=2, 
    params=0x7fff049ab530)
    at /home/bjacob/mozilla-central/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:195
#13 0x00007fc6c5e52600 in CallMethodHelper::Invoke (this=0x7fff049ab4f0)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappednative.cpp:3141
#14 0x00007fc6c5e505f5 in CallMethodHelper::Call (this=0x7fff049ab4f0)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappednative.cpp:2407
#15 0x00007fc6c5e4c6e4 in XPCWrappedNative::CallMethod (ccx=..., 
    mode=XPCWrappedNative::CALL_METHOD)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappednative.cpp:2371
#16 0x00007fc6c5e5c43a in XPC_WN_CallMethod (cx=0x7fc6b4347150, argc=1, vp=0x7fc6b8680608)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappednativejsops.cpp:1610
#17 0x00007fc6c6ac2fae in js::CallJSNative (cx=0x7fc6b4347150, 
    native=0x7fc6c5e5c1c7 <XPC_WN_CallMethod(JSContext*, unsigned int, jsval_layout*)>, argc=1, 
    vp=0x7fc6b8680608) at /home/bjacob/mozilla-central/js/src/jscntxtinlines.h:277
#18 0x00007fc6c6d21a09 in js::Interpret (cx=0x7fc6b4347150, entryFrame=0x7fc6b86801a0, 
    inlineCallCount=7, interpMode=js::JSINTERP_NORMAL)
    at /home/bjacob/mozilla-central/js/src/jsinterp.cpp:4673
#19 0x00007fc6c6abe462 in js::RunScript (cx=0x7fc6b4347150, script=0x7fc6b43f2610, 
    fp=0x7fc6b86801a0) at /home/bjacob/mozilla-central/js/src/jsinterp.cpp:603
#20 0x00007fc6c6abe8fb in js::Invoke (cx=0x7fc6b4347150, argsRef=..., option=js::INVOKE_NORMAL)
    at /home/bjacob/mozilla-central/js/src/jsinterp.cpp:684
#21 0x00007fc6c6abef41 in js::ExternalInvoke (cx=0x7fc6b4347150, thisv=..., fval=..., argc=1, 
    argv=0x7fff049ad830, rval=0x7fff049ad930)
    at /home/bjacob/mozilla-central/js/src/jsinterp.cpp:806
---Type <return> to continue, or q <return> to quit---
#22 0x00007fc6c6a21484 in JS_CallFunctionValue (cx=0x7fc6b4347150, obj=0x7fc6b3c1c0d0, fval=..., 
    argc=1, argv=0x7fff049ad830, rval=0x7fff049ad930)
    at /home/bjacob/mozilla-central/js/src/jsapi.cpp:5081
#23 0x00007fc6c5e4301c in nsXPCWrappedJSClass::CallMethod (this=0x7fc6b4e8b4c0, 
    wrapper=0x7fc6b4e8b590, methodIndex=3, info=0x7fc6b407c7f0, nativeParams=0x7fff049adcf0)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappedjsclass.cpp:1662
#24 0x00007fc6c5e399b8 in nsXPCWrappedJS::CallMethod (this=0x7fc6b4e8b590, methodIndex=3, 
    info=0x7fc6b407c7f0, params=0x7fff049adcf0)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappedjs.cpp:586
#25 0x00007fc6c661f516 in PrepareAndDispatch (self=0x7fc6b4e60bd0, methodIndex=3, 
    args=0x7fff049ade90, gpregs=0x7fff049ade10, fpregs=0x7fff049ade40)
    at /home/bjacob/mozilla-central/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp:153
#26 0x00007fc6c661f5a9 in SharedStub ()
    at /home/bjacob/mozilla-central/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp:159
#27 0x00007fc6c65d37e9 in nsInputStreamReadyEvent::Run (this=0x7fc6b4e20440)
    at /home/bjacob/mozilla-central/xpcom/io/nsStreamUtils.cpp:114
#28 0x00007fc6c65fe6e8 in nsThread::ProcessNextEvent (this=0x95a320, mayWait=1, 
    result=0x7fff049ae218) at /home/bjacob/mozilla-central/xpcom/threads/nsThread.cpp:618
#29 0x00007fc6c661f032 in NS_InvokeByIndex_P (that=0x95a320, methodIndex=8, paramCount=2, 
    params=0x7fff049ae200)
    at /home/bjacob/mozilla-central/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:195
#30 0x00007fc6c5e52600 in CallMethodHelper::Invoke (this=0x7fff049ae1c0)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappednative.cpp:3141
#31 0x00007fc6c5e505f5 in CallMethodHelper::Call (this=0x7fff049ae1c0)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappednative.cpp:2407
---Type <return> to continue, or q <return> to quit---
#32 0x00007fc6c5e4c6e4 in XPCWrappedNative::CallMethod (ccx=..., 
    mode=XPCWrappedNative::CALL_METHOD)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappednative.cpp:2371
#33 0x00007fc6c5e5c43a in XPC_WN_CallMethod (cx=0x7fc6b4347150, argc=1, vp=0x7fc6b8680138)
    at /home/bjacob/mozilla-central/js/src/xpconnect/src/xpcwrappednativejsops.cpp:1610
#34 0x00007fc6c6ac2fae in js::CallJSNative (cx=0x7fc6b4347150, 
    native=0x7fc6c5e5c1c7 <XPC_WN_CallMethod(JSContext*, unsigned int, jsval_layout*)>, argc=1, 
    vp=0x7fc6b8680138) at /home/bjacob/mozilla-central/js/src/jscntxtinlines.h:277
#35 0x00007fc6c6d21a09 in js::Interpret (cx=0x7fc6b4347150, entryFrame=0x7fc6b8680048, 
    inlineCallCount=1, interpMode=js::JSINTERP_NORMAL)
    at /home/bjacob/mozilla-central/js/src/jsinterp.cpp:4673
#36 0x00007fc6c6abe462 in js::RunScript (cx=0x7fc6b4347150, script=0x7fc6b4483aa0, 
    fp=0x7fc6b8680048) at /home/bjacob/mozilla-central/js/src/jsinterp.cpp:603
#37 0x00007fc6c6abf879 in js::Execute (cx=0x7fc6b4347150, chain=..., script=0x7fc6b4483aa0, 
    prev=0x0, flags=0, result=0x7fff049b11d0)
    at /home/bjacob/mozilla-central/js/src/jsinterp.cpp:964
#38 0x00007fc6c6a20842 in JS_ExecuteScript (cx=0x7fc6b4347150, obj=0x7fc6b850b090, 
    scriptObj=0x7fc6b850b2d0, rval=0x7fff049b11d0)
    at /home/bjacob/mozilla-central/js/src/jsapi.cpp:4934
#39 0x0000000000406a51 in ProcessFile (cx=0x7fc6b4347150, obj=0x7fc6b850b090, 
    filename=0x7fff049b3475 "./server.js", file=0x7fc6b445d190, forceTTY=0)
    at /home/bjacob/mozilla-central/js/src/xpconnect/shell/xpcshell.cpp:1068
#40 0x0000000000406e17 in Process (cx=0x7fc6b4347150, obj=0x7fc6b850b090, 
    filename=0x7fff049b3475 "./server.js", forceTTY=0)
    at /home/bjacob/mozilla-central/js/src/xpconnect/shell/xpcshell.cpp:1144
#41 0x00000000004073a9 in ProcessArgs (cx=0x7fc6b4347150, obj=0x7fc6b850b090, 
    argv=0x7fff049b16b0, argc=8)
    at /home/bjacob/mozilla-central/js/src/xpconnect/shell/xpcshell.cpp:1268
---Type <return> to continue, or q <return> to quit---
#42 0x0000000000408f48 in main (argc=8, argv=0x7fff049b16b0, envp=0x7fff049b16f8)
    at /home/bjacob/mozilla-central/js/src/xpconnect/shell/xpcshell.cpp:1992



The plugin here is crashy, the question is why does the mochitest even query it, the answer to that question is that the mochitest tries loading filenames with extensions .vert and .frag that are unrecognized and so GetTypeFromExtension is querying plugins to see if they know about that extension.

Attached patch should fix that (thanks to Ehsan)
Attachment #533756 - Flags: review?(ehsan)
Attachment #533756 - Flags: review?(ehsan) → review+
http://hg.mozilla.org/mozilla-central/rev/288da704b0bc
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee: nobody → bjacob
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: