Closed Bug 1266974 Opened 8 years ago Closed 4 years ago

e10s - Right click -> Save Link As... sometimes doesn't work with AdBlock Plus enabled (unsafe cpow)

Categories

(Toolkit :: General, defect, P3)

x86_64
Linux
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
e10s + ---
firefox48 --- affected

People

(Reporter: marco, Unassigned)

References

Details

I see the following error in the browser console:
unsafe CPOW usage forbidden
continueSave()                  contentAreaUtils.js:464
internalSave/<()                contentAreaUtils.js:444
Handler.prototype.process()     Promise-backend.js:937
this.PromiseWalker.walkerLoop() Promise-backend.js:816
bound ()                        self-hosted
bound bound ()                  self-hosted

contentAreaUtils.js:464 is the 4th line here:
    let isPrivate = aIsContentWindowPrivate;
    if (isPrivate === undefined) {
      isPrivate = aInitiatingDocument instanceof Components.interfaces.nsIDOMDocument
        ? PrivateBrowsingUtils.isContentWindowPrivate(aInitiatingDocument.defaultView)
        : aInitiatingDocument.isPrivate;
    }
Component: Untriaged → General
Component: General → Menus
tracking-e10s: --- → ?
Summary: Right click -> Save As... sometimes doesn't work → e10s - Right click -> Save As... sometimes doesn't work (unsafe cpow)
Hey marco,

Can you give some more specific STR? What type of content did you right-click on and attempt to save? Were you in a private browsing window at the time, or a normal browsing window?
Flags: needinfo?(mcastelluccio)
The tab wasn't in a private window, although IIRC there was a private window opened.

