Open Bug 1809783 Opened 2 years ago Updated 2 years ago

ANR after sharing image from https://youcantdownloadthisimage.com/

Categories

(Firefox for Android :: Share, defect, P3)

All
Android
defect

Tracking

()

People

(Reporter: cpeterson, Unassigned)

References

()

Details

From github: https://github.com/mozilla-mobile/fenix/issues/22644.

Steps to reproduce

  1. Open https://youcantdownloadthisimage.com/
  2. Long-press the image
  3. Select "Share image"

Expected behaviour

The browser should not block when sharing fails.

Actual behaviour

The OS shows an ANR warning for the browser.

Device name

Sony Xperia Z2

Android version

Android 6.0.1

Firefox release type

Firefox Nightly

Firefox version

96.0a1 (Build #2015848873), 9fa9ae337+ AC: 96.0.20211130143618, 395aa21e64 GV: 96.0a1-20211130093553 AS: 86.2.0, 2021-12-01T05:13:00.119862

Device logs

No response

Additional information

This website does not close the connection after the image has been sent, see the description below the image when clicking "The answer".

Change performed by the Move to Bugzilla add-on.

Summary: ANR after sharing image from https://youcantdownloadthisimage.online/ → ANR after sharing image from https://youcantdownloadthisimage.com/

This bug was reproducible in Fenix 96 and 97. Is it still reproducible in a recent version of Fenix?

Flags: qe-verify+

This issue is still reproducible with the latest Nightly 110.0a1 (2023-01-12) build.
It's not reproducible on Chrome with the same device.
Device used: LG Nexus 5 (Android 6.0.1).

Flags: qe-verify+

The severity field is not set for this bug.
:cpeterson, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)

Group triage result: Comparing Fenix behavior to other browsers, only Fenix leads to ANR, we could investigate that.

Severity: -- → S4
Flags: needinfo?(cpeterson)
Priority: -- → P3

Related Code: startSharing and download

The main issue is when timeout (1000ms) , FileOutputStream(tempFile).use { output -> input.copyTo(output) } is not cancelled.

I have no idea why withTimeout not take effect.

Replace scope?.launch(coroutineExceptionHandler) to scope?.lauch(Dispatchers.IO) can prevent ANR but there's no exception throw and this block of code may still running.

Some related kotlin issue withTimeout does not work with CoroutineExceptionHandler?

this block of code may still running.

Besides, this image also bypass WebResponse's default read timeout (setReadTimeoutMillis(DEFAULT_READ_TIMEOUT_MS)) . It always transmits 1 or 2 bytes in a 30s period (DEFAULT_READ_TIMEOUT_MS=30000L).

You need to log in before you can comment on or make changes to this bug.