top SIGSEGV after running for a while

Hello!

I have been experiencing crashes in top after it runs for a day or maybe a few days. I usually have top running in some terminal in the background and every few days I tab to that terminal and it has died.

This is top from procps-ng 4.0.5-dirty. I am using Arch Linux with top shipped by the OS (Arch package procps-ng). I haven't reported this to the arch bugtracker (I can't log in right now) but I would be pretty surprised if that's an issue. Here is the Arch build script: https://gitlab.archlinux.org/archlinux/packaging/packages/procps-ng/-/blob/main/PKGBUILD. The only patch it applies is cherrypicking !247 (merged) onto 4.0.5. uname -r is "6.16.1-arch1-1".

The error message is:

	signal 11 (SEGV) was caught by top, please
	send bug reports to <procps@freelists.org>
fish: Job 1, 'top' terminated by signal SIGSEGV (Address boundary error)

Here is the stacktrace from the core dump from gdb:

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
44	      return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) thread apply all backtrace full

Thread 1 (Thread 0x7f9cc4ad6600 (LWP 5242)):
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {__val = {7017488324301889577}}
        ret = <optimized out>
#1  0x00007f9cc4898a13 in __pthread_kill_internal (threadid=<optimized out>, signo=11) at pthread_kill.c:89
No locals.
#2  0x00007f9cc483e410 in __GI_raise (sig=sig@entry=11) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#3  0x0000558fc10ec7bf in sig_abexit (sig=11) at src/top/top.c:615
        ss = {__val = {1024, 7022360127430817619, 2314885530818445420, 3616727188486174257, 8097884803526978336, 2314885394541670982, 3978708380425396256, 739271074867393079, 2314850691139990362, 2314885530818453536, 3467807035425300512, 7023208974463953696, 2314885394524893296, 2314885530818453536, 739271074832719904, 2314850730113132868}}
#4  <signal handler called>
No locals.
#5  0x0000558fc10ee4c9 in utf8_delta (str=0x0) at src/top/top.c:723
        p = <optimized out>
        clen = <optimized out>
        cnum = <optimized out>
#6  0x0000558fc10fc924 in make_str_utf8 (str=0x0, width=<optimized out>, justr=0, col=5) at src/top/top.c:1690
        delta = <optimized out>
        buf = <optimized out>
        delta = <optimized out>
#7  task_show (q=q@entry=0x558fc110a6e0 <Winstk.lto_priv.0+8352>, idx=idx@entry=9) at src/top/top.c:7117
        cp = 0x0
        i = 5
        p = <optimized out>
        rp = 0x558fc11333ff <rbuf+31> ""
        x = 4
        rbuf = " 139732   69913  1000 cooperc  \000ooperc  ?          0:22.78   0.0m 202.9m   0.6 \033(B\033[m\033[39;49m\033[32m\033[7m  1.0 \033(B\033[m\033[39;49m\033[32mpython3", ' ' <repeats 102 times>...
#8  0x0000558fc10fd6fe in window_show (q=q@entry=0x558fc110a6e0 <Winstk.lto_priv.0+8352>, wmax=55) at src/top/top.c:7280
        i = 10
        lwin = 10
        numtasks = <optimized out>
#9  0x0000558fc10eadba in frame_make () at src/top/top.c:7400
        w = 0x558fc110a6e0 <Winstk.lto_priv.0+8352>
        i = <optimized out>
        scrlins = 0
        w = <optimized out>
        i = <optimized out>
        scrlins = <optimized out>
#10 main (argc=<optimized out>, argv=<optimized out>) at src/top/top.c:7452
        ts = {tv_sec = 1, tv_nsec = 0}

Let me know if there is anything else I should grab from this coredump.

Here is ps --info:

BSD j    OL_j
BSD l    OL_l
BSD s    OL_s
BSD u    OL_u
BSD v    OL_v
SysV -f  (none)
SysV -fl (none)
SysV -j  (none)
SysV -l  (none)

