1. If it's NOT the same problem, then start a new thread, with a better
subject and trim all the cruft out.
2. Use the problem report form - it has all the important environment
information.
3. If gdb can't find the source for the list command, then give us the few
lines of code - people often have different versions on hard drives and
can't match up line #s with any kind of ease.  On my extract, hash.c 657 is

    return(NULL);

(hard to see how that causes a SIGSEGV isn't it?)

But something sure is messed up.  The call from processIpPkt is

   srcHost = lookupHost(&ip.ip_src, ether_src,
                         /*
                           Don't check for multihoming when
                           the destination address is a broadcast address
                         */
                         (!isBroadcastAddress(&dstHost->hostIpAddress)),
                         forceUsingIPaddress, actualDeviceId);

So checkForMultihoming should be 0/1, not '104'.

The messages sound like corrupted memory (freeing a freed host entry).

Anyway, once upon a time, I *thought* I had seen a case where the same host
entry was pointed to from multiple devices and this caused a problem with
free() during purge.  I've never been able to reproduce it, so the patch has
stayed in my devel bucket.  It's attached.  Please try it and let me know -
I'm especially looking for any instances of the "in use on another device"
message.

Note that this patch enables the debug output (INDEVICEMAP_DEBUG), so it
will generate a lot of log messages.  You'll see a lot of

INDEVICEMAP_DEBUG: 08436ec0: 0000 -> 1000 ''/''

[MSGID0925966] messages.  What's of interest is any where it ends up ->
11xx.



-----Burton



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
Leonardo Valcamonici
Sent: Monday, November 24, 2003 4:29 AM
To: [EMAIL PROTECTED]
Subject: Re: [Ntop] Solaris 8 & 9 Ntop 2.2.96


Hi all. I've downloaded the latest CVS snapshot and compiled the beast
on my Solaris 8 Sparc machine. Everything goes fine (after setting
-liconv in configureextra/SOLARIS8 ...), but ntop dies with a
segmentation fault after a while. I'ts not a pbuf.c/bus error matter,
because I've seen Mike's patch has been ufficially applied.
Here follows my gdb dump:

============================================================

24/Nov/2003 11:07:52  **WARNING** Error: bad magic number
(expected=1968/real=0)
24/Nov/2003 11:07:52  **WARNING** Error: wrong bucketIdx :C3:41:C1/5.176
(expected=449/real=0)

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 7]
lookupHost (hostIpAddress=0xfdafd86c, ether_addr=0xfdafdb4e "",
    checkForMultihoming=104 'h', forceUsingIPaddress=128 '\200',
    actualDeviceId=0) at hash.c:662
662     hash.c: No such file or directory.


(gdb) list
657     in hash.c

(gdb) info stack
#0  lookupHost (hostIpAddress=0xfdafd86c, ether_addr=0xfdafdb4e "",
    checkForMultihoming=104 'h', forceUsingIPaddress=128 '\200',
    actualDeviceId=0) at hash.c:662
#1  0xff118a94 in processIpPkt (bp=0xfdafdbd6 "E\020\002<�T@", h=0xfdaffc68,
    length=586, ether_src=0xfdafdb4e "", ether_dst=0xfdafdb48 "",
    actualDeviceId=0, vlanId=-1) at pbuf.c:831
#2  0xff11d478 in processPacket (_deviceId=0x0, h=0xfdaffc68,
p=0xfdafdbc8 "")
    at pbuf.c:2593
#3  0xff11b01c in queuePacket (_deviceId=0x0, h=0xfdaffc68, p=0xd5192 "")
    at pbuf.c:1646
#4  0x17d00 in pcap_read ()
#5  0xff1148e0 in pcapDispatch (_i=0x0) at ntop.c:81

(gdb) bt full
#0  lookupHost (hostIpAddress=0xfdafd86c, ether_addr=0xfdafdb4e "",
    checkForMultihoming=104 'h', forceUsingIPaddress=128 '\200',
    actualDeviceId=0) at hash.c:662
        idx = 449
        isMultihomed = 0
        el = (HostTraffic *) 0x1001
        buf =