I was trying to download one of the video recordings from http://video.fosdem.org/2016/.
Flags: needinfo?(mcastelluccio)
(In reply to Marco Castelluccio [:marco] from comment #2)
> The tab wasn't in a private window, although IIRC there was a private window
> opened.
> 
> I was trying to download one of the video recordings from
> http://video.fosdem.org/2016/.

Alright, and how did you attempt to save that video? Was the video playing on the browser, and you right-clicked on the video element, and chose Save Video As, or did you right-click on a link to the video and choose Save Link As, or something else entirely?

Also, is this Nightly that you're experiencing this one, or another release altogether?
Flags: needinfo?(mcastelluccio)
(In reply to Mike Conley (:mconley) - Needinfo me! from comment #3)
> (In reply to Marco Castelluccio [:marco] from comment #2)
> > The tab wasn't in a private window, although IIRC there was a private window
> > opened.
> > 
> > I was trying to download one of the video recordings from
> > http://video.fosdem.org/2016/.
> 
> Alright, and how did you attempt to save that video? Was the video playing
> on the browser, and you right-clicked on the video element, and chose Save
> Video As, or did you right-click on a link to the video and choose Save Link
> As, or something else entirely?

I right clicked on a link to a video and chose "Save Link As...".

> Also, is this Nightly that you're experiencing this one, or another release
> altogether?

Nightly. Note that I can't reproduce it reliably.
Flags: needinfo?(mcastelluccio)
Summary: e10s - Right click -> Save As... sometimes doesn't work (unsafe cpow) → e10s - Right click -> Save Link As... sometimes doesn't work (unsafe cpow)
Keywords: qawanted
when we get around to qa'ing this if we find good str please renom for e10s tracking.
Priority: -- → P2
@Reporter: 
Please send the Operating System you are using > Windows/Linux/Macintosh
Access about:support and send snapshot of Extensions section so that I may test to see if AddOn may be causing interference.
Can you direct me to a specific folder or file where this has occurred?


Could Not Reproduce: Windows, Ubuntu 12.04. Mac OS X 10.11
Version 	48.0a1
Build ID 	20160329030246

Launch Firefox and when default window is ready select New Private Window
Return to default window
Open http://video.fosdem.org/2016/aw1125/
Select a .mp4 file
Right click and select Save Link As
Can save mp4 and png files - not seeing console report cpow messages
Flags: needinfo?(mcastelluccio)
Keywords: qawanted
(In reply to Michelle Funches - QA from comment #6)
> @Reporter: 
> Please send the Operating System you are using > Windows/Linux/Macintosh

I'm using Linux (Ubuntu 16.04).

> Access about:support and send snapshot of Extensions section so that I may
> test to see if AddOn may be causing interference.

The only active addon is AdBlock Plus.

> Can you direct me to a specific folder or file where this has occurred?

It isn't always happening, unfortunately I don't recall the specific file.
Something that you could test is downloading multiple files at the same time from that website (this is what I was doing when it started failing).
Flags: needinfo?(mcastelluccio)
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Thanks for additional information, it has helped as I can reproduce.
Confirming:
Ubuntu 16.04 32bit; AdBlock Plus installed 
Tested in Nightly 48 & 49 > Reproduced in 49
Version 	49.0a1
Build ID 	20160427030215
User Agent 	Mozilla/5.0 (X11; Linux i686; rv:49.0) Gecko/20100101 Firefox/49.0
OS 	Linux 4.4.0-21-generic x86
Opened several mp4, as they were playing I choose to save them
  Save Link As 
21:37:06.461 unsafe CPOW usage forbidden
continueSave()contentAreaUtils.js:464
internalSave/<()contentAreaUtils.js:444
Handler.prototype.process()Promise-backend.js:937
this.PromiseWalker.walkerLoop()Promise-backend.js:816
bound ()self-hosted
bound bound ()self-hosted
1contentAreaUtils.js:464
Hey Michelle, just to clarify, you're unable to reproduce without AdBlock Plus?
Flags: needinfo?(mfunches)
Yes and No. Please see below for Clarity

Testing on Windows (XP, 7, 10) Ubuntu 12.04 and Mac 10.11 AddOn was not there and I could not reproduce.
Reporter provided additional information. I setup Ubuntu 16.04 with AddOn AdBlock Plus and I could reproduce.
I did not test Ubuntu 16.04 w/o AdBlock Plus when I sent the results in comment 8. 

4/27/2016 2:15 > Update: I retested Unbuntu 16.04 with AdBlock uninstalled and I could not reproduce the cpow messaging.
Summary: Yes, I can reproduce this when I have AdBlock Plus installed.
Flags: needinfo?(mfunches)
Alright, having talked with Michelle over IRC, I think we've determined that this is an ABP issue.
Blocks: e10s-abp
Component: Menus → Add-ons
Product: Firefox → Tech Evangelism
Summary: e10s - Right click -> Save Link As... sometimes doesn't work (unsafe cpow) → e10s - Right click -> Save Link As... sometimes doesn't work with AdBlock Plus enabled (unsafe cpow)
Adding Additional Clarity: This may be limited to Linux/Ubuntu

Ubuntu 16.04 AdBlock Plus installed = Reproducible
Ubuntu 16.04 AdBlock Plus not installed = Not reproducible

Windows 10 AdBlock Plus  installed = Not reproducible
Windows 10 AdBlock Plus not installed = Not reproducible
(In reply to Mike Conley (:mconley) - Needinfo me! from comment #11)
> Alright, having talked with Michelle over IRC, I think we've determined that
> this is an ABP issue.

That's a rather bold claim, anything supporting it? So far this has all the signs of a platform issue, regardless of whether it is being triggered by Adblock Plus somehow. It's limited to a single OS (even OS version?) which is unexpected given that Adblock Plus is completely OS-agnostic. Current Adblock Plus versions don't use any CPOWs, and the affected code appears completely unrelated to any Adblock Plus functionality. My bet is on some kind of race condition.

Either way, I'll try to reproduce on Ubuntu 16.04. On OS X this issue isn't reproducible.

@Michelle Funches: I assume that you've been testing with Adblock Plus 2.7.2? Asking just in case, I don't expect Adblock Plus 2.7.3 to behave differently.
Flags: needinfo?(mfunches)
Flags: needinfo?(mconley)
(In reply to Wladimir Palant from comment #13)
> (In reply to Mike Conley (:mconley) - Needinfo me! from comment #11)
> > Alright, having talked with Michelle over IRC, I think we've determined that
> > this is an ABP issue.
> 
> That's a rather bold claim, anything supporting it?

Perhaps I should have been more precise. Allow me to rephrase:

"Alright, having talked with Michelle over IRC, I think we've determined that this is an issue that only presents when ABP is installed and enabled, and unreliably at that".

I agree that this seems like a race condition.

Thank you for attempting to reproduce it locally.
Flags: needinfo?(mfunches)
Flags: needinfo?(mconley)
@Wladimir: I did apply 2.7.3; 
Adblock Plus	2.7.3	true	{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}
Component: Add-ons → General
Priority: P2 → P1
Product: Tech Evangelism → Toolkit
Summary: e10s - Right click -> Save Link As... sometimes doesn't work with AdBlock Plus enabled (unsafe cpow) → e10s - Right click -> Save Link As... sometimes doesn't work with AdBlock Plus enabled (unsafe cpow) NOT ADD-ON BUG
Whiteboard: [not an add-ons bug - read comment 14]
Updating since this add-on is completely written with webextensions - it is not causing the CPOW - underlying race condition.
Blocks: e10s-addons
Flags: needinfo?(wmccloskey)
(In reply to :shell escalante from comment #16)
> Updating since this add-on is completely written with webextensions - it is
> not causing the CPOW - underlying race condition.

AdBlock is still a normal XUL extension. It has not been rewritten as a WebExtension.

Wladimir, have you been able to reproduce this bug? It seems likely to me that AdBlock is somehow getting its hands on a CPOW (maybe by accident) and passing it to Firefox. One way to prevent this sort of thing is to set the multiprocessCompatible flag in install.rdf--but only if you never use CPOWs or add-on shims.
Flags: needinfo?(trev.moz)
Flags: needinfo?(wmccloskey)
(In reply to Bill McCloskey (:billm) from comment #17)
> One way to prevent this sort of thing is to set the
> multiprocessCompatible flag in install.rdf

And that's what we do, starting with Adblock Plus 2.7.1. The version this is about is 2.7.3 so that flag is set.

Unfortunately, I didn't find time to set up Ubuntu 16.04 myself yet.
I installed Ubuntu 16.04 x64, downloaded Nightly 49.0a1 (2016-05-28), installed Adblock Plus 2.7.3 and disabled Ubuntu Modification extension. I then went to http://video.fosdem.org/2016/aw1120/, right-clicked some of the video links and chose "Save Link As...". I let around 6 videos download in parallel, eventually I aborted the downloads as everything seemed to work fine, nothing relevant in Browser Console. This bug is still missing proper steps to reproduce so I don't really know when I should to expect an error and how it manifests itself other than producing an error in the console.

Comment 8 talks about letting videos play but Firefox on Ubuntu cannot play MP4 videos out of the box. Do I need to install additional software first?

Either way, so far I wasn't able to reproduce the issue despite multiple attempts.
Flags: needinfo?(trev.moz)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Did you mean to resolve this as WORKSFORME?
Flags: needinfo?(jmathies)
Yeah hold up - Marco, are you still able to reproduce this?
Flags: needinfo?(mcastelluccio)
I've never able to reproduce it easily, but sounds like Michelle found a way to reproduce it?
Flags: needinfo?(mcastelluccio)
Hey Michelle, are you still able to reproduce this with Nightly and the most recent version of ABP?
Flags: needinfo?(mfunches)
(In reply to Marco Castelluccio [:marco] from comment #20)
> Did you mean to resolve this as WORKSFORME?

Yes based on comment 18.
Flags: needinfo?(jmathies)
(In reply to Jim Mathies [:jimm] from comment #24)
> (In reply to Marco Castelluccio [:marco] from comment #20)
> > Did you mean to resolve this as WORKSFORME?
> 
> Yes based on comment 18.

Michelle reproduced this issue with Adblock Plus 2.7.3 so comment 18 is irrelevant.
Confirmation: It is unclear if this should still be Resolved-WFM. Reopen? Please note: I can still reproduce the issue in the latest Nightly with Ubuntu 16.04 (x32)
Version 	49.0a1
Build ID 	20160531030258
Update Channel 	nightly
User Agent 	Mozilla/5.0 (X11; Linux i686; rv:49.0) Gecko/20100101 Firefox/49.0
Adblock Plus	2.7.3	true	{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}
Flags: needinfo?(mfunches)
Michelle, could you please post proper steps to reproduce? In particular, how many links do you have to open before seeing the issue and how does the issue manifest itself? How do you reproduce it reliably? Also, you mentioned playing the videos - did you install some codec for that?
Flags: needinfo?(mfunches)
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
1) Start Fx and verify AddOn is AdBlcok Plus 2.7.3
2) Open the Browser Console
3) Access http://video.fosdem.org/2016/aw1120/
Optional: sort by file size to make it easier to open the .mp4 files
4) Opened 4 of the mp4 files [Right Click Open Link in New Tab]
5) While still on main page, Right Click and apply Save Link As option for mp4 files. 
I saved the files for videos already opened/playing in new tab. I continue to save files that are not already playing as well. I see cpow msg in the browser console. 
Note: this is not consistent. Basically I have mp4 videos playing and continue to save new files when I see the cpow message.
Flags: needinfo?(mfunches)
(In reply to Wladimir Palant from comment #27)
> Also, you mentioned playing the videos - did you install some codec for that?

I can play the videos as well. Have you tried installing all possible GStreamer packages and
the usual Linux media libraries?
QA Update:  I (Michelle) did not add any additional codec/linux media/GStreamer.
*OpenH264 Video Codec 1.5.3 is there by default and it is the only plugin w/default Always Activate
Not sure why playing videos didn't work before, this time I was able to reproduce the issue - playing four videos in background and starting 18 downloads, the message appeared twice in console (no side-effects from what I could tell). I disabled Adblock Plus (no add-ons enabled whatsoever), restarted Nightly and retried - the issue appeared again after starting 10 downloads. So far I didn't succeed reproducing a second time without Adblock Plus but that's just the thing with race conditions. IMHO, the only effect of videos playing in background is slowing the browser down so that this race condition can be hit.

Note that this issue appears to be about aInitiatingDocument parameter. The source code contains the following comment:

> // Allow aInitiatingDocument to be a CPOW.

So I guess that having a CPOW here is intended. Under these circumstances, unsafe CPOW usage isn't exactly unexpected. I guess that Adblock Plus makes this issue more likely by doing synchronous messaging from its content policy implementation, but the issue clearly happens without it as well. IMHO that's a leftover from bug 1127927.
Blocks: 1127927
No longer blocks: e10s-addons, e10s-abp
Whiteboard: [not an add-ons bug - read comment 14]
Blocks: e10s-addons
Summary: e10s - Right click -> Save Link As... sometimes doesn't work with AdBlock Plus enabled (unsafe cpow) NOT ADD-ON BUG → e10s - Right click -> Save Link As... sometimes doesn't work with AdBlock Plus enabled (unsafe cpow)
Blocks: e10s-abp
No longer blocks: e10s-addons
Priority: P1 → P3
Status: REOPENED → RESOLVED
Closed: 8 years ago4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.