procps-ng version 4.0.5-dirty
Compiled with: glibc 2.41, gcc 14.2

header_gap=-1 lines_to_next_header=1
screen_cols=166 screen_rows=60

personality=0x00000000 (from "unknown")
EUID=1000 TTY=136,8 page_size=4096
sizeof(proc_t)=8 sizeof(long)=8 sizeof(long)=8
archdefs: x86_64

Here is my .toprc:

top's Config File (Linux processes with windows)
Id:m, Mode_altscr=0, Mode_irixps=1, Delay_time=1.0, Curwin=3
Def	fieldscur=  75   77   95   79   83   80   97  103  105  119  128  121  123  117  115  111  137  107  139  145
		    84   86   88   90   92   98  100  108  112  124  126  130  132  134  140  142  146  148  150  152
		   154  156  158  160  162  164  166  168  170  172  174  176  178  180  182  184  186  188  190  192
		   194  196  198  200  202  204  206  208  210  212  214  216  218  220  222  224  226  228  230  232
		   234  236  238  240  242  244  246  248  250  252  254  256  258  260  262  264  266  268  270  272
	winflags=4864944, sortindx=32, maxtasks=0, graph_cpus=0, graph_mems=0, double_up=0, combine_cpus=0, core_types=0
	summclr=2, msgsclr=1, headclr=1, taskclr=3, task_xy=3
Job	fieldscur=  75   77  115  111  117  103  105  137  119  121  123   79  139   80   82   84   86   88   90   92
		    94   96   98  100  106  108  112  124  126  128  130  132  134  140  142  144  146  148  150  152
		   154  156  158  160  162  164  166  168  170  172  174  176  178  180  182  184  186  188  190  192
		   194  196  198  200  202  204  206  208  210  212  214  216  218  220  222  224  226  228  230  232
		   234  236  238  240  242  244  246  248  250  252  254  256  258  260  262  264  266  268  270  272
	winflags=193828, sortindx=0, maxtasks=0, graph_cpus=0, graph_mems=0, double_up=0, combine_cpus=0, core_types=0
	summclr=6, msgsclr=6, headclr=7, taskclr=6, task_xy=6
Mem	fieldscur=  75  117  119  121  123  125  127  129  131  135  137  103  105  111  139   76   78   80   82   84
		    86   88   90   92   94   96   98  100  106  108  112  114  132  140  142  144  146  148  150  152
		   154  156  158  160  162  164  166  168  170  172  174  176  178  180  182  184  186  188  190  192
		   194  196  198  200  202  204  206  208  210  212  214  216  218  220  222  224  226  228  230  232
		   234  236  238  240  242  244  246  248  250  252  254  256  258  260  262  264  266  268  270  272
	winflags=193828, sortindx=21, maxtasks=0, graph_cpus=0, graph_mems=0, double_up=0, combine_cpus=0, core_types=0
	summclr=5, msgsclr=5, headclr=4, taskclr=5, task_xy=5
Usr	fieldscur=  75   77   79   81   85   97  115  121  118  123  117  111  136  139   82   86   88   90   92   94
		    98  100  102  104  106  108  112  124  126  128  130  132  134  140  142  144  146  148  150  152
		   154  156  158  160  162  164  166  168  170  172  174  176  178  180  182  184  186  188  190  192
		   194  196  198  200  202  204  206  208  210  212  214  216  218  220  222  224  226  228  230  232
		   234  236  238  240  242  244  246  248  250  252  254  256  258  260  262  264  266  268  270  272
	winflags=703284, sortindx=24, maxtasks=0, graph_cpus=1, graph_mems=1, double_up=0, combine_cpus=0, core_types=0
	summclr=3, msgsclr=1, headclr=4, taskclr=2, task_xy=2
Fixed_widest=0, Summ_mscale=2, Task_mscale=1, Zero_suppress=0, Tics_scaled=0

I am usually in window 4 with 'A' mode off.

I haven't experienced any other misbehavior.

Edited by Christopher Cooper