Closed Bug 1210321 Opened 9 years ago Closed 9 years ago

Assertion failure: aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType) (We should only see external content policy types here.)

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: mtseng, Assigned: mtseng)

References

Details

Attachments

(1 file, 1 obsolete file)

I got this failure when implementing bug 709490. See treeherder for detail:
https://treeherder.mozilla.org/logviewer.html#?job_id=14885350&repo=mozilla-inbound

Call stack on top 10 frame as following:
 06:00:27     INFO -   0  libxul.so!nsDataDocumentContentPolicy::ShouldLoad [nsDataDocumentContentPolicy.cpp:009bf768c97c : 49 + 0x2]
 06:00:27     INFO -       r0 = 0x00000112    r1 = 0xc22d2127    r2 = 0xc22d2127    r3 = 0x00000000
 06:00:27     INFO -       r4 = 0x00000025    r5 = 0x629a98c0    r6 = 0x52cfe160    r7 = 0x52cfe1cc
 06:00:27     INFO -       r8 = 0x52cfe164    r9 = 0x52cfe174   r10 = 0x629a98c0   r12 = 0x00000003
 06:00:27     INFO -       fp = 0x00000025    sp = 0x52cfe0f8    lr = 0x5919f423    pc = 0x591b086a
 06:00:27     INFO -      Found by: given as instruction pointer in context
 06:00:27     INFO -   1  libxul.so!NS_CheckContentLoadPolicy [nsContentPolicyUtils.h:009bf768c97c : 232 + 0x15]
 06:00:27     INFO -       r4 = 0x591b0845    r5 = 0x52cfe15c    r6 = 0x52cfe160    r7 = 0x62686e00
 06:00:27     INFO -       r8 = 0x52cfe164    r9 = 0x52cfe174   r10 = 0x629a98c0    fp = 0x00000025
 06:00:27     INFO -       sp = 0x52cfe138    pc = 0x58f804ef
 06:00:27     INFO -      Found by: call frame info
 06:00:27     INFO -   2  libxul.so!nsContentUtils::CanLoadImage [nsContentUtils.cpp:009bf768c97c : 3034 + 0xf]
 06:00:27     INFO -       r4 = 0x00000000    r5 = 0x52cfe1cc    r6 = 0x5b3e7998    r7 = 0x00000000
 06:00:27     INFO -       r8 = 0x629a98c0    r9 = 0x52a39c28   r10 = 0x62686e00    fp = 0x52cfe1c4
 06:00:27     INFO -       sp = 0x52cfe1a0    pc = 0x590ee215
 06:00:27     INFO -      Found by: call frame info
 06:00:27     INFO -   3  libxul.so!mozilla::css::ImageLoader::LoadImage [ImageLoader.cpp:009bf768c97c : 261 + 0x11]
 06:00:27     INFO -       r4 = 0x52cfe224    r5 = 0x629a66a0    r6 = 0x00000000    r7 = 0x52a39c28
 06:00:27     INFO -       r8 = 0x6399cc1c    r9 = 0x629a98c0   r10 = 0x52a39c28    fp = 0x6082ebd0
 06:00:27     INFO -       sp = 0x52cfe1f8    pc = 0x59b2d0cb
 06:00:27     INFO -      Found by: call frame info
 06:00:27     INFO -   4  libxul.so!mozilla::css::ImageValue::ImageValue [nsCSSValue.cpp:009bf768c97c : 2437 + 0x7]
 06:00:27     INFO -       r4 = 0x6399cc00    r5 = 0x62686e00    r6 = 0x62686e00    r7 = 0x52a39c28
 06:00:27     INFO -       r8 = 0x609fae40    r9 = 0x629a98c0   r10 = 0x52a39c28    fp = 0x6082ebd0
 06:00:27     INFO -       sp = 0x52cfe258    pc = 0x59b70deb
 06:00:27     INFO -      Found by: call frame info
 06:00:27     INFO -   5  libxul.so!nsCSSValue::StartImageLoad [nsCSSValue.cpp:009bf768c97c : 710 + 0x3]
 06:00:27     INFO -       r4 = 0x6081aa88    r5 = 0x6399cc00    r6 = 0x609fae40    r7 = 0x627cdc20
 06:00:27     INFO -       r8 = 0x629a98c0    r9 = 0x62686e00   r10 = 0x52a39c28    fp = 0x6082ebd0
 06:00:27     INFO -       sp = 0x52cfe280    pc = 0x59b759d1
 06:00:27     INFO -      Found by: call frame info
 06:00:27     INFO -   6  libxul.so!TryToStartImageLoadOnValue [nsCSSDataBlock.cpp:009bf768c97c : 62 + 0x5]
 06:00:27     INFO -       r4 = 0x6081aa88    r5 = 0x62686e00    r6 = 0x609fde98    r7 = 0x00000012
 06:00:27     INFO -       r8 = 0x00000000    r9 = 0x00000001   r10 = 0x52cfe30c    fp = 0x6082ebd0
 06:00:27     INFO -       sp = 0x52cfe2a8    pc = 0x59b4ab77
 06:00:27     INFO -      Found by: call frame info
 06:00:27     INFO -   7  libxul.so!TryToStartImageLoad [nsCSSDataBlock.cpp:009bf768c97c : 98 + 0xf]
 06:00:27     INFO -       r4 = 0x00000012    r5 = 0x6081aa88    r6 = 0x609fde98    r7 = 0x62686e00
 06:00:27     INFO -       r8 = 0x00000000    r9 = 0x00000001   r10 = 0x52cfe30c    fp = 0x6082ebd0
 06:00:27     INFO -       sp = 0x52cfe2c0    pc = 0x59b4ac5b
 06:00:27     INFO -      Found by: call frame info
 06:00:27     INFO -   8  libxul.so!MapSinglePropertyInto [nsCSSDataBlock.cpp:009bf768c97c : 149 + 0x5]
 06:00:27     INFO -       r4 = 0x52cfe368    r5 = 0x52cfe3d8    r6 = 0x00000012    r7 = 0x6081cf30
 06:00:27     INFO -       r8 = 0x00000035    r9 = 0x00000001   r10 = 0x52cfe30c    fp = 0x6082ebd0
 06:00:27     INFO -       sp = 0x52cfe2e0    pc = 0x59b4ad69
 06:00:27     INFO -      Found by: call frame info
 06:00:27     INFO -   9  libxul.so!nsCSSCompressedDataBlock::MapRuleInfoInto [nsCSSDataBlock.cpp:009bf768c97c : 274 + 0x7]
 06:00:27     INFO -       r4 = 0x52cfe3d8    r5 = 0x00000001    r6 = 0x6081cf20    r7 = 0x52cfe368
 06:00:27     INFO -       r8 = 0x5af6ab6c    r9 = 0x00000001   r10 = 0x52cfe30c    fp = 0x6082ebd0
 06:00:27     INFO -       sp = 0x52cfe308    pc = 0x59b4ae4d
 06:00:27     INFO -      Found by: call frame info
 06:00:27     INFO -  10  libxul.so!mozilla::css::StyleRule::MapRuleInfoInto [Declaration.h:009bf768c97c : 175 + 0x5]
 06:00:27     INFO -       r4 = 0x60838000    r5 = 0x6081cf20    r6 = 0x52cfe3d8    r7 = 0x52cfe3a0
 06:00:27     INFO -       r8 = 0x00000000    r9 = 0x00000000   r10 = 0x609fde70    fp = 0x6082ebd0
 06:00:27     INFO -       sp = 0x52cfe330    pc = 0x59b4aea5
 06:00:27     INFO -      Found by: call frame info
