Closed Bug 1177309 Opened 9 years ago Closed 9 years ago

[e10s] multiprocessCompatible flag is ignored after first run

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1171173
mozilla40

People

(Reporter: fdsc, Assigned: billm)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.0;  Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2273.0 Safari/537.36

Steps to reproduce:

1. Install the extension from attachement
2. Clear console
3. Start load any web page (e.g. http://fxprivacy.8vs.ru/ )
4. See in console what handlers not execute (not show page urls) in frame process (it were handlers have not registered)
5. Restart FireFox
6. Repeat 2-3
7. See in console what handlers execute in frame process



Expected results:

Handlers should always be called in all processes, or should always be called only in the process where registered.
The behavior should be predictable and documented
Severity: normal → major
OS: Unspecified → All
Hardware: Unspecified → All
I cannot see anything unexpected or undocumented in the behavior demonstrated by your test add-on.

Handlers should not get called in all processes: when you observed the opposite happening, that was a single process emulation provided by shims for compatibility with legacy add-ons, and it relied on inter-process communication causing an often unacceptable overhead. If you opt-out from the shims by declaring multiprocess compatibility, your observers and content policies get called *either* in the chrome or in the content process, depending on where it actually makes sense. This is clearly documented, even though can be confusing at first.
You should get familiar with such behavior as soon as possible, because compatibility shims are eventually going away.

Since all your code lives in the chrome process,

1) Your nsIContentPolicy instance never gets called because it deals with content-side DOM objects, https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts#nsIContentPolicy

2) Your "document-element-inserted" observer can't be called, for the same reasons https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts#Observers_in_the_chrome_process
 
3) Your "http-on-modify-request" observer, instead, does work because networking happens in the parent process, even though correlating channels with DOM windows is obviously much trickier than it used to be, https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts#HTTP_requests

You should move #1 and #2 in a frame script, or put everything in a process script, see https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Message_Manager/Process_scripts

Also the Add-ons SDK is starting to provide APIs to handle this separation, see
* https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/remote_parent
* https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/remote_child
Severity: major → normal
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Product: Core → Add-on SDK
Resolution: --- → WONTFIX
Summary: E10S sdk/system/events and content policy observers has been work into chrome and frame process with one handler registration → E10S sdk/system/events and content policy observers should work into chrome and frame process with one handler registration
Target Milestone: --- → mozilla40
Version: 40 Branch → unspecified
> 1) Your nsIContentPolicy instance never gets called because it deals with content-side DOM objects, 

I see, nsIContentPolicy has been called on last FireFox DE

> 2) Your "document-element-inserted" observer can't be called, for the same reasons 

I see, has been called

3)I called it to clarify at what points are invoked by other processes

What I see in console log after restart FireFox

"CP http://fxprivacy.8vs.ru/" index.js:80
"request http://fxprivacy.8vs.ru/" index.js:19
"CP http://fxprivacy.8vs.ru/scripts.js" index.js:80
"request http://fxprivacy.8vs.ru/scripts.js" index.js:19
"CP http://fxprivacy.8vs.ru/styles.css" index.js:80
"request http://fxprivacy.8vs.ru/styles.css" index.js:19
"CP http://yandex.st/share/share.js" index.js:80
"request http://yandex.st/share/share.js" index.js:19
"CP http://fxprivacy.8vs.ru/images/minus8_2.jpg" index.js:80
"request http://fxprivacy.8vs.ru/images/minus8_2.jpg" index.js:19
"CP http://fxprivacy.8vs.ru/images/plus8_2.jpg" index.js:80
"request http://fxprivacy.8vs.ru/images/plus8_2.jpg" index.js:19
"CP http://fxprivacy.8vs.ru/images/close8_2.jpg" index.js:80
"request http://fxprivacy.8vs.ru/images/close8_2.jpg" index.js:19
"CP http://fxprivacy.8vs.ru/DSC09832cp2-100.JPG" index.js:80
"request http://fxprivacy.8vs.ru/DSC09832cp2-100.JPG" index.js:19
"CP http://fxprivacy.8vs.ru/rtdbsupport.gif" index.js:80
"request http://fxprivacy.8vs.ru/rtdbsupport.gif" index.js:19
"CP http://fxprivacy.8vs.ru/HTTPUACleaner.png" index.js:80
"request http://fxprivacy.8vs.ru/HTTPUACleaner.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/ua1.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/ua1.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/ua2.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/ua2.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/ua3.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/ua3.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/pl1.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/pl1.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/pl2.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/pl2.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/hold1.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/hold1.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/hold2.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/hold2.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/domain1.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/domain1.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/domain2.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/domain2.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/priv1.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/priv1.png" index.js:19
"CP http://fxprivacy.8vs.ru/ua/priv2.png" index.js:80
"request http://fxprivacy.8vs.ru/ua/priv2.png" index.js:19
"CP http://fxprivacy.8vs.ru/logB.png" index.js:80
"request http://fxprivacy.8vs.ru/logB.png" index.js:19
"CP http://fxprivacy.8vs.ru/logB2.png" index.js:80
"request http://fxprivacy.8vs.ru/logB2.png" index.js:19
"CP http://bs.yandex.ru/informer/23496292/1_1_FFFFFFFF_EFEFEFFF_0_uniques" index.js:80
"request http://bs.yandex.ru/informer/23496292/1_1_FFFFFFFF_EFEFEFFF_0_uniques" index.js:19
"document http://fxprivacy.8vs.ru/" index.js:39
"document http://fxprivacy.8vs.ru/" index.js:39
"CP http://fxprivacy.8vs.ru/scripts.js" index.js:80
"CP http://fxprivacy.8vs.ru/styles.css" index.js:80
"CP http://yandex.st/share/share.js" index.js:80
"document chrome://global/content/bindings/scrollbar.xml" index.js:39
"document chrome://global/content/bindings/resizer.xml" index.js:39
"CP http://fxprivacy.8vs.ru/images/minus8_2.jpg" index.js:80
"CP http://fxprivacy.8vs.ru/images/plus8_2.jpg" index.js:80
"CP http://fxprivacy.8vs.ru/images/close8_2.jpg" index.js:80
"CP http://fxprivacy.8vs.ru/DSC09832cp2-100.JPG" index.js:80
"CP http://fxprivacy.8vs.ru/rtdbsupport.gif" index.js:80
"CP http://fxprivacy.8vs.ru/HTTPUACleaner.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/ua1.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/ua2.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/ua3.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/pl1.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/pl2.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/hold1.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/hold2.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/domain1.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/domain2.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/priv1.png" index.js:80
"CP http://fxprivacy.8vs.ru/ua/priv2.png" index.js:80
"CP http://fxprivacy.8vs.ru/logB.png" index.js:80
"CP http://fxprivacy.8vs.ru/logB2.png" index.js:80
"CP http://bs.yandex.ru/informer/23496292/1_1_FFFFFFFF_EFEFEFFF_0_uniques" index.js:80
"CP http://mc.yandex.ru/metrika/watch.js" index.js:80
"request http://mc.yandex.ru/metrika/watch.js" index.js:19
"CP http://mc.yandex.ru/metrika/watch.js" index.js:80
"request http://mc.yandex.ru/metrika/watch.js" index.js:19
"CP http://yastatic.net/share/static/b-share-icon.png" index.js:80
"request http://yastatic.net/share/static/b-share-icon.png" index.js:19
"CP http://yastatic.net/share/static/b-share-popup_down__tail.png" index.js:80
"request http://yastatic.net/share/static/b-share-popup_down__tail.png" index.js:19
"CP http://yastatic.net/share/static/b-share-form-button.png" index.js:80
"request http://yastatic.net/share/static/b-share-form-button.png" index.js:19
"CP http://yastatic.net/share/static/b-share-form-button.png" index.js:80
"CP http://yastatic.net/share/static/b-share-form-button.png" index.js:80
"CP http://yastatic.net/share/static/b-share-form-button_share__icon.png" index.js:80
"request http://yastatic.net/share/static/b-share-form-button_share__icon.png" index.js:19
Sending message that cannot be cloned. Are you trying to send an XPCOM object? SiteSpecificUserAgent.js:50:0
"request https://mc.yandex.ru/metrika/watch.js" index.js:19
Этот сайт использует сертификат SHA-1; рекомендуется использовать сертификаты с алгоритмами подписи, использующими более сильные хеш-функции, чем SHA-1.[Подробнее] watch.js
"CP https://mc.yandex.ru/webvisor/23496292?rn=865547735&page-url=http%3A%2F%2Ffxprivacy.8vs.ru%2F&wmode=0&wv-type=0&wv-hit=317290485&wv-part=12&wv-check=9670&browser-info=z%3A180%3Ai%3A20150625035714%3Arqnl%3A2%3Ast%3A1435230983" index.js:80
"request https://mc.yandex.ru/webvisor/23496292?rn=865547735&page-url=http%3A%2F%2Ffxprivacy.8vs.ru%2F&wmode=0&wv-type=0&wv-hit=317290485&wv-part=12&wv-check=9670&browser-info=z%3A180%3Ai%3A20150625035714%3Arqnl%3A2%3Ast%3A1435230983" index.js:19
"CP https://mc.yandex.ru/watch/23496292?wmode=5&callback=_ymjsp995334537&page-url=http%3A%2F%2Ffxprivacy.8vs.ru%2F&browser-info=s%3A1280x1024x24%3Ask%3A1%3Af%3A17.0.0.190%3Afpr%3A66593234101%3Acn%3A1%3Aw%3A1247x900%3Az%3A180%3Ai%3A20150625141622%3Aet%3A1435230983%3Aen%3Awindows-1251%3Av%3A636%3Ac%3A1%3Ala%3Aru-ru%3Als%3A1384320435534%3Arqn%3A14%3Arn%3A160416214%3Ahid%3A281771696%3Ads%3A1397%2C0%2C397%2C0%2C5%2C0%2C%2C1896%2C29%2C%2C%2C%2C3939%3Awn%3A24278%3Ahl%3A1%3Arqnl%3A1%3Ast%3A1435230983%3At%3AHTTP%20UserAgent%20cleaner" index.js:80
"request https://mc.yandex.ru/watch/23496292?wmode=5&callback=_ymjsp995334537&page-url=http%3A%2F%2Ffxprivacy.8vs.ru%2F&browser-info=s%3A1280x1024x24%3Ask%3A1%3Af%3A17.0.0.190%3Afpr%3A66593234101%3Acn%3A1%3Aw%3A1247x900%3Az%3A180%3Ai%3A20150625141622%3Aet%3A1435230983%3Aen%3Awindows-1251%3Av%3A636%3Ac%3A1%3Ala%3Aru-ru%3Als%3A1384320435534%3Arqn%3A14%3Arn%3A160416214%3Ahid%3A281771696%3Ads%3A1397%2C0%2C397%2C0%2C5%2C0%2C%2C1896%2C29%2C%2C%2C%2C3939%3Awn%3A24278%3Ahl%3A1%3Arqnl%3A1%3Ast%3A1435230983%3At%3AHTTP%20UserAgent%20cleaner" index.js:19
"CP https://mc.yandex.ru/webvisor/23496292?rn=787360387&page-url=http%3A%2F%2Ffxprivacy.8vs.ru%2F&wmode=0&wv-type=0&wv-hit=317290485&wv-part=13&wv-check=58461&browser-info=z%3A180%3Ai%3A20150625035714%3Arqnl%3A1%3Ast%3A1435230983" index.js:80
"request https://mc.yandex.ru/webvisor/23496292?rn=787360387&page-url=http%3A%2F%2Ffxprivacy.8vs.ru%2F&wmode=0&wv-type=0&wv-hit=317290485&wv-part=13&wv-check=58461&browser-info=z%3A180%3Ai%3A20150625035714%3Arqnl%3A1%3Ast%3A1435230983" index.js:19
"CP https://mc.yandex.ru/watch/26812653?wmode=5&callback=_ymjsp1029589957&page-url=http%3A%2F%2Ffxprivacy.8vs.ru%2F&site-info=%7B%22jquery%22%3Afalse%2C%22version%22%3Afalse%7D&browser-info=s%3A1280x1024x24%3Ask%3A1%3Af%3A17.0.0.190%3Afpr%3A66593234101%3Acn%3A2%3Aw%3A1247x900%3Az%3A180%3Ai%3A20150625141622%3Aet%3A1435230983%3Aen%3Awindows-1251%3Av%3A636%3Ac%3A1%3Ala%3Aru-ru%3Als%3A730118736861%3Arqn%3A14%3Arn%3A396230991%3Ahid%3A281771696%3Ads%3A1397%2C0%2C397%2C0%2C5%2C0%2C%2C1896%2C29%2C%2C%2C%2C3939%3Arqnl%3A1%3Ast%3A1435230983%3At%3AHTTP%20UserAgent%20cleaner" index.js:80
"request https://mc.yandex.ru/watch/26812653?wmode=5&callback=_ymjsp1029589957&page-url=http%3A%2F%2Ffxprivacy.8vs.ru%2F&site-info=%7B%22jquery%22%3Afalse%2C%22version%22%3Afalse%7D&browser-info=s%3A1280x1024x24%3Ask%3A1%3Af%3A17.0.0.190%3Afpr%3A66593234101%3Acn%3A2%3Aw%3A1247x900%3Az%3A180%3Ai%3A20150625141622%3Aet%3A1435230983%3Aen%3Awindows-1251%3Av%3A636%3Ac%3A1%3Ala%3Aru-ru%3Als%3A730118736861%3Arqn%3A14%3Arn%3A396230991%3Ahid%3A281771696%3Ads%3A1397%2C0%2C397%2C0%2C5%2C0%2C%2C1896%2C29%2C%2C%2C%2C3939%3Arqnl%3A1%3Ast%3A1435230983%3At%3AHTTP%20UserAgent%20cleaner" index.js:19
Этот сайт использует сертификат SHA-1; рекомендуется использовать сертификаты с алгоритмами подписи, использующими более сильные хеш-функции, чем SHA-1.[Подробнее] 23496292
Этот сайт использует сертификат SHA-1; рекомендуется использовать сертификаты с алгоритмами подписи, использующими более сильные хеш-функции, чем SHA-1.[Подробнее] 23496292
"request https://mc.yandex.ru/watch/23496292/1?wmode=5&callback=_ymjsp995334537&page-url=http%3A%2F%2Ffxprivacy.8vs.ru%2F&browser-info=s%3A1280x1024x24%3Ask%3A1%3Af%3A17.0.0.190%3Afpr%3A66593234101%3Acn%3A1%3Aw%3A1247x900%3Az%3A180%3Ai%3A20150625141622%3Aet%3A1435230983%3Aen%3Awindows-1251%3Av%3A636%3Ac%3A1%3Ala%3Aru-ru%3Als%3A1384320435534%3Arqn%3A14%3Arn%3A160416214%3Ahid%3A281771696%3Ads%3A1397%2C0%2C397%2C0%2C5%2C0%2C%2C1896%2C29%2C%2C%2C%2C3939%3Awn%3A24278%3Ahl%3A1%3Arqnl%3A1%3Ast%3A1435230983%3At%3AHTTP%20UserAgent%20cleaner" index.js:19
Status: RESOLVED → UNCONFIRMED
Flags: needinfo?(g.maone)
Resolution: WONTFIX → ---
Sorry, you're right. 
It seems latest DE is actually using shims despite the multiprocessCompatible flag.
It does not happen in Nightly, neither happened in the slightly older DE version I was testing on.
As soon as I updated to latest DE 40.0a2 (2015-06-25), the behavior you're describing started to be observable.
Latest Nightly behaves as expected, though.
Bill, is this intentional?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(g.maone) → needinfo?(wmccloskey)
Summary: E10S sdk/system/events and content policy observers should work into chrome and frame process with one handler registration → Add-ons get shims despite multiprocessCompatible flag on Firefox Developer Edition
Bill just explained me this is a slightly different issue, affecting Nightlies as well.

It does not happen on first installation (this is why I couldn't observe it when running my test with jmp run) but then causes the browser to ignore the multiprocessCompatible flag from second run on.

He said he's gonna fix it very soon, so in the meanwhile I'm morphing this bug and assigning it to him.

Bill, I couldn't find another one to dupe this, please just do it if I didn't search hard enough. Thank you!
Assignee: nobody → wmccloskey
Flags: needinfo?(wmccloskey)
Summary: Add-ons get shims despite multiprocessCompatible flag on Firefox Developer Edition → [e10s] multiprocessCompatible flag is ignored after first run
Thanks for re-testing.
Status: NEW → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: