New issue
Advanced search Search tips

Issue 724826 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Possible page script to content script race condition on CustomEvent dispatch

Reported by robotic1...@googlemail.com, May 20 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36

Steps to reproduce the problem:
1. load attached buggyExt.zip extension
2. enable extension access to file:// URLs
3. navigate to attached bugtest.html
4. open the developer console
5. reload page several times and observe assertion errors in console

What is the expected behavior?
Console should only display:
"Testcount (broken/working/total): 488 / 512 / 1000"

while broken and working count is determined randomly (see bugtest.html)

What went wrong?
The assertions in version 1 of the event handler should never fail like in version 2. But unfortunately they do. In fact they seem to fail randomly, indicating some form of race condition.

This ONLY happens if:
1. the event was dispatched from a normal (or injected) page script. If the event was dispatched from within the content script, everything works as expected.

2. AND The closure accessing the event.detail is called trough any type of asynchronous API callback.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 58.0.3029.81  Channel: n/a
OS Version: Arch Linux 4.9.24-1-lts
Flash Version: Shockwave Flash 22.0 r0

tested with the following APIs:
window.setTimeout (longer timeouts seem to increase failure rate)
chrome.storage.local.get
 
buggyExt.zip
840 bytes Download
bugtest.html
1.2 KB View Download
Components: Platform>Extensions
Cc: pnangunoori@chromium.org
Status: Untriaged (was: Unconfirmed)
Tested on latest Chrome stable #59.0.3071.115 on Ubuntu 14.04 and able to reproduce the issue. Attached the screenshot for reference.

This is a non-regression issue and able to reproduce from M-56 #56.0.2884.0.Marking it as untriaged so that issue gets addressed.

Observations:
1. In Ubuntu 14.04, for the builds before 56.0.2884.0, upon loading the extension an alert “Manifest file is missing or unreadable.” is noticed.
2. In Mac 10.12.5 and Windows 10 even for the latest stable version #59.0.3071.115, upon loading the extension an alert “Manifest file is missing or unreadable.” is noticed

Thanks in advance.

724826-AssertionFailed.png
61.4 KB View Download
724826-ManifesfileMissing.png
44.6 KB View Download

Sign in to add a comment