Comment 9 for bug 19277

Revision history for this message
In , philips (brandon-ifup) wrote : procps: backtrace of top segfault w/ xterm of small height

Package: procps
Version: 1:3.2.6-2.1
Followup-For: Bug #256376

Hello-

I recompiled procps-3.2.6 with CFLAGS="-ggdb -O" and received the
following backtraces when running from a terminal with a very small
height.

After looking at the code it seems that the
free(*table[curmax]->cmdline) line is only reached when a terminal is
resized to a very tiny height.

Hopefully that can lead someone down the way to a patch.

 Brandon

1107 free(*table[curmax]->cmdline);
(gdb) bt
#0 0x0804b80d in procs_refresh (table=0x80650d0, flags=73) at top.c:1107
#1 0x0804ef25 in summary_show () at top.c:2934
#2 0x08051651 in frame_make () at top.c:3274
#3 0x080518e2 in main (dont_care_argc=1, argv=0x2) at top.c:3339

Program received signal SIGABRT, Aborted.
0xb7e647c7 in raise () from /lib/tls/libc.so.6
(gdb) bt
#0 0xb7e647c7 in raise () from /lib/tls/libc.so.6
#1 0xb7e6606b in abort () from /lib/tls/libc.so.6
#2 0xb7e9b545 in __fsetlocking () from /lib/tls/libc.so.6
#3 0xb7ea398e in free () from /lib/tls/libc.so.6
#4 0xb7ea43f9 in realloc () from /lib/tls/libc.so.6
#5 0x0804b2c3 in alloc_r (q=0x0, numb=702) at top.c:898
#6 0x0804e084 in wins_resize () at top.c:2416
#7 0x0805190d in main (dont_care_argc=1, argv=0xb7f6eff4) at top.c:3340

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages procps depends on:
ii libc6 2.3.6-3 GNU C Library: Shared libraries an
ii libncurses5 5.5-1 Shared libraries for terminal hand

Versions of packages procps recommends:
ii psmisc 22.1-1 Utilities that use the proc filesy

-- no debconf information