dnkl/foot
41
2.0k
Fork
You've already forked foot
243

wayland: do all surface unmap and roundtrips before waiting for pre-apply damage #2297

Manually merged
dnkl merged 1 commit from pre-apply-damage-crash-on-terminal-instance-destroy into master 2026年03月12日 16:55:08 +01:00
Owner
Copy link

The pre-apply damage thread may be running when we destroy a terminal instance, and we need to wait for it to finish before destroying the underlying buffer.

c291194a4e did this, but failed to realize the thread may get re-started in the roundtrips done later in wayl_win_destroy(); after the wait added in c291194a4e, we unmap all surfaces (including the main grid), and roundtrip. This means the compositor will release the currently active buffer, and that means we will trigger the pre-apply damage thread on it. This introduces a race, where wayl_win_destroy() may reach its shm_purge() calls before the pre-apply damage thread has finished. That typically causes foot to crash.

Closes #2288

The pre-apply damage thread may be running when we destroy a terminal instance, and we need to wait for it to finish before destroying the underlying buffer. c291194a4e593bbbb91420e81fa0111508084448 did this, but failed to realize the thread may get re-started in the roundtrips done later in `wayl_win_destroy()`; after the wait added in c291194a4e593bbbb91420e81fa0111508084448, we unmap all surfaces (including the main grid), and roundtrip. This means the compositor will release the currently active buffer, and that means _we_ will trigger the pre-apply damage thread on it. This introduces a race, where `wayl_win_destroy()` may reach its `shm_purge()` calls before the pre-apply damage thread has finished. That typically causes foot to crash. Closes #2288
dnkl force-pushed pre-apply-damage-crash-on-terminal-instance-destroy from 764394d3cb
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pull_request_metadata/woodpecker Pipeline was successful
builds.sr.ht/freebsd-x64 Job completed
ci/woodpecker/pr/woodpecker Pipeline failed
to 657db18a4e
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
builds.sr.ht/freebsd-x64 Job completed
ci/woodpecker/push/woodpecker Pipeline was successful
2026年03月10日 08:25:12 +01:00
Compare
dnkl manually merged commit 657db18a4e into master 2026年03月12日 16:55:08 +01:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/foot!2297
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "pre-apply-damage-crash-on-terminal-instance-destroy"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?