Two Sixel support fixes needed for stabilization on noble

Bug #2068393 reported by Andrej Rohaŭ
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tmux
Fix Released
Unknown
tmux (Debian)
Fix Released
Unknown
tmux (Ubuntu)
Fix Released
Undecided
Unassigned
Noble
In Progress
Undecided
Lena Voytek

Bug Description

[Impact]

With the addition of SIXEL support by default, tmux may crash due to SIXEL images having no color or being unable to scale. This is most often seen when opening neovim in a tmux session.

This fix will allow problematic SIXEL images to render without crashing tmux, and most importantly will fix using neovim in tmux.

The bug is fixed through an upstream patch that adds checks for a lack of colors or scalability in SIXEL images, while also freeing them regardless of reflow state.

[Test Plan]

As stated by the reporter, the steps to reproduce are:

Steps to reproduce:
1. SSH to a Noble machine
2. Install latest stable release of neovim (0.10.0)
3. Run tmux with 'tmux -vv' to spawn a server with verbose logging
4. Run neovim with 'sudo nvim -u NONE'
5. [server exited unexpectedly]

Observe in log (tmux-server-PID.log):
1717870463.535540 input_enter_dcs
1717870463.535557 screen_write_collect_flush: flushed 0 items (screen_write_sixelimage)
1717870463.535577 tty_cmd_sixelimage: image is 1x1
1717870463.535595 tty_cmd_sixelimage: clamping to 0,0-1,1
1717870463.535615 fatal: xcalloc: zero size

The bug is fixed when tmux no longer crashes after following these instructions.

[Where problems could occur]

Based on the changes added through the commit, problems would be limited to sixel image rendering. Previously, images with no colors or ability to scale would lead to a crash. Now, however, they cause their respective functions to bail out early. Likewise no color images cause sixel_print() to return NULL. If other functions calling these do not handle the results properly, then this may cause new issues. Finally, when resizing the screen, all images are freed and redrawn regardless of reflow. This may cause changes in behavior when resizing the screen without reflow enabled.

[Other Info]

This bug has been fixed in Debian Sid and Oracular through the inclusion of individual upstream commits as patches in 3.4-3

[Original Description]

Please sync tmux (main) from Oracular (main)

Noble was released with 3.4 which introduced half-baked Sixel support enabled by default that now had two important crash fixes upstream.

Tags: server-todo

Related branches

Revision history for this message
Paride Legovini (paride) wrote :

Hello and thanks for this bug report, however what you suggest is not how updates to stable Ubuntu releases are handled, see [1] for more information. What we need in the bug report is a statement of the problem, with possibly a reproducer and ideally with a pointer to the upstream or Debian fix. Something on these lines:

- On Noble, if you do XYZ then tmux crashes
- This bug appears to be fixed by upstream commit aa17f0e0c1
- That commit has been cherry-picked in tmux 3.4-3:

---
tmux (3.4-3) unstable; urgency=medium

  * Cherry-pick commit aa17f0e0c1 from upstream to fix crash on invalid
    Sixel input.
---

Closely related issues that are to be fixed together go into the same bug.

Thanks!

https://wiki.ubuntu.com/StableReleaseUpdates

Changed in tmux (Ubuntu):
status: New → Incomplete
Revision history for this message
Andrej Rohaŭ (arohau) wrote (last edit ):

Hi! Thanks for the assistance.

- On Noble, remote tmux server exits unexpectedly when starting neovim 0.10.0 over SSH in terminals that support sixel (like iTerm2 on macOS).
- This bug appears to be fixed by upstream commit aa17f0e0c1
- That commit has been cherry-picked in tmux 3.4-3:

---
tmux (3.4-3) unstable; urgency=medium

  * Cherry-pick commit aa17f0e0c1 from upstream to fix crash on invalid
    Sixel input.
---

Steps to reproduce:
1. SSH to a Noble machine
2. Install latest stable release of neovim (0.10.0)
3. Run tmux with 'tmux -vv' to spawn a server with verbose logging
4. Run neovim with 'sudo nvim -u NONE'
5. [server exited unexpectedly]

Observe in log (tmux-server-PID.log):
1717870463.535540 input_enter_dcs
1717870463.535557 screen_write_collect_flush: flushed 0 items (screen_write_sixelimage)
1717870463.535577 tty_cmd_sixelimage: image is 1x1
1717870463.535595 tty_cmd_sixelimage: clamping to 0,0-1,1
1717870463.535615 fatal: xcalloc: zero size

Upstream issue tracker: https://github.com/tmux/tmux/issues/3983

According to neovim the issue seems to be triggered by a valid DECRQSS query.

Neovim issue tracker and a possible workaround: https://github.com/neovim/neovim/issues/28082

Thanks!

Revision history for this message
Romain Francoise (rfrancoise) wrote :

This is why tmux 3.4-1 and 3.4-2 were explicitly prevented from migrating to Debian testing by Debian bug #1064363 (but Ubuntu syncs from unstable).

Revision history for this message
Andrej Rohaŭ (arohau) wrote :

Correct link to the Debian bug tracker: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1064363

Is there anything else you need to begin making progress on this?

Changed in tmux (Ubuntu):
status: Incomplete → Triaged
Changed in tmux (Ubuntu Noble):
status: New → Triaged
Changed in tmux (Ubuntu):
status: Triaged → Fix Released
tags: added: server-todo
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks for the additional information, Andrej, Romain.

I added this to the server team backlog, so hopefully someone will start working on this soon.

In the meanwhile (before someone picks this up), let us know if you want to try providing a fix for this one (it could either be a debdiff here or a LP merge proposal) or to fill in the SRU paperwork for this bug (https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template).

Changed in tmux (Debian):
status: Unknown → Fix Released
Bryce Harrington (bryce)
summary: - Sync tmux (main) from Oracular (main)
+ Two Sixel support fixes needed for stabilization on noble
Changed in tmux:
status: Unknown → Fix Released
Revision history for this message
Lena Voytek (lvoytek) wrote :

Hello all,

I can take over fixing this bug in Noble. In the meantime, I've created a ppa with the fix here - https://launchpad.net/~lvoytek/+archive/ubuntu/tmux-fix-sixel-support

If you would like to test it you can run the following:

sudo add-apt-repository ppa:lvoytek/tmux-fix-sixel-support
sudo apt update
sudo apt upgrade

I haven't been able to reproduce the error myself with the following steps, does the error still exist for you Andrej?

$ ssh lena@remote-noble-server
$ sudo apt install neovim #(I've also tried installing from upstream directly)
$ tmux -vv
$ sudo nvim -u NONE
neovim opens successfully

Changed in tmux (Ubuntu Noble):
assignee: nobody → Lena Voytek (lvoytek)
status: Triaged → Incomplete
Revision history for this message
Andrej Rohaŭ (arohau) wrote :

Greetings,

The PPA version works fine for me, thank you!

Lena Voytek (lvoytek)
description: updated
Changed in tmux (Ubuntu Noble):
status: Incomplete → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.