Closed
Bug 1508044
Opened 6 years ago
Closed 6 years ago
Assertion failure: !mIsThirdPartyTrackingResource, at netwerk/protocol/http/HttpBaseChannel.cpp:332
Categories
(Toolkit :: Safe Browsing, defect, P1)
Toolkit
Safe Browsing
Tracking
()
VERIFIED
FIXED
mozilla65
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox63 | --- | unaffected |
firefox64 | --- | unaffected |
firefox65 | --- | fixed |
People
(Reporter: bc, Assigned: ehsan.akhgari)
References
(Depends on 1 open bug, )
Details
(Keywords: assertion, regression, Whiteboard: [privacy65][triage])
Attachments
(9 files)
18.83 KB,
text/plain
|
Details | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
5.20 KB,
text/plain
|
Details | |
102.39 KB,
text/plain
|
Details | |
101.30 KB,
text/plain
|
Details | |
2.95 MB,
application/x-bzip
|
Details | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
https://www.youtube.com/?gl=FR&hl=fr
Firefox Nightly 65 / Linux. Not Beta 64.
Assertion failure: !mIsThirdPartyTrackingResource, at netwerk/protocol/http/HttpBaseChannel.cpp:332
#01: mozilla::net::HttpBackgroundChannelChild::RecvNotifyTrackingResource(bool const&) (netwerk/protocol/http/HttpBackgroundChannelChild.cpp:382)
#02: mozilla::net::PHttpBackgroundChannelChild::OnMessageReceived(IPC::Message const&) (firefox-debug/dist/include/mozilla/ipc/ProtocolUtils.h:397)
#03: mozilla::ipc::PBackgroundChild::OnMessageReceived(IPC::Message const&) (firefox-debug/ipc/ipdl/PBackgroundChild.cpp:2280)
#04: mozilla::ipc::MessageChannel::AutoSetValue<int>::~AutoSetValue() (firefox-debug/dist/include/mozilla/ipc/MessageChannel.h:669)
#05: mozilla::ipc::MessageChannel::DispatchMessage(IPC::Message&&) (ipc/glue/MessageChannel.cpp:2171)
#06: mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::MessageChannel::MessageTask&) (ipc/glue/MessageChannel.cpp:2009)
#07: mozilla::ipc::MessageChannel::MessageTask::Run() (firefox-debug/dist/include/mozilla/Monitor.h:37)
#08: nsThread::ProcessNextEvent(bool, bool*) (xpcom/threads/nsThread.cpp:1231)
#09: NS_ProcessNextEvent(nsIThread*, bool) (xpcom/threads/nsThreadUtils.cpp:530)
[C
Reporter | ||
Comment 1•6 years ago
|
||
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=7508d586f2c875555b6f79ad8d92057a53013229&tochange=3f5f46ca8ca0df1c34a9077fd4b479e291997a3f
https://hg.mozilla.org/integration/autoland/rev/3f5f46ca8ca0
+#ifdef NIGHTLY_BUILD
+// Use the strict list for the default cookie restrictions in Nightly
+pref("urlclassifier.trackingAnnotationTable", "test-track-simple,base-track-digest256,content-track-digest256");
+#else
Comment 2•6 years ago
|
||
Ehsan, do you want to take a look at this crash?
Assignee | ||
Comment 3•6 years ago
|
||
I couldn't reproduce this. Bob, do you have any tips for how to reproduce?
Flags: needinfo?(ehsan) → needinfo?(bob)
Assignee | ||
Comment 4•6 years ago
|
||
In the log, we have:
[Parent 14271, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004001: file dom/base/ThirdPartyUtil.cpp, line 196
Assertion failure: !mIsThirdPartyTrackingResource, at netwerk/protocol/http/HttpBaseChannel.cpp:332
The failure is from <https://searchfox.org/mozilla-central/rev/876022232b15425bb9efde189caf747823b39567/netwerk/base/nsChannelClassifier.cpp#322>. This tells me that this is related to bug 1456486. Does that sound like a good assessment, Francois?
Depends on: 1456486
Comment 5•6 years ago
|
||
Based on the assertion: https://searchfox.org/mozilla-central/rev/876022232b15425bb9efde189caf747823b39567/netwerk/protocol/http/HttpBaseChannel.cpp#332
it looks like we call SetTracking twice for the same channel but with a different value for aIsThirdParty.
Another good reason to check the return values in the bug you linked to :)
Reporter | ||
Comment 6•6 years ago
|
||
Try this at least on Linux.
mkdir /tmp/profile
firefox -profile /tmp/profile
should crash on load. Using an existing profile is much less reproducible.
Flags: needinfo?(bob)
Assignee | ||
Comment 7•6 years ago
|
||
Aha, nice, that did the trick, thanks!
Assignee | ||
Comment 8•6 years ago
|
||
Oh hmm I reproduced a different crash actually...
Assignee | ||
Comment 9•6 years ago
|
||
May I ask which country you were running Firefox from? It could be the interesting tracker is geo-specific...
Flags: needinfo?(bob)
Assignee | ||
Comment 10•6 years ago
|
||
Or alternatively, can you please try out this patch to see if it fixes the crash?
Assignee | ||
Comment 11•6 years ago
|
||
Reporter | ||
Comment 12•6 years ago
|
||
US East Coast either from my home or the mdc2 data center.
Reproduced the original before your patch and got a different assertion with your patch:
Assertion failure: spec.LowerCaseEqualsLiteral("about:blank") || StringBeginsWith(spec, static_cast<const nsLiteralCString&>(nsLiteralCString("" "blob:"))) || nsContentUtils::StorageAllowedForWindow(aInnerWindow) == nsContentUtils::StorageAccess::eAllow>
#
Flags: needinfo?(bob)
Updated•6 years ago
|
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Component: Tracking Protection → Safe Browsing
Priority: -- → P1
Product: Firefox → Toolkit
Assignee | ||
Comment 13•6 years ago
|
||
Great! I think that means that my patch does indeed fix the bug you're seeing. The second assertion is bug 1503787 which is unrelated (but important). I'd appreciate if you could comment there so that Andrea could take a look. (He has been trying to find a reproducible test case for that bug!)
See Also: → 1503787
Assignee | ||
Comment 14•6 years ago
|
||
Hmm, this seems to be a lot more complex than I thought:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=96102450def87f80812469fb632eb6cf49f5d2b2
On try we're actually hitting the assertion in comment 12. Among other failures.
Perhaps this shows you can't just fix the problem for some of the call sites. :-(
Assignee | ||
Comment 15•6 years ago
|
||
This new version of the patch that I just uploaded should be a proper fix. Can you please test this one Bob?
(Sorry to keep asking, I still have had no chance to reproduce the bug! Thank you.)
Flags: needinfo?(bob)
Reporter | ||
Comment 16•6 years ago
|
||
A quick rebuild after manipulating the patches via mq still reproduced the original assertion. I'm not sure if this is just a failure to rebuild properly. I'll clobber and rebuild. It takes me 45-60 minutes for a clobber build. I'll let you know when it is ready.
Assignee | ||
Comment 17•6 years ago
|
||
Thank you for doing this, I highly suspect something could have gone wrong there...
Reporter | ||
Comment 18•6 years ago
|
||
After a fresh pull and clobber...
Assertion failure: !mIsThirdPartyTrackingResource, at /home/bclary/mozilla/builds/nightly/mozilla/netwerk/protocol/http/HttpBaseChannel.cpp:332
#01: mozilla::net::HttpBackgroundChannelChild::RecvNotifyTrackingResource(bool const&) (/home/bclary/mozilla/builds/nightly/mozilla/netwerk/protocol/http/HttpBackgroundChannelChild.cpp:397)
#02: mozilla::net::PHttpBackgroundChannelChild::OnMessageReceived(IPC::Message const&) (/home/bclary/mozilla/builds/nightly/mozilla/firefox-debug/dist/include/mozilla/ipc/ProtocolUtils.h:397)
#03: mozilla::ipc::MessageChannel::AutoSetValue<int>::~AutoSetValue() (/home/bclary/mozilla/builds/nightly/mozilla/firefox-debug/dist/include/mozilla/ipc/MessageChannel.h:669)
#04: mozilla::ipc::MessageChannel::DispatchMessage(IPC::Message&&) (/home/bclary/mozilla/builds/nightly/mozilla/ipc/glue/MessageChannel.cpp:2173)
#05: mozilla::ipc::MessageChannel::MessageTask::Run() (/home/bclary/mozilla/builds/nightly/mozilla/firefox-debug/dist/include/mozilla/Monitor.h:37)
#06: nsThread::ProcessNextEvent(bool, bool*) (/home/bclary/mozilla/builds/nightly/mozilla/xpcom/threads/nsThread.cpp:1231)
#07: NS_ProcessNextEvent(nsIThread*, bool) (/home/bclary/mozilla/builds/nightly/mozilla/xpcom/threads/nsThreadUtils.cpp:530)
#08: mozilla::net::nsSocketTransportService::Run() (/home/bclary/mozilla/builds/nightly/mozilla/netwerk/base/nsSocketTransportService2.cpp:1083)
#09: non-virtual thunk to mozilla::net::nsSocketTransportService::Run() (:?)
#10: nsThread::ProcessNextEvent(bool, bool*) (/home/bclary/mozilla/builds/nightly/mozilla/xpcom/threads/nsThread.cpp:1231)
#11: NS_ProcessNextEvent(nsIThread*, bool) (/home/bclary/mozilla/builds/nightly/mozilla/xpcom/threads/nsThreadUtils.cpp:530)
#12: mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) (/home/bclary/mozilla/builds/nightly/mozilla/ipc/glue/MessagePump.cpp:334)
#13: MessageLoop::AutoRunState::~AutoRunState() (/home/bclary/mozilla/builds/nightly/mozilla/ipc/chromium/src/base/message_loop.cc:598)
#14: nsThread::ThreadFunc(void*) (/home/bclary/mozilla/builds/nightly/mozilla/xpcom/threads/nsThread.cpp:505)
Flags: needinfo?(bob)
Reporter | ||
Comment 19•6 years ago
|
||
This might help with more context.
Assignee | ||
Comment 20•6 years ago
|
||
Interesting. Any chance you could run with this environment variable?
MOZ_LOG=nsChannelClassifier:5,thirdPartyUtil:5
My guess is that the top window URI is null here...
(I'd like to land this patch for now but I suspect a follow-up may be needed.)
Keywords: leave-open
Comment 21•6 years ago
|
||
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d4db66eb83f9
Check the return values of mozIThirdPartyUtil::IsThirdPartyFoo() in IsThirdParty() inside nsChannelClassifier.cpp r=francois
Comment 22•6 years ago
|
||
bugherder |
Reporter | ||
Comment 23•6 years ago
|
||
from my build with your patch and a fresh empty profile again....
$ echo $MOZ_LOG
nsChannelClassifier:5,thirdPartyUtil:5
Assignee | ||
Comment 24•6 years ago
|
||
Hmm, weird. There is no log in the output at all. Did you export MOZ_LOG? Perhaps also try passing MOZ_LOG_FILES=foo.txt to see if you get log files generated and attach them here (both for the parent and child processes).
I looked at https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Gecko_Logging to see what could be wrong but didn't find anything helpful.
(BTW do you mind adding in nsHttp:5 to the MOZ_LOG variable too? I realized that one will be useful to have as well.)
Last but not least I have been trying to reproduce this with a US-based VPN, still without luck. :-(
Assignee | ||
Comment 25•6 years ago
|
||
Wow, I can totally reproduce if I don't run under rr!
Assignee | ||
Comment 26•6 years ago
|
||
Assignee | ||
Comment 27•6 years ago
|
||
OK, the first call to SetIsTrackingResource() comes from here: <https://searchfox.org/mozilla-central/rev/6d748c47a82f59d75c22bf301177ad8fb10f786b/netwerk/protocol/http/TrackingDummyChannelChild.cpp#94>. Here mIsThirdParty is true. It comes from <https://searchfox.org/mozilla-central/rev/6d748c47a82f59d75c22bf301177ad8fb10f786b/dom/base/nsContentUtils.cpp#8984> where proper error checking isn't happening.
The second call is coming from <https://searchfox.org/mozilla-central/rev/6d748c47a82f59d75c22bf301177ad8fb10f786b/netwerk/protocol/http/HttpChannelChild.cpp#2105> with the correct value of aIsThirdParty but we assert because of that.
Assignee | ||
Comment 28•6 years ago
|
||
(The reason this is triggered by the strict list is that the interesting channel is a youtube.com channel under a third-party which is itself under youtube.com, and youtube.com is on the strict list.
Assignee | ||
Comment 29•6 years ago
|
||
But merely adding error checking doesn't fix the problem. The real issue here is that the nature of the third-party check done on the channel here is different than what is done on the channel classifier call site. Fixing that discrepancy fixes this assertion.
I have a patch series that unifies the two, pushed it to try to fix any possible test fixes and will then submit it for review.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=06a2e659e560fd2577fce2376c8e6185a970e7b6
Thanks a lot Bob for your help in figuring this out!
Assignee | ||
Updated•6 years ago
|
Keywords: leave-open
Assignee | ||
Comment 30•6 years ago
|
||
Assignee | ||
Comment 31•6 years ago
|
||
Depends on D12852
Assignee | ||
Comment 32•6 years ago
|
||
Depends on D12853
Comment 33•6 years ago
|
||
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5452c9164d46
Part 2: Check the return values of mozIThirdPartyUtil::IsThirdPartyFoo() in nsContentUtils::IsThirdPartyWindowOrChannel() r=francois
https://hg.mozilla.org/integration/autoland/rev/691286d50c87
Part 3: Ensure that the third-party checks performed on channels in nsContentUtils::IsThirdPartyWindowOrChannel() follow the same logic as those performed in nsChannelClassifier r=francois
https://hg.mozilla.org/integration/autoland/rev/e3a074ae3f0c
Part 4: Make nsChannelClassifier use nsContentUtils::IsThirdPartyWindowOrChannel() in order to avoid having duplicated logic r=francois
Comment 34•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5452c9164d46
https://hg.mozilla.org/mozilla-central/rev/691286d50c87
https://hg.mozilla.org/mozilla-central/rev/e3a074ae3f0c
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Comment 35•6 years ago
|
||
> Reproduced the original before your patch and got a different assertion with
> your patch:
Are you still able to reproduce it consistently? if yes, do you have a STR starting from a clean profile?
Flags: needinfo?(bob)
Reporter | ||
Comment 36•6 years ago
|
||
no longer reproduces for me locally and I haven't seen it in automation since the fix landed. Thanks!
Status: RESOLVED → VERIFIED
Flags: needinfo?(bob)
Assignee | ||
Comment 37•6 years ago
|
||
Thanks a lot for testing again!
Updated•6 years ago
|
status-firefox63:
--- → unaffected
status-firefox64:
--- → unaffected
status-firefox-esr60:
--- → unaffected
You need to log in
before you can comment on or make changes to this bug.
Description
•