Bug 238840 - 'top' segmentation fault on terminal resize
Summary: 'top' segmentation fault on terminal resize
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-27 05:36 UTC by igor-fbsdbugs
Modified: 2019-07-07 17:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description igor-fbsdbugs 2019-06-27 05:36:58 UTC
reproducible in any 12.0-RELEASE. (11.2-RELEASE and older do not seem to have the issue)

- run xterm or tmux, resize it to 75 or 76 or 77 columns (tried a few other sizes, seems to segfault only with these three)
- run top, let it update 1-2 times
- resize terminal wide (resizing narrow won't cause the segfault).

for completeness here is the backtrace (not too useful without debug symbols, but still)

# lldb -c top.core /usr/bin/top
(lldb) target create "/usr/bin/top" --core "top.core"
Core file '/root/top.core' (x86_64) was loaded.
(lldb) bt
* thread #1, name = 'top', stop reason = signal SIGSEGV
  * frame #0: 0x00000008004d87dd libc.so.7`memcpy + 205
    frame #1: 0x00000008004d65cd libc.so.7`___lldb_unnamed_symbol1635$$libc.so.7 + 397
    frame #2: 0x0000000800470a0c libc.so.7`___lldb_unnamed_symbol1024$$libc.so.7 + 14044
    frame #3: 0x00000008003ddd0f libc.so.7`vsnprintf + 287
    frame #4: 0x000000080031d81a libsbuf.so.6`sbuf_vprintf + 138
    frame #5: 0x000000080031db0d libsbuf.so.6`sbuf_printf + 141
    frame #6: 0x000000000020af47 top`___lldb_unnamed_symbol54$$top + 1319
    frame #7: 0x000000000020e428 top`___lldb_unnamed_symbol77$$top + 2296
    frame #8: 0x000000000020611b top`___lldb_unnamed_symbol1$$top + 283
(lldb)
Comment 1 Mark Johnston freebsd_committer 2019-07-07 17:54:21 UTC
FWIW, I'm not able to reproduce this on -CURRENT.