According to call stack, ShuoldLoad will assert which means we should pass external type to ShoudlLoad function. So I convert it from internal type to external type before calling ShouldLoad. Is it right solution?
Attachment #8668324 - Flags: review?(amarchesini)
Assignee: nobody → mtseng
Status: NEW → ASSIGNED
Comment on attachment 8668324 [details] [diff] [review]
Convert to external type before calling action.

Smaug, can you help me with this?
Attachment #8668324 - Flags: review?(amarchesini) → review?(bugs)
This is a regression from bug 1048048.
I don't understand why that bug uses TYPE_INTERNAL_IMAGE, when the assertion says we should use
TYPE_IMAGE.
So either the assertion is wrong, or the patch for bug 1048048 is wrong.
Blocks: 1048048
Flags: needinfo?(mozilla)
Comment on attachment 8668324 [details] [diff] [review]
Convert to external type before calling action.

I'll let christoph to deal with this, since I don't understand the reasoning for 
nsIContentPolicy::TYPE_INTERNAL_IMAGE usage.
Attachment #8668324 - Flags: review?(bugs)
Comment on attachment 8668324 [details] [diff] [review]
Convert to external type before calling action.

Oh, I see. Yes, we do have this special data document handling, and we do similar
nsContentUtils::InternalContentPolicyTypeToExternal in nsContentPolicy::CheckPolicy for other policies.
Attachment #8668324 - Flags: review+
Flags: needinfo?(mozilla)
(In reply to Olli Pettay [:smaug] from comment #5)
> Oh, I see. Yes, we do have this special data document handling, and we do
> similar
> nsContentUtils::InternalContentPolicyTypeToExternal in
> nsContentPolicy::CheckPolicy for other policies.

Thanks for fixing - this is indeed the right thing to do and convert the internal type to the external one before consulting the policy.
https://hg.mozilla.org/mozilla-central/rev/4657e5ff5186
Status: ASSIGNED → 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: