Closed Bug 1206720 Opened 9 years ago Closed 9 years ago

Assertion failure: pctx (Called for document with no prescontext), at c:/Users/mozilla/debug-builds/ mozilla-central/dom/html/HTMLSourceElement.cpp:77

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: cbook, Assigned: mikokm, Mentored)

References

()

Details

(Keywords: assertion, Whiteboard: [lang=c++][good first bug])

Attachments

(2 files, 1 obsolete file)

Attached file bughunter crash stack
Found via bughunter and reproduced on a Windows 7 Trunk Debug Build.

Steps to reproduce:

Load http://sigmasport.com/de/produkte/fahrrad-computer/rox/wireless/rox-10-0-gps

--> 

Assertion failure: pctx (Called for document with no prescontext), at c:/Users/mozilla/debug-builds/
mozilla-central/dom/html/HTMLSourceElement.cpp:77
#01: mozilla::dom::HTMLImageElement::SelectSourceForTagWithAttrs (c:\users\mozilla\debug-builds\mozi
lla-central\dom\html\htmlimageelement.cpp:1260)
#02: nsDocument::PreloadPictureImageSource (c:\users\mozilla\debug-builds\mozilla-central\dom\base\n
sdocument.cpp:9684)
#03: nsHtml5SpeculativeLoad::Perform (c:\users\mozilla\debug-builds\mozilla-central\parser\html\nsht
ml5speculativeload.cpp:45)
#04: nsHtml5TreeOpExecutor::RunFlushLoop (c:\users\mozilla\debug-builds\mozilla-central\parser\html\
nshtml5treeopexecutor.cpp:397)
#05: nsHtml5ExecutorFlusher::Run (c:\users\mozilla\debug-builds\mozilla-central\parser\html\nshtml5s
treamparser.cpp:129)
#06: nsThread::ProcessNextEvent (c:\users\mozilla\debug-builds\mozilla-central\xpcom\threads\nsthrea
d.cpp:950)
#07: NS_ProcessNextEvent (c:\users\mozilla\debug-builds\mozilla-central\xpcom\glue\nsthreadutils.cpp
:277)
#08: mozilla::ipc::MessagePump::Run (c:\users\mozilla\debug-builds\mozilla-central\ipc\glue\messagep
ump.cpp:95)
#09: MessageLoop::RunInternal (c:\users\mozilla\debug-builds\mozilla-central\ipc\chromium\src\base\m
essage_loop.cc:234)
#10: MessageLoop::RunHandler (c:\users\mozilla\debug-builds\mozilla-central\ipc\chromium\src\base\me
ssage_loop.cc:228)
#11: MessageLoop::Run (c:\users\mozilla\debug-builds\mozilla-central\ipc\chromium\src\base\message_l
oop.cc:202)
#12: nsBaseAppShell::Run (c:\users\mozilla\debug-builds\mozilla-central\widget\nsbaseappshell.cpp:15
8)
#13: nsAppShell::Run (c:\users\mozilla\debug-builds\mozilla-central\widget\windows\nsappshell.cpp:18
0)
#14: nsAppStartup::Run (c:\users\mozilla\debug-builds\mozilla-central\toolkit\components\startup\nsa
ppstartup.cpp:282)
#15: XREMain::XRE_mainRun (c:\users\mozilla\debug-builds\mozilla-central\toolkit\xre\nsapprunner.cpp
:4291)
#16: XREMain::XRE_main (c:\users\mozilla\debug-builds\mozilla-central\toolkit\xre\nsapprunner.cpp:43
84)
#17: XRE_main (c:\users\mozilla\debug-builds\mozilla-central\toolkit\xre\nsapprunner.cpp:4486)
#18: do_main (c:\users\mozilla\debug-builds\mozilla-central\browser\app\nsbrowserapp.cpp:212)
#19: NS_internal_main (c:\users\mozilla\debug-builds\mozilla-central\browser\app\nsbrowserapp.cpp:39
9)
#20: wmain (c:\users\mozilla\debug-builds\mozilla-central\toolkit\xre\nswindowswmain.cpp:138)
#21: __tmainCRTStartup (f:\dd\vctools\crt\crtw32\startup\crt0.c:255)
#22: BaseThreadInitThunk[kernel32 +0x4ee1c]
#23: RtlInitializeExceptionChain[ntdll +0x637eb]
#24: RtlInitializeExceptionChain[ntdll +0x637be]
Component: General → DOM
This assertion just looks bogus.  Why would there be a prescontext, necessarily?

Alternately, HTMLImageElement::SelectSourceForTagWithAttrs needs to bail out if there is no presentation...
Flags: needinfo?(josh)
Agreed. This should be a straightforward improvement by removing the assertion, since the code in HTMLSourceElement::WouldMatchMediaForDocument already handles the case where pctx is null.

Code: dom/html/HTMLSourceElement.cpp
Mentor: josh
Flags: needinfo?(josh)
Whiteboard: [lang=c++][good first bug]
Attached patch Assertion failure on null pctx (obsolete) — Splinter Review
Comment on attachment 8667863 [details] [diff] [review]
Assertion failure on null pctx

Removed the mentioned assert, as well as another one triggering in dom/base/ResponsiveImageSelector.cpp.
Attachment #8667863 - Flags: review?(josh)
Comment on attachment 8667863 [details] [diff] [review]
Assertion failure on null pctx

Review of attachment 8667863 [details] [diff] [review]:
-----------------------------------------------------------------

Lovely! Please attach a commit message like "Bug 1206720 - Remove invalid assertions during response image loading. r=jdm" which describes the change being made. Please apply for access to our testing servers, too: https://www.mozilla.org/en-US/about/governance/policies/commit/
Attachment #8667863 - Flags: review?(josh) → review+
Attachment #8667863 - Attachment is obsolete: true
Assignee: nobody → mikokm
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/bb9b286f553b
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: