Segfault in clock.c:208

Adam Nielsen <[email protected]> Sun, 12 Jul 2015 16:08:57 +1000
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <[email protected]>
Hi all,

I've been using GKrellM for many years but I was never able to
successfully use the -s option to monitor a host outside my local
network.  I have recently revisited this, and found the point at which
GKrellM segfaults when connected to an external host, however I'm not
sure why.

Here is the backtrace and some info.  It looks like the data coming
back from the remote server has been corrupted somehow.  Let me know
if you have any ideas what the problem might be!

Thanks,
Adam.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff3c7232a in strlen () from /usr/lib/libc.so.6

(gdb) bt
#0  0x00007ffff3c7232a in strlen () from /usr/lib/libc.so.6
#1  0x00007ffff3ca1934 in __strftime_internal () from /usr/lib/libc.so.6
#2  0x00007ffff3ca2b76 in strftime_l () from /usr/lib/libc.so.6
#3  0x00000000004218e2 in strftime_format (format=0x78ae70 "%a <span foreground=\"$A\"><big><big>%e</big></big></span> %b", alt_color=0x84c650 "#000000")
    at clock.c:208
#4  0x0000000000421cb4 in draw_cal () at clock.c:307
#5  0x00000000004222c4 in update_clock () at clock.c:475
#6  0x00000000004150da in update_monitors () at main.c:362
#7  0x00007ffff55673a3 in ?? () from /usr/lib/libglib-2.0.so.0
#8  0x00007ffff556690d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#9  0x00007ffff5566ce0 in ?? () from /usr/lib/libglib-2.0.so.0
#10 0x00007ffff5567002 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#11 0x00007ffff78c8467 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#12 0x0000000000419df2 in main (argc=3, argv=0x7fffffffe108) at main.c:2344

(gdb) fr 3
#3  0x00000000004218e2 in strftime_format (format=0x78ae70 "%a <span foreground=\"$A\"><big><big>%e</big></big></span> %b", alt_color=0x84c650 "#000000")
    at clock.c:208
208             strftime(buf1, sizeof(buf1), locale_format, t);

(gdb) print buf1
$1 = "Sun <span foreground=\"$A\"><big><big>126975</big></big></span> \000\000\000\000\000\000\000\000\000\000]\354v\000\000\000\000\000@\335\377\377\377\177\000\000\300\n\371\363\377\177\000\000\260\334\377\377\377\177\000\000gz\305\363\377\177\000\000\260\334\377\377\377\177\000\000\020\000\000\000\060\000\000\000\240\334\377\377\377\177\000\000\340\333\377\377\377\177\000\000\260\334\377\377\377\177\000\000\360\333\377\377\377\177\000\000\376\334\377\377\377\177\000\000\004\335\377\377\377\177\000\000\000\335\377\377\377\177\000\000\004\335\377\377\377\177\000\000\022\000\000\000\000\000\000\000\000"...

(gdb) print sizeof(buf1)
$2 = 512

(gdb) print t
$3 = (struct tm *) 0x6f8be0 <server_time>

(gdb) print *t
$4 = {tm_sec = 40, tm_min = 342241, tm_hour = 6564, tm_mday = 126975, tm_mon = 369538614, tm_year = 115, tm_wday = 0, tm_yday = 192, tm_isdst = 0, 
  tm_gmtoff = 0, tm_zone = 0x0}

(gdb) print gkrellm_current_tm
$5 = {tm_sec = 41, tm_min = 30, tm_hour = 14, tm_mday = 12, tm_mon = 6, tm_year = 115, tm_wday = 0, tm_yday = 192, tm_isdst = 0, tm_gmtoff = 36000, 
  tm_zone = 0x772680 "AEST"}