/usr/bin/w -s segfaults

Bug #2067250 reported by Marius Vollmer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
procps (Debian)
Confirmed
Unknown
procps (Ubuntu)
Triaged
Low
Unassigned

Bug Description

procps 2:4.0.4-4ubuntu3

Just running "w -s" segfaults:

# w -s
 07:55:26 up 8 min, 3 users, load average: 0.00, 0.03, 0.02
USER TTY FROM IDLE WHAT
Segmentation fault (core dumped)

I see if I can get a backtrace.

Revision history for this message
Marius Vollmer (marius-vollmer-gmail) wrote :

Program received signal SIGSEGV, Segmentation fault.
print_host (
    host=host@entry=0x4c <error: Cannot access memory at address 0x4c>,
    len=16, len@entry=256, fromlen=fromlen@entry=16) at src/w.c:112
112 if (*host == '\0') break;
(gdb) bt
#0 print_host (
    host=host@entry=0x4c <error: Cannot access memory at address 0x4c>,
    len=16, len@entry=256, fromlen=fromlen@entry=16) at src/w.c:112
#1 0x0000555555557161 in print_from (session=session@entry=0x0,
    u=u@entry=0x0, ip_addresses=ip_addresses@entry=0, fromlen=fromlen@entry=16)
    at src/w.c:264
#2 0x00005555555580e0 in showinfo (session=0x555555560580 "3",
    name=name@entry=0x555555560770 "root", u=u@entry=0x0,
    formtype=formtype@entry=0, maxcmd=maxcmd@entry=35, from=from@entry=1,
    userlen=8, fromlen=16, ip_addresses=0, pids=0) at src/w.c:622
#3 0x0000555555556a8f in main (argc=<optimized out>, argv=<optimized out>)
    at src/w.c:831

affects: shadow (Ubuntu) → procps (Ubuntu)
Revision history for this message
Marius Vollmer (marius-vollmer-gmail) wrote :
Changed in procps (Debian):
status: Unknown → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

The issue got fixed upstream in https://gitlab.com/procps-ng/procps/-/commit/79042e07 but it isn't in the current Debian/Ubuntu version yet

Changed in procps (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Alex Murray (alexmurray) wrote :

I think a follow-up commit might also be needed https://gitlab.com/procps-ng/procps/-/commit/b113806ccfa706e73bc2e0005eb7606d08c03850 since the code to print the results from sd_get_sessions() still has the wrong test of `if (sessions >= 0)` - this instead should be `if (sessions > 0)` which is corrected in this additional commit

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.