nsGNOMERegistry::GetFromType feeds invalid mime type (containing CAPS) to gnome-vfs (assertion in libgnomevfs, CRITICAL)

RESOLVED FIXED

Status

Core Graveyard
File Handling
RESOLVED FIXED
14 years ago
2 years ago

People

(Reporter: Christian Persch (GNOME) (away; not receiving bug mail), Assigned: timeless)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

User-Agent:       
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7a) Gecko/20040220 Epiphany/1.1.10

nsGNOMERegistry::GetFromType passes the mime type to
gnome_vfs_mime_get_default_application() as it is received from the network.
However, gnome-vfs seems to consider it a programming error to feed it invalid
mime types, since it does g_return_if_fail(!does_string_contain_caps
(mime_type)); this means that in builds of gnome-vfs with debugging disabled the
behaviour will be undefined.

Here's a trace from the warning, note the mime type with caps:
"application/x-eBay-Toolbar-Plugin-Functions":

#1  0x40cb1546 in g_log (log_domain=0x408c44c8 "libgnomevfs",
log_level=G_LOG_LEVEL_CRITICAL, format=0x408c4760 "file %s: line %d (%s):
assertion `%s' failed")
    at gmessages.c:541
#2  0x408a8fd2 in get_value_real (mime_type=0xbfffe868
"application/x-eBay-Toolbar-Plugin-Functions", key=0x408c74cf
"default_application_id", 
    user_hash_table=0x8757f00, system_hash_table=0x884c350) at
gnome-vfs-mime-info.c:916
#3  0x408a9186 in gnome_vfs_mime_get_value (mime_type=0xbfffe868
"application/x-eBay-Toolbar-Plugin-Functions", key=0x408c74cf
"default_application_id")
    at gnome-vfs-mime-info.c:972
#4  0x408a55f7 in gnome_vfs_mime_get_default_application (mime_type=0xbfffe868
"application/x-eBay-Toolbar-Plugin-Functions") at gnome-vfs-mime-handlers.c:185
#5  0x41f11025 in nsGNOMERegistry::GetFromType(char const*) () from
/opt/gnome2/lib/mozilla-1.7a/components/libdocshell.so
#6  0x41f0fde8 in nsOSHelperAppService::GetFromType(char const*) () from
/opt/gnome2/lib/mozilla-1.7a/components/libdocshell.so
#7  0x41f1040f in nsOSHelperAppService::GetMIMEInfoFromOS(char const*, char
const*, int*) () from /opt/gnome2/lib/mozilla-1.7a/components/libdocshell.so
#8  0x41f0687f in nsExternalHelperAppService::GetFromTypeAndExtension(char
const*, char const*, nsIMIMEInfo**) ()


Reproducible: Always
Steps to Reproduce:
Go to http://www.ebay.de/

Actual Results:  
(epiphany-bin:4029): libgnomevfs-CRITICAL **: file gnome-vfs-mime-info.c: line
916 (get_value_real): assertion `!does_string_contain_caps (mime_type)' failed

printed multiple times on console.

Expected Results:  
no warnings on console.
What's further on that stack?  That type should never be coming from the
network; see
http://lxr.mozilla.org/seamonkey/source/netwerk/base/public/nsIChannel.idl#122
(and there is code in nsHttpChannel that enforces that....)
I can reproduce it in mozilla-the-browser, in epiphany, and in TestGtkEmbed.
Here's a full trace from the warning, obtained by running my 20040226 debug
build's TestGtkEmbed:

#0  g_log (log_domain=0x4296b4c8 "libgnomevfs", log_level=G_LOG_LEVEL_CRITICAL,
format=0x4296b760 "file %s: line %d (%s): assertion `%s' failed") at gmessages.c:540
#1  0x4294ffd2 in get_value_real (mime_type=0xbfffea98
"application/x-eBay-Toolbar-Plugin-Functions", key=0x4296e4cf
"default_application_id", 
    user_hash_table=0x8399830, system_hash_table=0x8399718) at
gnome-vfs-mime-info.c:916
#2  0x42950186 in gnome_vfs_mime_get_value (mime_type=0xbfffea98
"application/x-eBay-Toolbar-Plugin-Functions", key=0x4296e4cf
"default_application_id")
    at gnome-vfs-mime-info.c:972
