crash after more received than expected #36

Closed
jenhek opened this Issue Jan 25, 2013 · 2 comments

Comments

Projects
None yet
3 participants

jenhek commented Jan 25, 2013

fping crashes while reporting when it receieves more packets than expected

this hints

a) that something fundamental with the sockets might have changed recently
b) calculation and error handling near the output is susceptable to errors

------------ example output -------------
[jens@monitor-1 ~]$ /usr/sbin/fping -l -Q 60 134.130.3.126
[09:08:25]
134.130.3.126 : xmt/rcv/%loss = 60/60/0%, min/avg/max = 0.00/0.60/1.32
[09:09:25]
134.130.3.126 : xmt/rcv/%loss = 60/60/0%, min/avg/max = 0.00/0.67/7.45

[...]

[09:39:25]
134.130.3.126 : xmt/rcv/%loss = 60/60/0%, min/avg/max = 0.00/0.53/0.77
[09:40:26]
134.130.3.126 : xmt/rcv/%return = 60/63/105%, min/avg/max = 0.00*** buffer overflow detected ***: /usr/sbin/fping terminated
======= Backtrace: =========
/lib64/libc.so.6(__chk_fail+0x2f)[0x36914e8ccf]
/lib64/libc.so.6[0x36914e8139]
/lib64/libc.so.6(_IO_default_xsputn+0x94)[0x369146d5a4]
/lib64/libc.so.6(_IO_vfprintf+0xe7a)[0x36914439da]
/lib64/libc.so.6(__vsprintf_chk+0x9d)[0x36914e81dd]
/lib64/libc.so.6(__sprintf_chk+0x80)[0x36914e8120]
/usr/sbin/fping[0x401b70]
/usr/sbin/fping[0x40347f]
/usr/sbin/fping[0x40359e]
/usr/sbin/fping[0x403f4e]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x369141d9c4]
/usr/sbin/fping[0x401429]
======= Memory map: ========
00400000-00407000 r-xp 00000000 fd:00 19766302 /usr/sbin/fping
00606000-00607000 rw-p 00006000 fd:00 19766302 /usr/sbin/fping
00607000-00608000 rw-p 00607000 00:00 0
00806000-00807000 rw-p 00006000 fd:00 19766302 /usr/sbin/fping
0e66b000-0e68c000 rw-p 0e66b000 00:00 0 [heap]
3691000000-369101c000 r-xp 00000000 fd:00 1343548 /lib64/ld-2.5.so
369121c000-369121d000 r--p 0001c000 fd:00 1343548 /lib64/ld-2.5.so
369121d000-369121e000 rw-p 0001d000 fd:00 1343548 /lib64/ld-2.5.so
3691400000-369154f000 r-xp 00000000 fd:00 1343667 /lib64/libc-2.5.so
369154f000-369174f000 ---p 0014f000 fd:00 1343667 /lib64/libc-2.5.so
369174f000-3691753000 r--p 0014f000 fd:00 1343667 /lib64/libc-2.5.so
3691753000-3691754000 rw-p 00153000 fd:00 1343667 /lib64/libc-2.5.so
3691754000-3691759000 rw-p 3691754000 00:00 0
3696800000-369680d000 r-xp 00000000 fd:00 1343691 /lib64/libgcc_s-4.1.2-20080825.so.1
369680d000-3696a0d000 ---p 0000d000 fd:00 1343691 /lib64/libgcc_s-4.1.2-20080825.so.1
3696a0d000-3696a0e000 rw-p 0000d000 fd:00 1343691 /lib64/libgcc_s-4.1.2-20080825.so.1
2b53db8fb000-2b53db8fd000 rw-p 2b53db8fb000 00:00 0
2b53db90c000-2b53db90d000 rw-p 2b53db90c000 00:00 0
2b53db90d000-2b53db917000 r-xp 00000000 fd:00 1343664 /lib64/libnss_files-2.5.so
2b53db917000-2b53dbb16000 ---p 0000a000 fd:00 1343664 /lib64/libnss_files-2.5.so
2b53dbb16000-2b53dbb17000 r--p 00009000 fd:00 1343664 /lib64/libnss_files-2.5.so
2b53dbb17000-2b53dbb18000 rw-p 0000a000 fd:00 1343664 /lib64/libnss_files-2.5.so
7fffbde4a000-7fffbde5f000 rw-p 7ffffffe9000 00:00 0 [stack]
7fffbdffd000-7fffbe000000 r-xp 7fffbdffd000 00:00 0 [vdso]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vsyscall]

Can you try the following patch? I think it's the char buffer that's causing it.

--- src/fping.c.buf 2012-09-04 00:27:51.000000000 -0700
+++ src/fping.c 2013-04-16 18:58:52.085278646 -0700
@@ -2532,7 +2532,7 @@
 
 char * sprint_tm( int t )
 {
-    static char buf[10];
+    static char buf[34];
 
     /* <= 0.99 ms */
     if( t < 100 )
Owner

schweikert commented Jul 23, 2013

Assumed to be fixed in fping 3.5

schweikert closed this Jul 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment