Why do you think it's dodgy?

"<TD ALIGN=CENTER>196.38.54.68</TD>\0
                                    ^^ ends the c string

So it's just perfectly normal html - whatever was in the buffer from the
last time it was used.

The failing code (you snipped just a few lines too many - using the gdb list
command shows +-5)

          for(ifaddr = myGlobals.device[i].v6Addrs;
              ifaddr != NULL; ifaddr = ifaddr->next) {
            if(snprintf(buf, sizeof(buf), "%s/%d<br>",
                        _intop(&ifaddr->af.inet6.ifAddr, buf1,
sizeof(buf1)),
                        ifaddr->af.inet6.prefixlen) < 0)
              BufferTooShort();
            sendString(buf);
          }

Usually a SIGSEGV in xprintf() means an invalid conversion of a number, e.g.
ifaddr is NULL.  But if you look at the for() loop, that's the end
condition...  So, we're left with a bad conversion in _intop().

Your gdb output doesn't show ifaddr (that's why we suggest doing bt full -
it shows all the local variables).

Please post the bt full output.

Thanks!

-----Burton




> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
> Of Jaco van Tonder
> Sent: Tuesday, March 16, 2004 5:24 PM
> To: [EMAIL PROTECTED]
> Subject: [Ntop-dev] [FreeBSD 5.2.1-RC + CVS 3.0PRE2] Crash
>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> WHen running ntop and trying to get a traffic stats report ntop
> crashes with signal 11 and dumps core.
>
> Here is the stuff that I get when I run gdb on the core file:
>
> #0  0x280b47bf in printTrafficStatistics (revertOrder=0) at report.c:268
> 268                 if(snprintf(buf, sizeof(buf), "%s/%d<br>",
> (gdb) where
> #0  0x280b47bf in printTrafficStatistics (revertOrder=0) at report.c:268
> #1  0x280b2ad2 in returnHTTPPage (pageName=0xbfa87ad1
> "trafficStats.html", postLen=-1, from=0xbfa87cf0,
> ~    httpRequestedAt=0xbfa87688, usedFork=0xbfa87684,
> ~    agent=0xbfa87990 "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
> rv:1.6) Gecko/20040206 Firefox/0.8",
> ~    referer=0xbfa87890
> "http://mainframe.savuti.co.za:3000/Summary.html";) at http.c:1900
> #2  0x280b3b37 in handleHTTPrequest (from=
> ~              {hostFamily = 2, addr = {_hostIp4Address = {s_addr =
> 3290560096}, _hostIp6Address = {__u6_addr = {__u6_addr8 =
> "`�!�X~���\026\035)\001\0\0", __u6_addr16 = {63072, 50209, 32344,
> 49064, 5834, 10525, 1, 0}, __u6_addr32 = {3290560096, 3215490648,
> 689772234, 1}}}}}) at http.c:3083
> #3  0x280f6b3d in handleSingleWebConnection (fdmask=0xbfa87d04) at
> webInterface.c:8345
> #4  0x280f693e in handleWebConnections (notUsed=0x0) at
> webInterface.c:8194
> #5  0x291cc51e in _thread_start () from /usr/lib/libc_r.so.5
> (gdb) up 0
> #0  0x280b47bf in printTrafficStatistics (revertOrder=0) at report.c:268
> 268                 if(snprintf(buf, sizeof(buf), "%s/%d<br>",
> (gdb) p buf
> $1 = "<TD
> ALIGN=CENTER>196.38.54.68</TD>\0\0\0\0\0�\005*)\0\0\0\0����\0\0\0\
> 0\020l��\0�f\b\020m��\a�I)\a�I)�<\0\0\001m\037)\0\0\0\00l��\0�f\b\
> 004\002\037)\0\0\0\001\0\0\0\0
> \202\b\0\0\0\0\0tl���\006(�<I)�\005y\r\0t\b(\001\0\0\0\0\0\0\0\0t
> \b(\0\0\0\001�\034\b(\0{\b(\0347I)4m���\006(�<I)�\005y\r�\b\b(\bm
> ��\001\0\0\0\fm��\0p\b("...
> (gdb)
>
> I dont know gdb very well, so I am not sure if this will be enough
> information for the developers. :(
> The contents of the buf variable looks a bit dodgy though?
>
> Any thoughts?
>
> Regards,
>
> - --
> Jaco van Tonder
> Software Developer
> Direct: +27 11 312 2122 :: Fax: +27 11 312 2122 :: Mobile: +27 83 417 5424
> Email: [EMAIL PROTECTED] :: Web: http://www.coocoo.za.net/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFAV4yA/+RQBDvgOO8RAvDsAKCoWhg3s82H0XB1ABz+h28wSj9NawCghp+a
> FBH4DZJ8Wxn5ZW+78F71kTc=
> =rgp5
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Ntop-dev mailing list
> [EMAIL PROTECTED]
> http://listgateway.unipi.it/mailman/listinfo/ntop-dev
>

_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to