|
Nope, that's pretty clear WHAT is wrong ...
myGlobals.runningPrefs.enableSessionHandling isn't readable.
What makes no sense is that none of this is pointer based
...
typedef struct ntopGlobals {
...
/* User-configurable parameters via the command line
and the web page. */
UserPref savedPref; /* this is what is saved */ UserPref runningPref; /* this is what is currently used */ ... }
NtopGlobals;
with:
typedef struct _userPref
{
... bool
enableSessionHandling; /* -z | --disable-sessions
*/
...
} UserPref; With myGlobals static in
globals-core.c:
NtopGlobals
myGlobals;
I
wonder if - in the interest of 'performance' or some such, RH has chosen not to
initialize memory? But that wouldn't explain why myGlobals wasn't zeroed
before the failing line, even so. All that actually happened before the
memset() in 3.1 was the command line pre-processing.
All I
can say is that there's a ton of changes in that area in the cvs, related to the
single state variable enhancement and to try
that version.
For example, the main() code in the cvs now begins
thusly: #ifdef
WIN32
int ntop_main(int argc, char *argv[]) { #else int main(int argc, char *argv[]) { #endif int i, rc, userSpecified; ...
char main_buf[LEN_GENERAL_WORK_BUFFER], lib[LEN_GENERAL_WORK_BUFFER], env[LEN_GENERAL_WORK_BUFFER], buf[LEN_GENERAL_WORK_BUFFER];
/* printf("Wait please: ntop is coming up...\n"); */
#ifdef
MTRACE
mtrace(); #endif #ifdef
MEMORY_DEBUG
initLeaks(); /* Don't move this below nor above */ #endif
/* VERY FIRST THING is to clear myGlobals, so myGlobals.ntopRunState can be used
*/
memset(&myGlobals, 0, sizeof(myGlobals)); setRunState(FLAG_NTOPSTATE_PREINIT); ...
Anyway, back to my earlier comments:
(1) We don't support other people's RPMs. Just no way to know what version it is, what patches, etc.
<snip />
(3) Use the source and see if it still fails. -----Burton
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Randy Gordey Sent: Wednesday, August 03, 2005 9:32 AM To: [email protected] Subject: RE: [Ntop-dev] BUG: build on FC4 #wget http://easynews.dl.sourceforge.net/sourceforge/ntop/ntop-3.1.tgz #tar -xvzf ntop-3.1.tgz #cd ntop #./configure (I can attach config.log if you think it will help it didn’t complain about anything other than xmldump plugin) #make #make install
[EMAIL PROTECTED] ~]# gdb ntop GNU gdb Red Hat Linux (6.3.0.0-1.21rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) set args -u root -K (gdb) r Starting program: /usr/local/bin/ntop -u root -K Reading symbols from shared object read from target memory...done. Loaded system supplied DSO at 0xc08000 [Thread debugging using libthread_db enabled] [New Thread -1208338752 (LWP 32287)] Wed Aug 3 10:06:18 2005 Initializing gdbm databases Wed Aug 3 10:06:18 2005 ntop v.3.1 MT (SSL) Wed Aug 3 10:06:18 2005 Configured on Aug 3 2005 10:02:06, built on Aug 3 2005 10:03:25. Wed Aug 3 10:06:18 2005 Copyright 1998-2004 by Luca Deri <[EMAIL PROTECTED]> Wed Aug 3 10:06:18 2005 Get the freshest ntop from http://www.ntop.org/ Wed Aug 3 10:06:18 2005 Initializing ntop Wed Aug 3 10:06:18 2005 Checking eth0 for additional devices Wed Aug 3 10:06:18 2005 Added virtual interface: 'eth0:1' Wed Aug 3 10:06:18 2005 Resetting traffic statistics for device eth0 Wed Aug 3 10:06:18 2005 DLT: Device 0 [eth0] is 1, mtu 1514, header 14
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1208338752 (LWP 32287)] initNtop (devices=Cannot access memory at address 0x8 ) at globals-core.c:602 602 if(myGlobals.runningPref.enableSessionHandling) (gdb) list 597 */ 598 if (myGlobals.capturePackets == FLAG_NTOPSTATE_RUN) { 599 initDevices(devices); 600 } 601 602 if(myGlobals.runningPref.enableSessionHandling) 603 initPassiveSessions(); 604 605 /* ********************************** */ 606 (gdb) frame 5 Cannot access memory at address 0x4 (gdb) bt full #0 initNtop (devices=Cannot access memory at address 0x8 ) at globals-core.c:602 value = Cannot access memory at address 0xffffffd0 (gdb)
Burton, what else would you like to see and I would be happy to try that too.
Kind Regards
<snip />
|
_______________________________________________ Ntop-dev mailing list [email protected] http://listgateway.unipi.it/mailman/listinfo/ntop-dev
