lindes / ttyload

ttyload -- "graphical" tracking of UNIX load average in a terminal ("tty")
http://www.daveltd.com/src/util/ttyload/
Other
82 stars 8 forks source link

Program received signal SIGABRT, Aborted. #8

Open mones opened 5 years ago

mones commented 5 years ago

Hi,

The clock array in clock_info has no room for final zero and causes program to abort when built with hardening flags.

You can get the patch to fix this in the Debian package from https://salsa.debian.org/debian/ttyload/blob/master/debian/patches/30-fix-sigabrt-in-strcpy.patch

Thanks!

mones commented 5 years ago

JFTR the complete stack trace of the failure:

Program received signal SIGABRT, Aborted. 0x00007ffff7a6cfff in raise () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt full

0 0x00007ffff7a6cfff in raise () from /lib/x86_64-linux-gnu/libc.so.6

No symbol table info available.

1 0x00007ffff7a6e42a in abort () from /lib/x86_64-linux-gnu/libc.so.6

No symbol table info available.

2 0x00007ffff7aaac00 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

No symbol table info available.

3 0x00007ffff7b331f7 in __fortify_fail () from /lib/x86_64-linux-gnu/libc.so.6

No symbol table info available.

4 0x00007ffff7b31330 in __chk_fail () from /lib/x86_64-linux-gnu/libc.so.6

No symbol table info available.

5 0x00007ffff7b30692 in __strcpy_chk () from /lib/x86_64-linux-gnu/libc.so.6

No symbol table info available.

6 0x0000555555555be4 in strcpy (src=0x555555559120 "^23:26", dest=)

at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:90

No locals.

7 update_clocks (thetime=1540938388, thetimetm=, position=0) at ttyload.c:132

    thetimetm = <optimized out>
    position = 0
    thetime = 1540938388
    lastclock = <optimized out>

8 0x00005555555554ec in main (argc=, argv=, envp=)

at ttyload.c:290
    newload = {one_minute = 140737488347048, five_minute = 140737488346832,
      fifteen_minute = 140737354129776, height1 = 0, height5 = 0, height15 = -8296, numloads = 32767}
    c = <optimized out>
    i = <optimized out>
    errflag = <optimized out>
    versflag = <optimized out>
    basename = <optimized out>
    thetime = 1540938388
    thetimetm = 0x7ffff7dd84a0

(gdb) quit