Closed Bug 1864254 Opened 11 months ago Closed 10 months ago

[wpt-sync] Sync PR 43094 - serial: Fix DCHECK crash when disconnect happens during abort

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox122 fixed)

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 43094 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/43094
Details from upstream follow.

Alvin Ji <alvinji@chromium.org> wrote:

serial: Fix DCHECK crash when disconnect happens during abort

The original implementation of
SerialPortUnderlyingSink::OnFlushOrDrain assumed that a valid
pending_operation_ would always be available. However, this assumption
was flawed as disconnection could occur before the completion of the
abort operation.

To address this issue, the serialPort-disconnect-during-abort test was
introduced to trigger the crash and demonstrate that the disconnection
handler cleared pending_operation_. The revised code now checks the validity of pending_operation_ before attempting to resolve it.

This modification ensures that
SerialPortUnderlyingSink::OnFlushOrDrain correctly even when
disconnection occurs during an abort operation, preventing potential
crashes.

Bug: 1499045
Change-Id: I5e09595063f8b18f8ff1da82ab23d1b21afdc6d2

Reviewed-on: https://chromium-review.googlesource.com/5021930
WPT-Export-Revision: c2dddc0b9e9e2b2a7eec765f736725b3b530a8f1

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 1 subtests

Status Summary

Firefox

OK : 2
FAIL : 2

Chrome

CRASH: 2

Safari

OK : 2
FAIL : 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /serial/serialPort-disconnect-during-abort.https.any.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: CRASH, Safari: OK)
    • Disconnect error during abort works correctly: FAIL (Safari: FAIL)
  • /serial/serialPort-disconnect-during-abort.https.any.worker.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: CRASH, Safari: OK)
    • Disconnect error during abort works correctly: FAIL (Safari: FAIL)

Tests Disabled in Gecko Infrastructure

  • /serial/serialPort-disconnect-during-abort.https.any.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: CRASH, Safari: OK)
  • /serial/serialPort-disconnect-during-abort.https.any.worker.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: CRASH, Safari: OK)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/41f5e9dc6f0d [wpt PR 43094] - serial: Fix DCHECK crash when disconnection happens during abort, a=testonly
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/edc58bd0d3f9 [wpt PR 43094] - serial: Fix DCHECK crash when disconnection happens during abort, a=testonly
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.