#3  0x4294c5f7 in gnome_vfs_mime_get_default_application (mime_type=0xbfffea98
"application/x-eBay-Toolbar-Plugin-Functions") at gnome-vfs-mime-handlers.c:185
#4  0x40dc480f in nsGNOMERegistry::GetFromType(char const*)
(aMIMEType=0xbfffea98 "application/x-eBay-Toolbar-Plugin-Functions") at
unix/nsGNOMERegistry.cpp:262
#5  0x40dc276b in nsOSHelperAppService::GetFromType(char const*)
(this=0x827af60, aMIMEType=0xbfffea98 "application/x-eBay-Toolbar-Plugin-Functions")
    at unix/nsOSHelperAppService.cpp:1483
#6  0x40dc2d35 in nsOSHelperAppService::GetMIMEInfoFromOS(char const*, char
const*, int*) (this=0x827af60, 
    aType=0xbfffea98 "application/x-eBay-Toolbar-Plugin-Functions",
aFileExt=0x0, aFound=0xbfffe97c) at unix/nsOSHelperAppService.cpp:1570
#7  0x40db5104 in nsExternalHelperAppService::GetFromTypeAndExtension(char
const*, char const*, nsIMIMEInfo**) (this=0x827af60, 
    aMIMEType=0xbfffea98 "application/x-eBay-Toolbar-Plugin-Functions",
aFileExt=0x0, _retval=0xbfffea70) at nsExternalHelperAppService.cpp:2191
#8  0x4184991b in MimeTypeArrayImpl::NamedItem(nsAString const&,
nsIDOMMimeType**) (this=0x8161b10, aName=@0xbfffebb0, aReturn=0xbfffeb3c) at
nsMimeTypeArray.cpp:138
#9  0x4186463e in nsMimeTypeArraySH::GetNamedItem(nsISupports*, nsAString
const&, nsISupports**) (this=0x83865b0, aNative=0x8161b10, aName=@0xbfffebb0, 
    aResult=0x4296b4c8) at nsDOMClassInfo.cpp:6430
#10 0x4185ffb4 in nsNamedArraySH::GetProperty(nsIXPConnectWrappedNative*,
JSContext*, JSObject*, long, long*, int*) (this=0x83865b0, wrapper=0x85b1308,
cx=0x82b3690, 
    obj=0x81c7530, id=136081508, vp=0xbfffedf4, _retval=0xbfffec48) at
nsDOMClassInfo.cpp:4921
#11 0x40f760a4 in XPC_WN_Helper_GetProperty (cx=0x82b3690, obj=0x81c7530,
idval=136081508, vp=0xbfffedf4) at xpcwrappednativejsops.cpp:810
#12 0x40188c44 in js_GetProperty (cx=0x82b3690, obj=0x81c7530, id=137994472,
vp=0xbfffedf4) at jsobj.c:2609
#13 0x40179cf1 in js_Interpret (cx=0x82b3690, result=0xbfffef70) at jsinterp.c:2809
#14 0x40170bac in js_Execute (cx=0x82b3690, chain=0x81c6070, script=0x4296b4c8,
down=0x0, special=1117172936, result=0xbfffef70) at jsinterp.c:1155
#15 0x4014c834 in JS_EvaluateUCScriptForPrincipals (cx=0x82b3690, obj=0x81c6070,
principals=0x85f712c, chars=0x854adf8, length=5909, 
    filename=0x85196e8
"http://include.ebaystatic.com/aw/pics/js/popout/promo_popout_mediaplex.js",
lineno=1, rval=0xbfffef70) at jsapi.c:3540
#16 0x41821b7b in nsJSContext::EvaluateString(nsAString const&, void*,
nsIPrincipal*, char const*, unsigned, char const*, nsAString&, int*)
(this=0x82b3648, 
    aScript=@0x8582b30, aScopeObject=0x81c6070, aPrincipal=0xbfffef80,
aURL=0x85196e8
"http://include.ebaystatic.com/aw/pics/js/popout/promo_popout_mediaplex.js", 
    aLineNo=1, aVersion=0x401ae955 "default", aRetValue=@0xbffff0c0,
aIsUndefined=0xbffff05c) at nsJSEnvironment.cpp:909
#17 0x416998de in nsScriptLoader::EvaluateScript(nsScriptLoadRequest*, nsString
const&) (this=0xbffff060, aRequest=0x8582b18, aScript=@0x8582b30)
    at nsScriptLoader.cpp:653