"[EMAIL PROTECTED]
[EMAIL PROTECTED]",
'\000' <repeats 15 times>,
"\003z\000\000\003\025\000\f~x\000\000\021�\000\000\t\200\000\000\000\000\00
[EMAIL PROTECTED]
[EMAIL PROTECTED]@\000\
000\000\000\000\000\000\001\000\000\f\000\000\000\000\001\000\000\000\000�\0
24LP\000�\206P\001y\036\210\000\000\003z\000\000\002\205\000\f~x\000\000\021
[EMAIL PROTECTED]
���\000"...
        useIPAddressForSearching = 0
        symEthName = 0x0
        ethAddr = 0x3fc1d69d <Address 0x3fc1d69d out of bounds>
        setSpoofingFlag = 0 '\000'
        numRuns = 1
        hostFound = 0
#1  0xff118a94 in processIpPkt (bp=0xfdafdbd6 "E\020\002<�T@", h=0xfdaffc68,
    length=586, ether_src=0xfdafdb4e "", ether_dst=0xfdafdb48 "",
    actualDeviceId=0, vlanId=-1) at pbuf.c:831
       sport = 0
        dport = 0
        ip = {ip_v = 4 '\004', ip_hl = 5 '\005', ip_tos = 16 '\020',
  ip_len = 572, ip_id = 48212, ip_off = 16384, ip_ttl = 60 '<',
  ip_p = 6 '\006', ip_sum = 7277, ip_src = {S_un = {S_un_b = {s_b1 = 193
'�',
        s_b2 = 204 '�', s_b3 = 5 '\005', s_b4 = 176 '�'}, S_un_w = {
        s_w1 = 49612, s_w2 = 1456}, S_addr = 3251373488}}, ip_dst =
{S_un = {
      S_un_b = {s_b1 = 193 '�', s_b2 = 205 '�', s_b3 = 218 '�',
        s_b4 = 160 ' '}, S_un_w = {s_w1 = 49613, s_w2 = 55968},
      S_addr = 3251493536}}}
        tp = {th_sport = 445, th_dport = 3570, th_seq = 4089606240,
  th_ack = 1508956127, th_off = 5, th_x2 = 0, th_flags = 16 '\020',
  th_win = 64716, th_sum = 64392, th_urp = 0}
        up = {uh_sport = 65300, uh_dport = 31680, uh_ulen = -236,
  uh_sum = 31684}
        icmpPkt = {icmp_type = 255 '�', icmp_code = 0 '\000', icmp_cksum
= 0,
  icmp_hun = {ih_pptr = 0 '\000', ih_gwaddr = {S_un = {S_un_b = {
          s_b1 = 0 '\000', s_b2 = 255 '�', s_b3 = 0 '\000', s_b4 = 0
'\000'},
        S_un_w = {s_w1 = 255, s_w2 = 0}, S_addr = 16711680}}, ih_idseq = {
      icd_id = 255, icd_seq = 0}, ih_void = 16711680, ih_pmtu = {
      ipm_void = 255, ipm_nextmtu = 0}, ih_rtradv = {irt_num_addrs = 0
'\000',
      irt_wpa = 255 '�', irt_lifetime = 0}}, icmp_dun = {id_ts = {
      its_otime = 65280, its_rtime = 2164326400, its_ttime = 0}, id_ip = {
     idi_ip = {ip_v = 0 '\000', ip_hl = 0 '\000', ip_tos = 0 '\000',
        ip_len = -256, ip_id = 33025, ip_off = 0, ip_ttl = 0 '\000',
        ip_p = 0 '\000', ip_sum = 0, ip_src = {S_un = {S_un_b = {
              s_b1 = 255 '�', s_b2 = 20 '\024', s_b3 = 76 'L', s_b4 = 80
'P'},
            S_un_w = {s_w1 = 65300, s_w2 = 19536}, S_addr = 4279520336}},
        ip_dst = {S_un = {S_un_b = {s_b1 = 0 '\000', s_b2 = 0 '\000',
              s_b3 = 0 '\000', s_b4 = 60 '<'}, S_un_w = {s_w1 = 0, s_w2
= 60},
            S_addr = 60}}}}, id_mask = 65280, id_data = ""}}
        hlen = 20
        tcpDataLength = 4294967295
        udpDataLength = 4256159856
        off = 4256160590
        tcpUdpLen = 4256159856
        idx = 4256160726
        srcHost = (HostTraffic *) 0x23fc
        dstHost = (HostTraffic *) 0x9c4758
        forceUsingIPaddress = 0 '\000'
        tvstrct = {tv_sec = 0, tv_usec = 3072}
        theData = (u_char *) 0xfdafdbd6 "E\020\002<�T@"
        found = 0 '\000'
        ctr = {value = 1514, modified = 0 '\000'}
        protoList = (ProtocolsList *) 0xfdafdb4e
