Skip to content

fix archive extract crash (#1718) - #1869

Merged
mmstick merged 2 commits into
pop-os:masterfrom
BoiledElectricity:fix-archive-extract-compio
Jun 24, 2026
Merged

mmstick merged 2 commits into
pop-os:masterfrom
BoiledElectricity:fix-archive-extract-compio

Conversation

@BoiledElectricity

Copy link
Copy Markdown
Contributor

So the archive::extract runs inside spawn_blocking, but sync_to_disk used compio's async fs so it panics "not in a compio runtime" and kills the extract. swapped that flush to plain std::fs since we're already on a blocking thread.
fixes #1718

  • [x ] I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • [x ] I understand these changes in full and will be able to respond to review comments.
  • [ x] My change is accurately described in the commit message.
  • [ x] My contribution is tested and working as described.
  • [x ] I have read the Developer Certificate of Origin and certify my contribution under its conditions.

@mmstick

mmstick commented Jun 19, 2026

Copy link
Copy Markdown
Member

It would be better to pass a runtime handle and ensure we have async I/O running on the compio excecutor.

@BoiledElectricity

BoiledElectricity commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor Author

It would be better to pass a runtime handle and ensure we have async I/O running on the compio excecutor.

So I have a local commit that now runs the flush on the compio executor via compio::runtime::spawn as you asked. But I couldn't literally "pass a runtime handle" since compio's Runtime is !Send/thread-local so instead extract returns the written paths and perform flushes each archive on the executor. Does that work? or am I missing something and I should I be able to pass a runtime handle

@mmstick

mmstick commented Jun 22, 2026

Copy link
Copy Markdown
Member

It's fine to pass the data to the compio executor's thread to handle it there.

@BoiledElectricity
BoiledElectricity force-pushed the fix-archive-extract-compio branch from 8ffb7ab to c679e2c Compare June 22, 2026 22:27
Comment thread src/operation/mod.rs Resolved
@BoiledElectricity
BoiledElectricity force-pushed the fix-archive-extract-compio branch from c679e2c to cf75330 Compare June 23, 2026 01:00
@jacobgkau
jacobgkau requested a review from a team June 23, 2026 18:53
@jacobgkau jacobgkau self-assigned this Jun 23, 2026

@jacobgkau jacobgkau left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 3e3ef7d, I'm still seeing #1718 occur (COSMIC Files crashes if I attempt to open a second ZIP file while the first one's extraction dialog is still open).

The output's a little different than what was quoted in the issue:

system76@pop-os:~$ RUST_BACKTRACE=full cosmic-files
system76@pop-os:~$
thread 'main' (4533) panicked at /home/system76/cosmic-files/vendor/libcosmic/src/app/mod.rs:488:9:
no view for window Id(2)
stack backtrace:
   0:     0x596b30da3aba - <unknown>
   1:     0x596b30dbf51a - <unknown>
   2:     0x596b30daa9d2 - <unknown>
   3:     0x596b30d7dd6f - <unknown>
   4:     0x596b30d99841 - <unknown>
   5:     0x596b30d99abb - <unknown>
   6:     0x596b30d7de28 - <unknown>
   7:     0x596b30d74cf9 - <unknown>
   8:     0x596b30d7f27d - <unknown>
   9:     0x596b30dbfe1c - <unknown>
  10:     0x596b2f59f810 - <unknown>
  11:     0x596b2f5ee6d1 - <unknown>
  12:     0x596b2f2ae475 - <unknown>
  13:     0x596b2f69aaaf - <unknown>
  14:     0x596b2f2aeaf6 - <unknown>
  15:     0x596b2f2a1fb6 - <unknown>
  16:     0x596b2f2aedc7 - <unknown>
  17:     0x596b2f69c743 - <unknown>
  18:     0x596b2f6c90bf - <unknown>
  19:     0x596b2f305168 - <unknown>
  20:     0x596b2f1c2899 - <unknown>
  21:     0x596b2f1772a6 - <unknown>
  22:     0x596b2f1771e5 - <unknown>
  23:     0x596b30d98014 - <unknown>
  24:     0x596b2f17738d - <unknown>
  25:     0x755c8042a1ca - <unknown>
  26:     0x755c8042a28b - __libc_start_main
  27:     0x596b2f1770e5 - <unknown>
  28:                0x0 - <unknown>
system76@pop-os:~$

@jacobgkau jacobgkau removed their assignment Jun 23, 2026
calling compio fs from the spawn_blocking thread panicked 'not in a compio runtime'. now extract returns the written files/dirs and perform flushes each archive on the compio executor via compio::runtime::spawn, per-archive like before.
opening a second archive while the first's "extract to" dialog was still open
overwrote file_dialog_opt without closing the first dialog's window, leaving an
orphaned window that panicked "no view for window" on render. close any existing
dialog before opening a new one.
@BoiledElectricity
BoiledElectricity force-pushed the fix-archive-extract-compio branch from 3e3ef7d to 6329e0e Compare June 23, 2026 19:33
@BoiledElectricity