#18 0x41699543 in nsScriptLoader::ProcessRequest(nsScriptLoadRequest*)
(this=0x84d8c50, aRequest=0x8582b18) at nsScriptLoader.cpp:573
#19 0x4169a4b1 in nsScriptLoader::OnStreamComplete(nsIStreamLoader*,
nsISupports*, unsigned, unsigned, char const*) (this=0x84d8c50, aLoader=0x84b81b0, 
    aContext=0x8582b18, aStatus=3221222080, stringLen=4294967295,
string=0x858153e "") at nsScriptLoader.cpp:891
#20 0x41033966 in nsStreamLoader::OnStopRequest(nsIRequest*, nsISupports*,
unsigned) (this=0x84b81b0, request=0x842e3a0, ctxt=0x8582b18, aStatus=0)
    at nsStreamLoader.cpp:141
#21 0x410b6468 in nsHttpChannel::OnStopRequest(nsIRequest*, nsISupports*,
unsigned) (this=0x842e3a0, request=0x8558718, ctxt=0x8582b18, status=0)
    at nsHttpChannel.cpp:3392
#22 0x41011db4 in nsInputStreamPump::OnStateStop() (this=0x8558718) at
nsInputStreamPump.cpp:498
#23 0x410118d4 in nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*)
(this=0x8558718, stream=0x85e4514) at nsInputStreamPump.cpp:339
#24 0x4026ccc6 in nsInputStreamReadyEvent::EventHandler(PLEvent*)
(plevent=0x4296b4c8) at nsStreamUtils.cpp:118
#25 0x40289bec in PL_HandleEvent (self=0x819018c) at plevent.c:671
#26 0x40289ac5 in PL_ProcessPendingEvents (self=0x8115ab8) at plevent.c:606
#27 0x4028c4c6 in nsEventQueueImpl::ProcessPendingEvents() (this=0x8115a70) at
nsEventQueue.cpp:391
#28 0x41eee4aa in event_processor_callback (source=0x81dc0f0, condition=G_IO_IN,
data=0x42) at nsAppShell.cpp:67
#29 0x407a2c79 in g_io_unix_dispatch (source=0x81dc0f0, callback=0x41eee494
<event_processor_callback>, user_data=0x8115a70) at giounix.c:161
#30 0x4078125e in g_main_dispatch (context=0x8080620) at gmain.c:1753
#31 0x407822d9 in g_main_context_dispatch (context=0x8080620) at gmain.c:2297
#32 0x4078261a in g_main_context_iterate (context=0x8080620, block=1,
dispatch=1, self=0x8080d48) at gmain.c:2378
#33 0x40782cd1 in g_main_loop_run (loop=0x82fd4e8) at gmain.c:2598
#34 0x4047b78b in gtk_main () at gtkmain.c:1171
#35 0x08049faa in main (argc=1, argv=0xbffff7f4) at TestGtkEmbed.cpp:217
bz: the nsIExternalHelperAppService does not require lower-cased mime types. It
doesn't require an nsIChannel either.
Yes, I know.  We probably want a toLowerCase here.  I was just checking on the
"as it is received from the network" part, because that _would_ be broken.

Comment 5

14 years ago
*** Bug 245197 has been marked as a duplicate of this bug. ***
Summary: nsGNOMERegistry::GetFromType feeds invalid mime type (containing CAPS) to gnome-vfs → nsGNOMERegistry::GetFromType feeds invalid mime type (containing CAPS) to gnome-vfs (assertion in libgnomevfs, CRITICAL)
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → EXPIRED

Updated

12 years ago
Status: RESOLVED → UNCONFIRMED
Resolution: EXPIRED → ---
(Assignee)

Comment 8

10 years ago
Created attachment 295076 [details] [diff] [review]
lowercase...
Assignee: file-handling → timeless
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #295076 - Flags: review?(cbiesinger)
QA Contact: ian → file-handling
Comment on attachment 295076 [details] [diff] [review]
lowercase...

+  // We promise to only send lower case mime types to the os

uppercase OS
Attachment #295076 - Flags: review?(cbiesinger) → review+
(Assignee)

Updated

10 years ago
Attachment #295076 - Flags: approval1.9?

Updated

10 years ago
Attachment #295076 - Flags: approval1.9? → approval1.9+
(Assignee)

Comment 10

10 years ago
mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp 	1.360
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago10 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.