#2  0xff11d478 in processPacket (_deviceId=0x0, h=0xfdaffc68,
p=0xfdafdbc8 "")
    at pbuf.c:2593
        pppoe_hdr = (struct pppoe_hdr *) 0xfdafdb4e
        protocol = 0
        srcHost = (HostTraffic *) 0x0
        dstHost = (HostTraffic *) 0x800
        ehdr = {ether_dhost = {ether_addr_octet = "\000\003G�k\003"},
  ether_shost = {ether_addr_octet = "\000\006)�A�"}, ether_type = 2048}
        trp = (struct tokenRing_header *) 0xfdafdbd6
        fddip = (struct fddi_header *) 0xfdafdb4e
        hlen = 14
        caplen = 2048
        headerDisplacement = 4279533632
        length = 586
        orig_p = (u_char *) 0xfdafdbc8 ""
        p1 = (u_char *) 0xfdafdb4e ""
        ether_src = (u_char *) 0xfdafdb4e ""
        ether_dst = (u_char *) 0xfdafdb48 ""
        eth_type = 2048
        trllc = (struct tokenRing_llc *) 0xfdafdbd6
        ipxBuffer =
"�����\022t��\024\205��\023%��\024\205�\000\000\000\000\000\000.c\000\000\00
0\000\000\000\000\000\000\000\f\000\000\000\b\000\000\000\000\016\000\000\b\
000\000\000\000\000\000\000\002J�\024LP�\024\204��\023!H\000\000\006o\000\00
[EMAIL PROTECTED]",
'\000' <repeats 15 times>
        actualDeviceId = 0
        vlanId = -1
#3  0xff11b01c in queuePacket (_deviceId=0x0, h=0xfdaffc68, p=0xd5192 "")
    at pbuf.c:1646
        p1 =
"\000\003G�k\003\000\006)�A�\b\000E\020\002<[EMAIL PROTECTED]<\006\034m��\005����
\000\026\214s�\203��\204\005\ecP\030Dpr�\000\000\000\000\002\r%;-i�����\227\
035�W��\220\002�/:\210�'�\214�\213)[EMAIL PROTECTED])9
��X�E�3}\202�W+\023\"[EMAIL PROTECTED]
�u\0056\f!�/)Pc=�[ot��.�lp�RM�\216t�\004\"Q�\214�$r��\023B�~\002\002�x�"...
        len = 8232
#4  0x17d00 in pcap_read ()
No symbol table info available.
#5  0xff1148e0 in pcapDispatch (_i=0x0) at ntop.c:81
        rc = 872040
        pcapStats = {ps_recv = 0, ps_drop = 0, ps_ifdrop = 0}
        pcapStats = {ps_recv = 0, ps_drop = 0, ps_ifdrop = 0}

=============================================================

Any hint?
Cheers Leonardo


Attachment: BMS0380-dupfree.patch
Description: Binary data

Reply via email to