Hi all,

this is my first post here ...

Just managed to compile the package ntop-01-10-08.tar.gz after some "fine 
tuning" in make files on OpenBSD 2.9.
After 1-5 mins it segfaults:

(gdb) file ntop
Reading symbols from ntop...done.
(gdb) set args  -E -t 5 -w 3000 -S 1 -i "tun0,ne3" -P /usr/local/ntop/data
(gdb) run
Starting program: /usr/local/ntop/bin/ntop -E -t 5 -w 3000 -S 1 -i 
"tun0,ne3" -P /usr/local/ntop/data
.......
......
Program received signal SIGSEGV, Segmentation fault.
0x4028cc67 in computeInitialHashIdx (hostIpAddress=0x0, ether_addr=0x0, 
useIPAddressForSearching=0x787ba2)
     at hash.c:41
41        else if(memcmp(ether_addr, /* 0 doesn't matter */ 
device[0].hash_hostTraffic[broadcastEntryIdx]->ethAddress,

(gdb) bt
#0  0x4028cc67 in computeInitialHashIdx (hostIpAddress=0x0, ether_addr=0x0, 
useIPAddressForSearching=0x787ba2)
     at hash.c:41
#1  0x40297500 in getHostInfo (hostIpAddress=0x0, ether_addr=0x0, 
checkForMultihoming=0 '\000',
     forceUsingIPaddress=0) at pbuf.c:112
#2  0x402a173f in L1342 () at pbuf.c:4729
#3  0x3f30b in pcap_read ()
#4  0x40295afe in pcapDispatch (_i=0x0) at ntop.c:131
#5  0x401e829c in _thread_start ()
#6  0x17 in ?? ()


snip from hash.c:

if(((*useIPAddressForSearching) == 1) || ((ether_addr == NULL) && 
(hostIpAddress != NULL)))
{
     ....
}
else if( memcmp( ....) ....)
{

}
....

The problem arises when ether_addr and hostIpAddress are both NULL - it 
will try to
memcmp null pointer which if course segfaults ...

Don't ask my why ethernet Mac AND host IP can be NULL ... it occurs ;)

Cheers,
A. Focht.

PS: tun0 is dsl interface (which had an ip assigned at the time ntop ran)
        le1 is 1st NIC (dsl modem link, no ip assigned)
        ne3 is 2nd NIC (internal subnet link, ip assigned)

PS: I have reformatted the block statements { .. } in the hash.c source and 
recompiled then to get
        better looking stack backtrace info ;).
     


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

Reply via email to