Copy link
Copy Markdown
Contributor Author

On 3e3ef7d, I'm still seeing #1718 occur (COSMIC Files crashes if I attempt to open a second ZIP file while the first one's extraction dialog is still open).

The output's a little different than what was quoted in the issue:

system76@pop-os:~$ RUST_BACKTRACE=full cosmic-files
system76@pop-os:~$
thread 'main' (4533) panicked at /home/system76/cosmic-files/vendor/libcosmic/src/app/mod.rs:488:9:
no view for window Id(2)
stack backtrace:
   0:     0x596b30da3aba - <unknown>
   1:     0x596b30dbf51a - <unknown>
   2:     0x596b30daa9d2 - <unknown>
   3:     0x596b30d7dd6f - <unknown>
   4:     0x596b30d99841 - <unknown>
   5:     0x596b30d99abb - <unknown>
   6:     0x596b30d7de28 - <unknown>
   7:     0x596b30d74cf9 - <unknown>
   8:     0x596b30d7f27d - <unknown>
   9:     0x596b30dbfe1c - <unknown>
  10:     0x596b2f59f810 - <unknown>
  11:     0x596b2f5ee6d1 - <unknown>
  12:     0x596b2f2ae475 - <unknown>
  13:     0x596b2f69aaaf - <unknown>
  14:     0x596b2f2aeaf6 - <unknown>
  15:     0x596b2f2a1fb6 - <unknown>
  16:     0x596b2f2aedc7 - <unknown>
  17:     0x596b2f69c743 - <unknown>
  18:     0x596b2f6c90bf - <unknown>
  19:     0x596b2f305168 - <unknown>
  20:     0x596b2f1c2899 - <unknown>
  21:     0x596b2f1772a6 - <unknown>
  22:     0x596b2f1771e5 - <unknown>
  23:     0x596b30d98014 - <unknown>
  24:     0x596b2f17738d - <unknown>
  25:     0x755c8042a1ca - <unknown>
  26:     0x755c8042a28b - __libc_start_main
  27:     0x596b2f1770e5 - <unknown>
  28:                0x0 - <unknown>
system76@pop-os:~$

Try now I pushed a fix that closes the existing dialog before opening a new one.

@jacobgkau jacobgkau linked an issue Jun 24, 2026 that may be closed by this pull request

@jacobgkau jacobgkau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may've misunderstood #1718; I wasn't able to replicate COSMIC Files crashing on actually finishing the extraction for multiple ZIP files in a row. But the fix for the second dialog crash is working as well. Thank you for these fixes!

Regression testing passed:

Checklist

Basic navigation

  • Middle-click opens directory in a new tab (not focused).
  • Open two scrollable tabs. Scroll one tab, then switch to the other tab; it should not have scrolled.
  • Hover over the top item in the folder, then scroll down until it's out of view (while still hovered). On scrolling back up (with the mouse in a different position), the item should not have the hover highlight.
  • Right-click an item in the sidebar. No visual change should occur with the rest of the items.
  • Remove an item from the sidebar, then re-pin it.

File operations

  • Right-click -> Create a new folder, then enter it.
  • Right-click in the empty folder -> Create a new file.
  • Navigate to the parent folder, create another new file, then drag it into the created folder.
  • Files can be renamed.
  • Files can be opened with non-default apps & browsing store for new apps works.
  • Normal right-click shows Move to trash option.
  • Shift right-click, and right-click followed by Shift, both show Permanently delete option.

Advanced navigation & view settings

  • Image and video thumbnails generate & display in local folders.
  • Gallery preview shows with Spacebar.
  • Details pane shows with Ctrl+Spacebar.
  • Zoom in/out and reset to default zoom work.
  • Ctrl+1 and Ctrl+2 switch between list and icon view.
  • Ctrl+H shows/hides hidden files.
  • Directories can be sorted at top or inline.
  • Settings -> Theme works.
  • Settings -> Type to Search affects behavior as designed.
  • Single-click to open setting takes effect.
  • Recents in sidebar setting works.
  • Sorting options work.
  • Cutting, copying, and pasting files works.
  • F5 reloads current directory.
  • Left sidebar can be collapsed and expanded.

External filesystems

  • Add a network drive (e.g. SFTP) and navigate into it.
  • Plug in a USB drive; able to mount, browse, and eject.

Integrations

  • Desktop icons display as expected
  • Drag-and-drop into Firefox works

@jacobgkau
jacobgkau requested a review from mmstick June 24, 2026 16:44
@mmstick
mmstick merged commit cd427c7 into pop-os:master Jun 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extracting multiple zips back-to-back causes crash Crash when opening second ZIP archive (not in a compio runtime panic)

4 participants