FS#78584 - [ncurses][tmux] testing/ncurses 6.4_20230520-1 breaks tmux

Attached to Project: Arch Linux
Opened by Felix Yan (felixonmars) - Wednesday, 24 May 2023, 09:58 GMT
Last edited by Christian Hesse (eworm) - Thursday, 25 May 2023, 12:32 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Christian Hesse (eworm)
David Runge (dvzrv)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
tmux crashes when copying into buffer (larger text reproduces more reliably). Downgrading ncurses to 6.4-2 fixes it.

(gdb) bt
#0 0x00005571d53a5a7a in tty_puts (s=0x0, tty=0x5571d659e858) at /usr/src/debug/tmux/tmux-3.3a/tty.c:570
#1 tty_putcode_ptr2.part.0.constprop.0 (tty=0x5571d659e858, b=<optimized out>, a=0x5571d53bcb3f, code=TTYC_MS) at /usr/src/debug/tmux/tmux-3.3a/tty.c:544
#2 0x00005571d5385afb in tty_putcode_ptr2 (code=TTYC_MS, a=0x5571d53bcb3f, b=0x5571d653d1a0, tty=0x5571d659e858) at /usr/src/debug/tmux/tmux-3.3a/tty.c:2107
#3 tty_set_selection (len=494, buf=0x5571d656df30 "_offset[4]: 896, xstate_sizes[4]: 64\nMay 24 12:39:55 flygon.felixc.at kernel: x86/fpu: Enabled xstate features 0x1f, context size is 960 bytes, using 'compacted' format.\nMay 24 12:39:55 flygon.feli"...,
tty=0x5571d659e858) at /usr/src/debug/tmux/tmux-3.3a/tty.c:2104
#4 tty_set_selection (tty=0x5571d659e858, buf=0x5571d656df30 "_offset[4]: 896, xstate_sizes[4]: 64\nMay 24 12:39:55 flygon.felixc.at kernel: x86/fpu: Enabled xstate features 0x1f, context size is 960 bytes, using 'compacted' format.\nMay 24 12:39:55 flygon.feli"...,
len=494) at /usr/src/debug/tmux/tmux-3.3a/tty.c:2089
#5 0x00005571d5385a2d in tty_write (cmdfn=0x5571d5385b00 <tty_cmd_setselection>, ctx=0x7ffd4bc83780) at /usr/src/debug/tmux/tmux-3.3a/tty.c:1630
#6 0x00005571d53aa472 in screen_write_setselection (len=494,
str=0x5571d656df30 "_offset[4]: 896, xstate_sizes[4]: 64\nMay 24 12:39:55 flygon.felixc.at kernel: x86/fpu: Enabled xstate features 0x1f, context size is 960 bytes, using 'compacted' format.\nMay 24 12:39:55 flygon.feli"..., ctx=0x7ffd4bc83740)
at /usr/src/debug/tmux/tmux-3.3a/screen-write.c:2096
#7 window_copy_copy_buffer.isra.0 (prefix=0x0, buf=0x5571d656df30, len=494, wme=<optimized out>) at /usr/src/debug/tmux/tmux-3.3a/window-copy.c:4573
#8 0x00005571d538df71 in window_copy_copy_pipe (cmd=0x0, prefix=0x0, s=0x5571d658d7a0, wme=0x5571d6586cc0) at /usr/src/debug/tmux/tmux-3.3a/window-copy.c:4617
#9 window_copy_cmd_copy_pipe_no_clear (cs=<optimized out>) at /usr/src/debug/tmux/tmux-3.3a/window-copy.c:2027
#10 0x00005571d53928ad in window_copy_cmd_copy_pipe_and_cancel (cs=<optimized out>) at /usr/src/debug/tmux/tmux-3.3a/window-copy.c:2049
#11 0x00005571d539220c in window_copy_command (wme=0x5571d6586cc0, c=<optimized out>, s=<optimized out>, wl=<optimized out>, args=<optimized out>, m=<optimized out>) at /usr/src/debug/tmux/tmux-3.3a/window-copy.c:2916
#12 0x00005571d53309db in cmd_send_keys_exec (self=0x5571d65995d0, item=0x5571d65808d0) at /usr/src/debug/tmux/tmux-3.3a/cmd-send-keys.c:176
#13 0x00005571d5324993 in cmdq_fire_command (item=0x5571d65808d0) at /usr/src/debug/tmux/tmux-3.3a/cmd-queue.c:647
#14 cmdq_next (c=<optimized out>) at /usr/src/debug/tmux/tmux-3.3a/cmd-queue.c:763
#15 0x00005571d537c11d in server_loop () at /usr/src/debug/tmux/tmux-3.3a/server.c:270
#16 0x00005571d5310c03 in proc_loop (loopcb=<optimized out>, tp=0x5571d652be80) at /usr/src/debug/tmux/tmux-3.3a/proc.c:222
#17 server_start (lockfile=<optimized out>, lockfd=5, base=0x5571d652ab10, flags=<optimized out>, client=<optimized out>) at /usr/src/debug/tmux/tmux-3.3a/server.c:251
#18 client_connect (flags=<optimized out>, path=<optimized out>, base=0x5571d652ab10) at /usr/src/debug/tmux/tmux-3.3a/client.c:164
#19 client_main (feat=0, flags=<optimized out>, argv=<optimized out>, argc=<optimized out>, base=0x5571d652ab10) at /usr/src/debug/tmux/tmux-3.3a/client.c:287
#20 main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/tmux/tmux-3.3a/tmux.c:519

Additional info:
* package version(s)
ncurses 6.4-2
tmux 3.3_a-3
This task depends upon

Closed by  Christian Hesse (eworm)
Thursday, 25 May 2023, 12:32 GMT
Reason for closing:  Fixed
Additional comments about closing:  tmux 3.3_a-4
Comment by David Runge (dvzrv) - Wednesday, 24 May 2023, 10:48 GMT
@felixonmars: thanks for the report!

As this was communicated on IRC: We have also verified that removing the newly added `--disable-root-environ` and `--disable-root-access` still leads to the observed crash with tmux.
This looks like a regression with the 20230520 patchset...
Comment by Alex Xu (Hello71) - Wednesday, 24 May 2023, 11:29 GMT Comment by David Runge (dvzrv) - Wednesday, 24 May 2023, 11:52 GMT Comment by David Runge (dvzrv) - Wednesday, 24 May 2023, 11:54 GMT Comment by David Runge (dvzrv) - Wednesday, 24 May 2023, 19:12 GMT
That commit proves non-trivial to apply. All affected functions have been renamed and some even changed signatures... -_-

Loading...