Closed
Bug 353553
Opened 18 years ago
Closed 18 years ago
Firefox crashes on certain png images used in the css cursor property [@ ntdll.dll + 0x11e58] [@ JS_ArenaAllocate]
Categories
(Core :: Widget: Win32, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: frederik.reiss, Assigned: MatsPalmgren_bugz)
References
Details
(5 keywords, Whiteboard: [sg:critical])
Crash Data
Attachments
(9 files, 4 obsolete files)
138 bytes,
text/html
|
Details | |
195 bytes,
image/png
|
Details | |
195 bytes,
image/png
|
Details | |
192 bytes,
image/png
|
Details | |
193 bytes,
image/png
|
Details | |
195 bytes,
image/png
|
Details | |
591 bytes,
text/html
|
Details | |
6.97 KB,
text/plain
|
Details | |
3.71 KB,
patch
|
Biesinger
:
review+
dveditz
:
superreview+
dveditz
:
approval1.8.0.9+
dveditz
:
approval1.8.1.1+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7
When i use the "cursor:url(...);" css property Firefox crashes on certain images used as cursor. The crash happens only in Windows XP SP2 but not under Linux (didn't test in OSX). And it also seems to depend on the size of the image used:
crash:
32x16.png
33x17.png
no crash:
32x16.png
33x15.png
33x17.png
Reproducible: Sometimes
Steps to Reproduce:
1. save the html file as "test.html"
2. save one of the png file as "test.png" in the same directory as the html file
3. open the html file
4. click on the "test" link sometimes
Actual Results:
firfox crashes after some clicks
Expected Results:
firfox should not crash
All image are plain black (no transparency) and created with The Gimp.
I tested this on some firefox versions:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.13) Gecko/20060410 Firefox/1.0.8
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b2) Gecko/2006082101 Firefox/2.0b2
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/2006092004 Minefield/3.0a1
1.0.8 and 3.0a1 don't crash (and also don't display the cursor image).
1.5.0.7 an 2.0b2 display the cursor image crash.
Reporter | ||
Comment 1•18 years ago
|
||
Reporter | ||
Comment 2•18 years ago
|
||
Reporter | ||
Comment 3•18 years ago
|
||
Reporter | ||
Comment 4•18 years ago
|
||
Reporter | ||
Comment 5•18 years ago
|
||
Reporter | ||
Comment 6•18 years ago
|
||
Comment 7•18 years ago
|
||
*** Bug 353548 has been marked as a duplicate of this bug. ***
Comment 8•18 years ago
|
||
*** Bug 353549 has been marked as a duplicate of this bug. ***
Comment 9•18 years ago
|
||
I can reproduce in "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20060918 BonEcho/2.0".
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking-firefox2?
Updated•18 years ago
|
Component: General → JavaScript Engine
Flags: blocking-firefox2?
Product: Firefox → Core
Version: unspecified → 1.8 Branch
Updated•18 years ago
|
Component: JavaScript Engine → Style System (CSS)
Comment 10•18 years ago
|
||
Moved to Core>Style System (version 1.8 branch). Please correct if I'm incorrect.
Comment 11•18 years ago
|
||
Talkback IDs
In Firefox 1.5.0.7: TB23545563G
In Firefox 2.0: TB23545380
Updated•18 years ago
|
Assignee: nobody → win32
Component: Style System (CSS) → GFX: Win32
Keywords: crash
QA Contact: general → ian
Comment 12•18 years ago
|
||
Heap corruption?
Incident ID: 23545380
Stack Signature ntdll.dll + 0x11e58 (0x7c911e58) a0651ad0
Product ID Firefox2
Build ID 2006091813
Trigger Time 2006-09-20 18:23:41.0
Platform Win32
Operating System Windows NT 5.1 build 2600
Module ntdll.dll + (00011e58)
URL visited
User Comments Reproducing Bug 353549 in "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20060918 BonEcho/2.0"
Since Last Crash 199 sec
Total Uptime 37273 sec
Trigger Reason Access violation
Source File, Line No. N/A
Stack Trace
ntdll.dll + 0x11e58 (0x7c911e58)
ntdll.dll + 0x18251 (0x7c918251)
ntdll.dll + 0x11c76 (0x7c911c76)
msvcrt.dll + 0x1c3c9 (0x77c2c3c9)
msvcrt.dll + 0x1c3e7 (0x77c2c3e7)
msvcrt.dll + 0x1c42e (0x77c2c42e)
JS_ArenaAllocate [mozilla/js/src/jsarena.c, line 169]
js_AllocRawStack [mozilla/js/src/jsinterp.c, line 339]
nsXPCWrappedJSClass::CallMethod [mozilla/js/src/xpconnect/src/xpcwrappedjsclass.cpp, line 1172]
nsXPCWrappedJS::CallMethod [mozilla/js/src/xpconnect/src/xpcwrappedjs.cpp, line 468]
SharedStub [mozilla/xpcom/reflect/xptcall/src/md/win32/xptcstubs.cpp, line 147]
nsXMLHttpProgressEvent::GetType [mozilla/content/base/src/nsXMLHttpRequest.h, line 216]
EventHandler [mozilla/xpcom/proxy/src/nsProxyEvent.cpp, line 561]
SHDOCVW.dll + 0x150c24 (0x778b0c24)
nsListControlFrame::OnOptionSelected [mozilla/layout/forms/nsListControlFrame.cpp, line 1788]
0x5bc03300
Summary: firefox crashes on certain png images used in the css cursor property → Firefox crashes on certain png images used in the css cursor property [@ ntdll.dll + 0x11e58] [@ JS_ArenaAllocate]
Comment 13•18 years ago
|
||
With this testcase, I crash with 1.8.1 builds when hovering a couple of times over the link.
The fact that the cursor doesn't show up in trunk builds seems like a separate bug to me.
Comment 14•18 years ago
|
||
Indeed, in my debug build I get a crash because of heap corruption.
With a slightly modified testcase (using border instead of outline, because that wasn't supported for those older builds), I get a regression range between 2005-04-12 and 2005-04-14:
http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2005-04-12+05&maxdate=2005-04-14+08&cvsroot=%2Fcvsroot\
So, my guess is somehow a regression from bug 228662.
Comment 15•18 years ago
|
||
(In reply to comment #14)
> So, my guess is somehow a regression from bug 228662.
Ugh, I meant bug 286622.
Comment 16•18 years ago
|
||
Yes, backing out the patch from bug 286622 seems to fix the crash.
Updated•18 years ago
|
Assignee: win32 → win32
Status: ASSIGNED → NEW
Component: Style System (CSS) → Widget: Win32
Comment 17•18 years ago
|
||
Only changing this also seems to fix the crash.
Comment 18•18 years ago
|
||
Assigning to martijn to drive reviews and checkins.
Assignee: win32 → martijn.martijn
Flags: blocking1.8.1.1?
Flags: blocking1.8.1.1+
Flags: blocking1.8.0.9+
Comment 19•18 years ago
|
||
Comment on attachment 239498 [details] [diff] [review]
this fixes the crash
Well, this wasn't meant as a real patch, this was just to indicate what I discovered what fixed this bug.
I don't know this code or why it fixes the bug.
Maybe this is a good patch, I don't know, else somebody has to write a decent one.
Attachment #239498 -
Flags: superreview?(roc)
Attachment #239498 -
Flags: review?(cbiesinger)
Comment 20•18 years ago
|
||
Comment on attachment 239498 [details] [diff] [review]
this fixes the crash
_please_ update comments when patching code. that said, why is this correct? see the comment :)
Attachment #239498 -
Flags: review?(cbiesinger) → review-
Comment 21•18 years ago
|
||
Comment on attachment 239498 [details] [diff] [review]
this fixes the crash
I'm sorry, I don't understand this code. This was merely to indicate where things were going wrong.
Attachment #239498 -
Flags: superreview?(roc)
![]() |
||
Updated•18 years ago
|
Flags: blocking1.9?
Comment 23•18 years ago
|
||
Dbaron can you take a look or recommend a new owner?
Assignee: win32 → dbaron
Updated•18 years ago
|
Group: security
Whiteboard: [sg:critical?]
Updated•18 years ago
|
Whiteboard: [sg:critical?] → [sg:critical?] [at risk] needs patch
Comment 24•18 years ago
|
||
dbaron is away on travel and we need traction here if it's going to make
1.8.0.9/1.8.1.1. Who else can take this bug?
Anyone in this bug willing to put together a patch?
Assignee | ||
Comment 25•18 years ago
|
||
It's a buffer overflow in nsWindow::Data8BitTo1Bit:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/widget/src/windows/nsWindow.cpp&rev=MOZILLA_1_8_BRANCH&root=/cvsroot&mark=2881,2896,2908,2909#2876
For example, for a 34x16 image we allocate 64 bytes (4 bytes per row)
for 'outData' - this is one byte per row to small.
Assignee | ||
Comment 26•18 years ago
|
||
The style change is needed in a debug build...
Assignee: dbaron → mats.palmgren
Attachment #239498 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #247143 -
Flags: superreview?(cbiesinger)
Attachment #247143 -
Flags: review?(cbiesinger)
Updated•18 years ago
|
Whiteboard: [sg:critical?] [at risk] needs patch → [sg:critical?] [at risk] needs review (cbiesinger)
Comment 27•18 years ago
|
||
Comment on attachment 247143 [details] [diff] [review]
Patch
oops, thanks for catching this.
r+sr=biesi on the nsWindow.cpp change
please get dbaron or bz to review the second part, it is not obvious to me why it is correct
Attachment #247143 -
Flags: superreview?(cbiesinger)
Attachment #247143 -
Flags: superreview+
Attachment #247143 -
Flags: review?(cbiesinger)
Attachment #247143 -
Flags: review+
Comment 28•18 years ago
|
||
and, thanks for finding this!
Assignee | ||
Comment 29•18 years ago
|
||
(In reply to comment #27)
> please get dbaron or bz to review the second part, it is not obvious to me
> why it is correct
Bug 303812 fixed this on trunk and it's DEBUG only so I'm skipping this part.
I searched widget/ for similar allocation expressions and I've found
one more that looks suspicious:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/widget/src/windows/nsWindow.cpp&rev=3.676&root=/cvsroot&mark=2761#2757
We don't write past the end but maybe DataToBitmap() will read
past the end? It seems to me we should have the same change here.
What do you think?
Comment 30•18 years ago
|
||
Yes, please fix up CreateOpaqueAlphaChannel also sr=dveditz for the same change, I'm sure biesi would agree.
Whiteboard: [sg:critical?] [at risk] needs review (cbiesinger) → [sg:critical] needs approval
Comment 31•18 years ago
|
||
Comment on attachment 247143 [details] [diff] [review]
Patch
approved for 1.8/1.8.0 branches, a=dveditz
Attachment #247143 -
Flags: approval1.8.1.1+
Attachment #247143 -
Flags: approval1.8.0.9+
Updated•18 years ago
|
Whiteboard: [sg:critical] needs approval → [sg:critical] needs check-in
Comment 32•18 years ago
|
||
Actually... the new code is wrong too... the old code ensured that outBpr was a multiple of 4. That is still needed, because that's what HBITMAPs need.
(but yeah, I do agree that CreateOpaqueAlphaChannel needs this too)
Assignee | ||
Comment 33•18 years ago
|
||
This patch restores the padding requirement.
So, the number of bytes we need for the copying is:
(aWidth + 7) / 8
and to pad that to the next 4-byte boundary:
(((aWidth + 7) / 8) + 3) & ~3
which is equivalent to:
((aWidth + 31) / 8) & ~3
Do we have any requirements on the value of the pad bytes?
I guess CreateDIBitmap shouldn't use them, but I don't know.
(Data8BitTo1Bit leaves them uninitialized with this patch, as before.)
Attachment #247143 -
Attachment is obsolete: true
Attachment #247280 -
Flags: superreview?(cbiesinger)
Attachment #247280 -
Flags: review?(cbiesinger)
Assignee | ||
Comment 34•18 years ago
|
||
A variant of rev.2 with initialized padding... in case you prefer this.
Comment 35•18 years ago
|
||
Comment on attachment 247280 [details] [diff] [review]
Patch rev. 2
don't think we need to initialize the padding
Attachment #247280 -
Flags: superreview?(cbiesinger)
Attachment #247280 -
Flags: superreview+
Attachment #247280 -
Flags: review?(cbiesinger)
Attachment #247280 -
Flags: review+
Comment 36•18 years ago
|
||
Attachment #247143 -
Flags: superreview+
Attachment #247143 -
Flags: review-
Attachment #247143 -
Flags: review+
Attachment #247143 -
Flags: approval1.8.1.1+
Attachment #247143 -
Flags: approval1.8.0.9+
Comment 37•18 years ago
|
||
Comment on attachment 247280 [details] [diff] [review]
Patch rev. 2
approved for 1.8/1.8.0 branches, a=dveditz
Please add a comment explaining the cryptic math, especially the bit about the non-obvious HBITMAP requirement.
"HBITMAPs require the buffer to be padded to a multiple of 4 bytes" is probably good enough, unless you also want to include the intermediate calculation "(((aWidth + 7) / 8) + 3) & ~3" in the comment
Attachment #247280 -
Flags: approval1.8.1.1+
Attachment #247280 -
Flags: approval1.8.0.9+
Comment 38•18 years ago
|
||
s/the buffer/each row/?
Comment 39•18 years ago
|
||
btw, in case you want a reference for that requirement:
http://msdn2.microsoft.com/en-us/library/ms532284.aspx
"The bits in the array are packed together, but each scan line must be padded with zeroes to end on a LONG data-type boundary."
and now that I've looked this up, it sounds like the padding does need to be initialized, doesn't it...
Assignee | ||
Comment 40•18 years ago
|
||
With comments and zeroing the padding.
Attachment #247280 -
Attachment is obsolete: true
Attachment #247281 -
Attachment is obsolete: true
Attachment #247375 -
Flags: superreview?(cbiesinger)
Attachment #247375 -
Flags: review?(cbiesinger)
Comment 41•18 years ago
|
||
Comment on attachment 247375 [details] [diff] [review]
Patch rev. 3
sr=dveditz
Attachment #247375 -
Flags: superreview?(cbiesinger)
Attachment #247375 -
Flags: superreview+
Attachment #247375 -
Flags: approval1.8.1.1?
Attachment #247375 -
Flags: approval1.8.0.9?
Comment 42•18 years ago
|
||
Comment on attachment 247375 [details] [diff] [review]
Patch rev. 3
This addresses biesi's review comments, approved for 1.8/1.8.0 branches. a=dveditz for drivers
Attachment #247375 -
Flags: approval1.8.1.1?
Attachment #247375 -
Flags: approval1.8.1.1+
Attachment #247375 -
Flags: approval1.8.0.9?
Attachment #247375 -
Flags: approval1.8.0.9+
Updated•18 years ago
|
Attachment #247280 -
Flags: approval1.8.1.1+
Attachment #247280 -
Flags: approval1.8.0.9+
Comment 43•18 years ago
|
||
Checked in attachment 247375 [details] [diff] [review] to the 1.8 and 1.8.0 branches. Still need a trunk check-in, and we're presuming biesi will OK it so there may need to be some branch adjustment too.
Keywords: fixed1.8.0.9,
fixed1.8.1.1
Comment 44•18 years ago
|
||
Comment on attachment 247375 [details] [diff] [review]
Patch rev. 3
looks good now, thanks. sorry that this took so many iterations...
Attachment #247375 -
Flags: review?(cbiesinger) → review+
Assignee | ||
Comment 45•18 years ago
|
||
Checked in to trunk at 2006-12-04 15:47 PST.
-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: blocking1.9?
Resolution: --- → FIXED
Whiteboard: [sg:critical] needs check-in → [sg:critical]
Comment 46•18 years ago
|
||
verified fixed 1.8.0.9, 1.8.1.1, 1.9 windows
no crash on 1.8.0.9, 1.8.1.1, 1.9 linux/macppc
Status: RESOLVED → VERIFIED
Updated•18 years ago
|
Group: security
Updated•14 years ago
|
Crash Signature: [@ ntdll.dll + 0x11e58]
[@ JS_ArenaAllocate]
You need to log in
before you can comment on or make changes to this bug.
Description
•