Closed Bug 2030461 Opened 28 days ago Closed 17 days ago

Tab crash after drag-and-dropping and reading nested folder structure

Categories

(Core :: DOM: File, defect)

Firefox 150
x86_64
Windows 10
defect

Tracking

()

VERIFIED FIXED
152 Branch
Tracking Status
relnote-firefox --- 150+
firefox-esr115 150.0.2+ verified
firefox-esr140 150.0.2+ verified
firefox149 --- unaffected
firefox150 --- verified
firefox151 --- verified
firefox152 --- verified

People

(Reporter: kimbatt16, Assigned: jari)

References

(Blocks 1 open bug)

Details

(Keywords: regression, topcrash, webcompat:platform-bug, Whiteboard: [adv-esr140.10.2-][adv-esr115.35.2-])

Crash Data

Attachments

(7 files)

Attached video out.webm

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:150.0) Gecko/20100101 Firefox/150.0

Steps to reproduce:

A tab can be crashed by drag-and-dropping a specific folder structure, and trying to recursively list their sub-folders.
This crash happens on windows, when dragging a folder from windows explorer. (Might also happen in other cases)
Note that this doesn't crash the entire browser, only the affected tab.
I'm using windows 10, and firefox developer edition 150.0b7

To reproduce, add this javascript code to a webpage:

window.addEventListener("dragover", ev => ev.preventDefault());

window.addEventListener("drop", async ev => {
    ev.preventDefault();

    const { dataTransfer } = ev;
    if (dataTransfer === null) {
        return;
    }

    /** @type {FileSystemEntry[]} */
    const queue = [];

    for (const item of dataTransfer.items) {
        const entry = item.webkitGetAsEntry();
        if (entry !== null) {
            queue.push(entry);
        }
    }

    while (queue.length > 0) {
        const entry = queue.pop();

        if (entry.isDirectory) {
            /** @type {FileSystemDirectoryEntry} */
            const folder = entry;

            const reader = folder.createReader();

            /** @type {FileSystemEntry[]} */
            const entries = await new Promise(res => {
                reader.readEntries(res);
            });

            if (entries !== null) {
                queue.push(...entries);
            }
        }
    }
});

Then drop a folder onto the page, which has at least one sub-folder. For example:

drop this
└─── test

(the drop this folder has a test sub-folder)

After dropping the folder, the tab crashes after reaching the reader.readEntries line for the second time.

Actual results:

The tab crashed.

Expected results:

The tab should not crash.

Component: Untriaged → DOM: File
OS: Unspecified → Windows 10
Product: Firefox → Core
Hardware: Unspecified → x86_64
Status: UNCONFIRMED → NEW
Crash Signature: [@ IPCError-browser | This path is not allowed. ]
Ever confirmed: true
See Also: → 2029047
Flags: needinfo?(jjalkanen)

Open the testcase and drag-and-drop a nested folder onto it.

The bug is linked to a topcrash signature, which matches the following criterion:

  • Top 10 desktop browser crashes on nightly

For more information, please visit BugBot documentation.

Keywords: topcrash

Thank you for the excellent report!

Assignee: nobody → jjalkanen
Flags: needinfo?(jjalkanen)

I'll call this S2 because it is at least one piece of a top crash.

Severity: -- → S2
Pushed by jjalkanen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/13a478bb2af3 https://hg.mozilla.org/integration/autoland/rev/9db7c69f1bd2 Use platform path separators with paths from nsIFile. r=dom-storage-reviewers,asuth
Status: NEW → RESOLVED
Closed: 17 days ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
Attachment #9571922 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Fixes a top crasher: prevents users from dragging and dropping folders on Windows.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: 1. Create a upper folder, which contains a lower folder, which contains some file (content doesn't matter.)
  1. Use google drive, youtube upload etc. where you can drag-and-drop file system items to a browser window. The site should be such that it keeps inventory locally. This can be checked from devtools storage panel - it should show something under IDB/indexedDB menu.
  2. Drag and drop the upper folder to the appropriate drop target.
  3. Expected: The content gets loaded appropriately
  4. Without the fix: The tab will crash
  • Risk associated with taking this patch: low
  • Explanation of risk level: This is easy to validate and it's a small, well-localized fix.
  • String changes made/needed?: -
  • Is Android affected?: yes
Flags: qe-verify+

Updated the affected versions based on the regressor
:jari, is this a nightly only crash due to asserts? Wondering why we don't see it in beta for Fx150?

Attachment #9571922 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

