Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 4101 (LWP 1199)]
0x4027e106 in purgeIdleHosts (actDevice=0) at hash.c:581
581           myGlobals.device[actDevice].hash_hostTraffic[idx]->numUses =
0;

556       purgeOldFragmentEntries(actDevice); /* let's do this too */
557     #ifdef MULTITHREADED
558       releaseMutex(&myGlobals.hostsHashMutex);
559     #endif
560
561       len =
sizeof(HostTraffic*)*myGlobals.device[actDevice].actualHashSize;
562       theFlaggedHosts = (HostTraffic**)malloc(len);
563       memset(theFlaggedHosts, 0, len);
564
565     #ifdef MULTITHREADED
566       accessMutex(&myGlobals.hostsHashMutex, "scanIdleLoop");
567     #endif
568       /* Calculates entries to free */
569       for(idx=1; idx<myGlobals.device[actDevice].actualHashSize; idx++)
570         if(myGlobals.device[actDevice].hash_hostTraffic[idx] != NULL) {
571           if((idx != myGlobals.otherHostEntryIdx)
572              &&
(myGlobals.device[actDevice].hash_hostTraffic[idx]->numUses == 0)
573              &&
(!subnetPseudoLocalHost(myGlobals.device[actDevice].hash_hostTraffic[idx])))
{
574
575             if(!myGlobals.stickyHosts) {
576               theFlaggedHosts[idx] =
myGlobals.device[actDevice].hash_hostTraffic[idx];
577               myGlobals.device[actDevice].hash_hostTraffic[idx] = NULL;
578             }
579           }
580
581           myGlobals.device[actDevice].hash_hostTraffic[idx]->numUses =
0;
582         }
583     #ifdef MULTITHREADED
584       releaseMutex(&myGlobals.hostsHashMutex);
585     #endif

(gdb) print actDevice
$1 = 0
(gdb) print idx
$2 = 9
(gdb) print myGlobals.device[actDevice]
$3 = {name = 0x822d388 "eth0", flags = 0, addr = 0, ipdot = 0x0, fqdn = 0x0,
network = {s_addr = 3232246272}, netmask = {
    s_addr = 4294967040}, numHosts = 256, ifAddr = {s_addr = 3232246278},
started = 0, firstpkt = 0, lastpkt = 0,
  pcapPtr = 0x822b640, pcapDumper = 0x0, pcapErrDumper = 0x0, virtualDevice
= 0 '\000', snaplen = 0, datalink = 1,
  filter = 0x0, fd = 0, fdv = 0x0, hashing = 0, ethv = 0, ipv = 0, tcpv = 0,
droppedPkts = 0, ethernetPkts = 346,
  broadcastPkts = 126, multicastPkts = 0, ipPkts = 213, ethernetBytes =
48061, ipBytes = 40153, fragmentedIpBytes = 0,
  tcpBytes = 26397, udpBytes = 6154, otherIpBytes = 0, icmpBytes = 112,
dlcBytes = 0, ipxBytes = 0, stpBytes = 0,
  decnetBytes = 0, netbiosBytes = 0, arpRarpBytes = 6046, atalkBytes = 0,
ospfBytes = 0, egpBytes = 0, igmpBytes = 0,
  osiBytes = 0, qnxBytes = 0, otherBytes = 0, lastMinEthernetBytes = 47941,
lastFiveMinsEthernetBytes = 0,
  lastMinEthernetPkts = 344, lastFiveMinsEthernetPkts = 0,
lastNumEthernetPkts = 344, lastEthernetPkts = 0,
  lastTotalPkts = 0, lastBroadcastPkts = 0, lastMulticastPkts = 0,
lastEthernetBytes = 0, lastIpBytes = 0,
  lastNonIpBytes = 0, rcvdPktStats = {upTo64 = 216, upTo128 = 65, upTo256 =
33, upTo512 = 15, upTo1024 = 7, upTo1518 = 10,
    above1518 = 0, shortest = 42, longest = 1514, badChecksum = 0, tooLong =
0}, rcvdPktTTLStats = {upTo32 = 2,
    upTo64 = 14, upTo96 = 93, upTo128 = 21, upTo160 = 69, upTo192 = 0,
upTo224 = 0, upTo255 = 14},
  peakThroughput = 1218.85291, actualThpt = 63.4000015, lastMinThpt =
63.0999985, lastFiveMinsThpt = 0,
  peakPacketThroughput = 7.23529434, actualPktsThpt = 1.0333333,
lastMinPktsThpt = 1.0333333, lastFiveMinsPktsThpt = 0,
  lastThptUpdate = 1014200673, lastMinThptUpdate = 1014200673,
lastHourThptUpdate = 1014200549,
  lastFiveMinsThptUpdate = 1014200549, throughput = 47941, packetThroughput
= 344, numThptSamples = 2, last60MinutesThpt = {
    {trafficValue = 63.0999985, topHostSentIdx = 4, secondHostSentIdx = 7,
thirdHostSentIdx = 8, topSentTraffic = 33,
      secondSentTraffic = 7, thirdSentTraffic = 4, topHostRcvdIdx = 2,
secondHostRcvdIdx = 8, thirdHostRcvdIdx = 1,
      topRcvdTraffic = 4, secondRcvdTraffic = 3, thirdRcvdTraffic = 0},
{trafficValue = 689.921875, topHostSentIdx = 4,
      secondHostSentIdx = 17, thirdHostSentIdx = 9, topSentTraffic = 30,
secondSentTraffic = 11, thirdSentTraffic = 9,
      topHostRcvdIdx = 6, secondHostRcvdIdx = 2, thirdHostRcvdIdx = 8,
topRcvdTraffic = 6, secondRcvdTraffic = 5,
      thirdRcvdTraffic = 3}, {trafficValue = 0, topHostSentIdx = 0,
secondHostSentIdx = 0, thirdHostSentIdx = 0,
      topSentTraffic = 0, secondSentTraffic = 0, thirdSentTraffic = 0,
topHostRcvdIdx = 0, secondHostRcvdIdx = 0,
      thirdHostRcvdIdx = 0, topRcvdTraffic = 0, secondRcvdTraffic = 0,
thirdRcvdTraffic = 0} <repeats 58 times>},
  last24HoursThpt = {{trafficValue = 0, topHostSentIdx = 0,
secondHostSentIdx = 0, thirdHostSentIdx = 0,
      topSentTraffic = 0, secondSentTraffic = 0, thirdSentTraffic = 0,
topHostRcvdIdx = 0, secondHostRcvdIdx = 0,
      thirdHostRcvdIdx = 0, topRcvdTraffic = 0, secondRcvdTraffic = 0,
thirdRcvdTraffic = 0} <repeats 24 times>},
  last30daysThpt = {0 <repeats 30 times>}, last60MinutesThptIdx = 2,
last24HoursThptIdx = 0, last30daysThptIdx = 0,
  tcpGlobalTrafficStats = {local = 31609, local2remote = 0, remote = 0,
remote2local = 0, lastLocal = 0,
    lastLocal2remote = 0, lastRem = 0, lastRem2local = 0},
udpGlobalTrafficStats = {local = 821, local2remote = 84,
    remote = 6007, remote2local = 1520, lastLocal = 0, lastLocal2remote = 0,
lastRem = 0, lastRem2local = 0},
  icmpGlobalTrafficStats = {local = 112, local2remote = 0, remote = 0,
remote2local = 0, lastLocal = 0,
    lastLocal2remote = 0, lastRem = 0, lastRem2local = 0}, ipProtoStats =
0x8234b48, numEstablishedTCPConnections = 11,
  pcapDispatchThreadId = 9226, hostsno = 30, actualHashSize = 32,
hashThreshold = 0, topHashThreshold = 0,
  hash_hostTraffic = 0x8231938, insertIdx = 30, hashList = 0x4076e008,
fragmentList = 0x0, tcpSession = 0x406ec008,
  numTotSessions = 65535, numTcpSessions = 1, ipTrafficMatrix = 0x406a4008,
ipTrafficMatrixHosts = 0x822ca50,
  ipTrafficMatrixPromiscHosts = {__fds_bits = {0 <repeats 32 times>}}}
(gdb) print myGlobals.device[actDevice].hash_hostTraffic[idx]
$4 = (struct hostTraffic *) 0x0
(gdb) print myGlobals.device[actDevice].hash_hostTraffic[idx].numUses
Cannot access memory at address 0x4
(gdb)

It LOOKS like hash_HostTraffic hasn't been created yet...

As a quick and dirty, I've patched it this way:

      if (myGlobals.device[actDevice].hash_hostTraffic[idx] != NULL) {
          myGlobals.device[actDevice].hash_hostTraffic[idx]->numUses = 0;
      }

-----Burton

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

Reply via email to