Mailing List Archive

another bug report
I am running ntop 2.0 beta build date 2 July. It crashes when I click on the
graph under "Network Load Statistics" page. Here is the analysis:

Cause:
thirdHostSentIdx is set to NO_PEER, code at report.c, line 2757 does not
check for such condition. It just use the value of NO_PEER which is
0xffffffff to index into hash_hostTraffic table. Hence the crash...

Here is the gdb dumps:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 7176 (LWP 28476)]
0x40046430 in makeHostLink (el=0x4030, mode=1, cutName=0, addCountryFlag=0)
at webInterface.c:189
189 webInterface.c: No such file or directory.
in webInterface.c


(gdb) bt
#0 0x40046430 in makeHostLink (el=0x4030, mode=1, cutName=0,
addCountryFlag=0)
at webInterface.c:189
#1 0x40037972 in printThptStatsMatrix (sortedColumn=1) at report.c:2757
#2 0x4002bee5 in returnHTTPPage (
pageName=0x45f7471d "thptStatsMatrix.html?1", postLen=-1) at http.c:1092
#3 0x4002d799 in handleHTTPrequest (from={s_addr = 16777343}) at
http.c:1654
#4 0x4004808d in handleSingleWebConnection (fdmask=0x45f74a2c)
at webInterface.c:1027
#5 0x40047f63 in handleWebConnections (notUsed=0x0) at webInterface.c:959
#6 0x401a4bfd in pthread_start_thread (arg=0x45f74c00) at manager.c:262
#7 0x401a4cdf in pthread_start_thread_event (arg=0x45f74c00) at
manager.c:285

value of "i" is 58 within the loop in printThptStatsMatrix()

Here is the ThptEntry indexed:

(gdb) print &(*(ntopInterface_t *)0x80c74c8)->last60MinutesThpt[58]
$8 = (ThptEntry *) 0x80c8810
(gdb) print *(ThptEntry *) 0x80c8810)
Junk after end of expression.
(gdb) print *(ThptEntry *) 0x80c8810
$9 = {trafficValue = 17758.9824, topHostSentIdx = 2387,
secondHostSentIdx = 2268, thirdHostSentIdx = 4294967295,
topSentTraffic = 13439, secondSentTraffic = 4213, thirdSentTraffic = 3149,
topHostRcvdIdx = 3194, secondHostRcvdIdx = 2970, thirdHostRcvdIdx = 763,
topRcvdTraffic = 18758, secondRcvdTraffic = 2049, thirdRcvdTraffic = 757}

I think the code should check for the NO_PEER condition and if it is true
print " " but not sure...

Francis Pintos