(In reply to Donal Meehan [:dmeehan] from comment #11)

Updated the affected versions based on the regressor
:jari, is this a nightly only crash due to asserts? Wondering why we don't see it in beta for Fx150?

No this is an IPC_FAIL response which will crash the tab and impacts popular sites under particular conditions. If I read it correctly, the regressor is in 150 and this fix is strictly necessary.

Flags: needinfo?(jjalkanen) → needinfo?(dmeehan)
QA Whiteboard: [uplift][qa-ver-needed-c152/b151]

I was able to reproduce the tab crash on Win11x64 using Firefox build 150.0(20260415192539) and steps from comment #10.
Verified as fixed on Win11x64 using Firefox build 152.0a1(20260421211246).
Waiting for next Beta to check in the fix.

QA Contact: mchiorean

(In reply to Jari Jalkanen [:jari] from comment #13)

(In reply to Donal Meehan [:dmeehan] from comment #11)

Updated the affected versions based on the regressor
:jari, is this a nightly only crash due to asserts? Wondering why we don't see it in beta for Fx150?

No this is an IPC_FAIL response which will crash the tab and impacts popular sites under particular conditions. If I read it correctly, the regressor is in 150 and this fix is strictly necessary.

We're not seeing any crash volume outside of nightly. This would also need uplift requests for release and ESR115/ESR140

Flags: needinfo?(dmeehan)

Verified as fixed on Win11x64/Mac15.5/Ubuntu 24.04 using Firefox build 151.0b1(20260422120759).

QA Whiteboard: [uplift][qa-ver-needed-c152/b151] → [uplift][qa-ver-done-c152/b151]
Flags: qe-verify+
Duplicate of this bug: 2029047

:jari did you want to uplift this for next weeks dot release (desktop+esr)? I did see it mentioned in reddit just not sure if it is the same thing

Flags: needinfo?(jjalkanen)
See Also: → 2035356

firefox-esr115 Uplift Approval Request

  • User impact if declined/Reason for urgency: Fixes a windows crasher: prevents users from dragging and dropping folders on Windows.

NB: Replicating the beta uplift request modulo not calling this a top crasher because comment 15 said reported crashes were only experienced on nightly. I am requesting esr115 since bug 2022276 was uplifted there as well.

  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: 1. Create a upper folder, which contains a lower folder, which contains some file (content doesn't matter.)
  1. Use google drive, youtube upload etc. where you can drag-and-drop file system items to a browser window. The site should be such that it keeps inventory locally. This can be checked from devtools storage panel - it should show something under IDB/indexedDB menu.
  2. Drag and drop the upper folder to the appropriate drop target.
  3. Expected: The content gets loaded appropriately
  4. Without the fix: The tab will crash
  • Risk associated with taking this patch: low
  • Explanation of risk level: This is easy to validate and it's a small, well-localized fix.
  • String changes made/needed?: -
  • Is Android affected?: yes
Attachment #9575213 - Flags: approval-mozilla-esr115?
Flags: qe-verify+
Attachment #9575214 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined/Reason for urgency: Fixes a windows crasher: prevents users from dragging and dropping folders on Windows.

NB: Replicating the beta uplift request modulo not calling this a top crasher because comment 15 said reported crashes were only experienced on nightly. I am requesting esr115 since bug 2022276 was uplifted there as well.

  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: 1. Create a upper folder, which contains a lower folder, which contains some file (content doesn't matter.)
  1. Use google drive, youtube upload etc. where you can drag-and-drop file system items to a browser window. The site should be such that it keeps inventory locally. This can be checked from devtools storage panel - it should show something under IDB/indexedDB menu.
  2. Drag and drop the upper folder to the appropriate drop target.
  3. Expected: The content gets loaded appropriately
  4. Without the fix: The tab will crash
  • Risk associated with taking this patch: low
  • Explanation of risk level: This is easy to validate and it's a small, well-localized fix.
  • String changes made/needed?: -
  • Is Android affected?: yes
Attachment #9575215 - Flags: approval-mozilla-release?

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: Fixes a windows crasher: prevents users from dragging and dropping folders on Windows.

NB: Replicating the beta uplift request modulo not calling this a top crasher because comment 15 said reported crashes were only experienced on nightly. I am requesting esr115 since bug 2022276 was uplifted there as well.

  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: 1. Create a upper folder, which contains a lower folder, which contains some file (content doesn't matter.)
  1. Use google drive, youtube upload etc. where you can drag-and-drop file system items to a browser window. The site should be such that it keeps inventory locally. This can be checked from devtools storage panel - it should show something under IDB/indexedDB menu.
  2. Drag and drop the upper folder to the appropriate drop target.
  3. Expected: The content gets loaded appropriately
  4. Without the fix: The tab will crash
  • Risk associated with taking this patch: low
  • Explanation of risk level: This is easy to validate and it's a small, well-localized fix.
  • String changes made/needed?: -
  • Is Android affected?: yes
Attachment #9575214 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Duplicate of this bug: 2035811
Duplicate of this bug: 2035356
Duplicate of this bug: 2035169
Flags: needinfo?(jjalkanen)

I was able to verify the fix on Win11x64 using treeherder build 140.11.0esr(20260429200123). Marking as verified.

Status: RESOLVED → VERIFIED
Attachment #9575213 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Attachment #9575215 - Flags: approval-mozilla-release? → approval-mozilla-release+
Whiteboard: [adv-main140.10.2-]
Whiteboard: [adv-main140.10.2-] → [adv-main140.10.2-][adv-main115.10.2-]
Whiteboard: [adv-main140.10.2-][adv-main115.10.2-] → [adv-main140.10.2-][adv-main115.35.2-]
Whiteboard: [adv-main140.10.2-][adv-main115.35.2-] → [adv-esr140.10.2-][adv-main115.35.2-]
Whiteboard: [adv-esr140.10.2-][adv-main115.35.2-] → [adv-esr140.10.2-][adv-esr115.35.2-]

I was able to verify the fix on Win11x64 using builds 115.35.2esr(20260506115224) and 150.0.2(20260506140522).

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

Attachment

General

Creator:
Created:
Updated:
Size: