Closed
Bug 235832
Opened 21 years ago
Closed 21 years ago
Crash on Save Image As with jpeg images and Save Page As on local files
Categories
(Core Graveyard :: File Handling, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: roscoe, Assigned: Biesinger)
References
()
Details
Attachments
(4 files, 3 obsolete files)
7.17 KB,
text/plain
|
Details | |
16.38 KB,
text/plain
|
Details | |
1.90 KB,
patch
|
bzbarsky
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
2.02 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
User-Agent:
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7b) Gecko/20040225
Right-clicking and selecting save image as on jpeg images causes crash.
Reproducible: Always
Steps to Reproduce:
1.Go to a webpage that has jpeg images
2.Right-click to save image as
3.Crash
Actual Results:
Mozilla crashed
Expected Results:
Should have popped up a save location dialog and then saved image.
The URL above is just so the field isn't blank. This has happenned on every
sight I've tried it with.
Reporter | ||
Comment 1•21 years ago
|
||
Still seeing with 2004022705
Comment 2•21 years ago
|
||
Worksforme with a current linux build. Is this OSX only? What's the MacsBug stack?
Comment 3•21 years ago
|
||
I can confirm this with Mozilla 2004022705 on Mac OS 10.2.8.
It's not just jpeg images... As far as I can tell, trying to save any image
with Save image as... will cause a crash.
Comment 4•21 years ago
|
||
Uh-oh. Top of stack is:
#0 0x01b1e154 in __dynamic_cast
#1 0x01b14d28 in nsOSHelperAppService::GetMIMEInfoFromOS(char const*, char
const*, int*)
#2 0x01b111f8 in nsExternalHelperAppService::GetFromTypeAndExtension(char
const*, char const*, nsIMIMEInfo**)
#3 0x01b14a60 in nsOSHelperAppService::GetFromTypeAndExtension(char const*,
char const*, nsIMIMEInfo**)
I wonder how dynamic_cast manages to crash....
Assignee | ||
Comment 5•21 years ago
|
||
hm, that's no good
roscoe: could you generate an NSPR log, like this:
setenv NSPR_LOG_MODULES HelperAppService:5
setenv NSPR_LOG_FILE ~/crash.log
cd Desktop/Mozilla.app/Contents/MacOS
./mozilla
then crash, then attach ~/crash.log to this bug?
Comment 6•21 years ago
|
||
This is what I get (trying to save http://www.mozilla.org/images/mlogo.gif)
-1610609172[bcb80]: Getting mimeinfo from type 'image/gif' ext 'gif'
-1610609172[bcb80]: Mac: HelperAppService lookup for type 'image/gif' ext 'gif'
(IC: 0x4a84d60)
-1610609172[bcb80]: OS gave us: By Type: 0x538da80 By Ext: 0x54fe0f0 type has
default: false
Assignee | ||
Comment 7•21 years ago
|
||
oh, hm, doesn't .get() on a nsCOMPtr give me some nsDerivedSafe thingy?
let me suggest a patch...
Assignee | ||
Comment 8•21 years ago
|
||
Comment 9•21 years ago
|
||
So... to make it _really_ clear to the compiler what's going on, I'd .get() and
NS_STATIC_CAST that to nsIMIMEInfo*....
Comment 10•21 years ago
|
||
Confirming bug, I can duplicate this crash.
ok, tested the patch here, and it has absolutely no effect. It still crashes,
and the stack trace looks exactly the same. biesi had me try it again with
s/dynamic_cast/static_cast/g and that *did* work (the crash doesn't happen, and
the file successfully saves).
Assignee: general → file-handling
Status: UNCONFIRMED → NEW
Component: Browser-General → File Handling
Ever confirmed: true
QA Contact: general → ian
Comment 11•21 years ago
|
||
See also bug 235900.... the problem also exists when you try to "Save Page As"
and the open page is a local file. I haven't duped that bug yet, in case the two
save issues have different causes, but it seems a big coincidence. It looks like
the problem began with bug 234916, or right after it was fixed.
Comment 12•21 years ago
|
||
*** Bug 235900 has been marked as a duplicate of this bug. ***
Comment 13•21 years ago
|
||
fixing summary to reflect the bug that was just duped here. Biesi's patch
(modified as discussed on irc) fixes both issues.
Summary: Crash on Save Image As with jpeg images → Crash on Save Image As with jpeg images and Save Page As on local files
Comment 14•21 years ago
|
||
bug 234916 is totally unrelated to this problem.
Comment 15•21 years ago
|
||
It crashed, although the patch of 142479 was applied.
It checked by firefox of static build.
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; ja-JP; rv:1.7b) Gecko/20040229
Firefox/0.8.0+
Comment 16•21 years ago
|
||
And another confirm with build 20040228 on Mac OS X 10.2.8. Same stack.
I wasn't trying to confirm the bug, I've just met it myself, and I found this
one when I wanted to report it.
Comment 17•21 years ago
|
||
Guys, we know it crashes... no need to tell us over and over again.
Assignee | ||
Comment 18•21 years ago
|
||
well then, let's use static_cast...
I do not like this at all, but I guess I have to...
Assignee: file-handling → cbiesinger
Attachment #142479 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Comment 19•21 years ago
|
||
additional comment:
It did not crash by Camino of created dynamic link build, without applying a patch.
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; ja-JP; rv:1.7b) Gecko/20040228
Camino/0.7+
Comment 20•21 years ago
|
||
(In reply to comment #18)
> Created an attachment (id=142553)
> patch
It becomes a compile error.
sOSHelperAppService.pp ./mac/nsOSHelperAppService.cpp
mac/nsOSHelperAppService.cpp: In member function `virtual
already_AddRefed<nsIMIMEInfo> nsOSHelperAppService::GetMIMEInfoFromOS(const
char*, const char*, PRBool*)':
mac/nsOSHelperAppService.cpp:226: error: invalid static_cast from type `
nsDerivedSafe<nsIMIMEInfo>*' to type `nsMIMEInfoBase*'
mac/nsOSHelperAppService.cpp:227: error: invalid static_cast from type `
nsDerivedSafe<nsIMIMEInfo>*' to type `nsMIMEInfoBase*'
make[4]: *** [nsOSHelperAppService.o] Error 1
Assignee | ||
Comment 21•21 years ago
|
||
bah, I hate nsDerivedSafe
try this instead
Attachment #142553 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #142566 -
Flags: superreview?(darin)
Attachment #142566 -
Flags: review?(bzbarsky)
Comment 22•21 years ago
|
||
Comment on attachment 142566 [details] [diff] [review]
patch v2
r=me
Attachment #142566 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 23•21 years ago
|
||
actually... maybe dynamic_cast has problems trying to cast to an abstract
class? this patch casts to nsMIMEInfoMac instead, which is a concrete class.
Maybe this is sufficient; I definitely prefer it to the static_cast patch
Comment 24•21 years ago
|
||
I am seeing a similar crash on Linux
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040227
Stack trace :
#0 0x40706c31 in kill () from /lib/libc.so.6
#1 0x400e581d in pthread_kill () from /lib/libpthread.so.0
#2 0x400e5b9b in raise () from /lib/libpthread.so.0
#3 0x4149cff8 in NSGetModule ()
from /usr/local/mozilla/components/libprofile.so
#4 0x400e9dfd in __pthread_sighandler () from /lib/libpthread.so.0
#5 <signal handler called>
#6 0x4163a6bb in nsGNOMERegistry::GetFromType(char const*) ()
from /usr/local/mozilla/components/libdocshell.so
#7 0x41639016 in nsOSHelperAppService::GetFromType(char const*) ()
from /usr/local/mozilla/components/libdocshell.so
#8 0x416395f8 in nsOSHelperAppService::GetMIMEInfoFromOS(char const*, char
const*, int*) () from /usr/local/mozilla/components/libdocshell.so
#9 0x4162f68d in nsExternalHelperAppService::GetFromTypeAndExtension(char
const*, char const*, nsIMIMEInfo**) ()
from /usr/local/mozilla/components/libdocshell.so
#10 0x40a95797 in XPTC_InvokeByIndex () from /usr/local/mozilla/libxpcom.so
...
Build options :
--enable-default-toolkit=gtk2 --enable-calendar --enable-xft
--disable-postscript --disable-xprint --enable-crypto --disable-installer
--disable-debug --enable-optimize=-O3
Assignee | ||
Comment 25•21 years ago
|
||
doeni@evhr.net, you are seeing an entirely different crash, as the stack trace
clearly shows. Your crash is bug 235201
Comment 26•21 years ago
|
||
Comment on attachment 142566 [details] [diff] [review]
patch v2
sr=darin
this patch is fine by me. however, if you want to try the other dynamic_cast
patch... ok.
Attachment #142566 -
Flags: superreview?(darin) → superreview+
Assignee | ||
Comment 27•21 years ago
|
||
I checked attachment 142566 [details] [diff] [review] in ("patch v2"). I'm leaving this bug open, because
I do prefer attachment 142587 [details] [diff] [review], but I'll need to find someone to test that patch.
Comment 28•21 years ago
|
||
Patch v2 tested on OS 10.3 with a CVS tip pull and it appears to work fine.
Comment 29•21 years ago
|
||
Zach, could you test "another try" too?
Comment 30•21 years ago
|
||
erm, sorry. What I tested was actually "another try," and it in fact does work.
Sorry for the confusion.
Assignee | ||
Comment 31•21 years ago
|
||
excellent!
thanks for the testing zach!
Attachment #142587 -
Attachment is obsolete: true
Assignee | ||
Comment 32•21 years ago
|
||
Comment on attachment 145101 [details] [diff] [review]
use dynamic_cast, updated to trunk
bz, could you review?
(darin gave sr in comment 26)
Attachment #145101 -
Flags: review?(bzbarsky)
Comment 33•21 years ago
|
||
Comment on attachment 145101 [details] [diff] [review]
use dynamic_cast, updated to trunk
r=bzbarsky
Attachment #145101 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 34•21 years ago
|
||
latest patch checked in.
Checking in nsOSHelperAppService.cpp;
/cvsroot/mozilla/uriloader/exthandler/mac/nsOSHelperAppService.cpp,v <--
nsOSHelperAppService.cpp
new revision: 1.34; previous revision: 1.33
done
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 35•21 years ago
|
||
it seems the last patch here caused crashes again, unfortunately. I backed it
out. (see bug 240748, bug Bug 240771)
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•