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]@\000\000\f", '\000' <repeats 15 times>, "[EMAIL PROTECTED]@[EMAIL PROTECTED]@\000\000\f\000����\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 = "[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]/)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



Mike Tremaine wrote:

Argh.. never mind I guess the big warning about THIS REQUIRES GNU Make
actually means this requires GNU Make...:/ (Never try to compile before
having coffee.)

So the patch seems to work fine under both cases (GD from sunfreeware
and GD by hand), and under Solaris 8 and Solaris 9. Just be sure to add
the calls to the configureextra/SOLARIS9 file.

Mine looks like.

####################
#!/bin/sh

echo "        Setting Solaris 9 specific flag values"
LDFLAGS="-L/opt/sfw/lib -L/usr/local/lib -R/opt/sfw/lib -R/usr/local/lib
${LDFLAGS}"
LIBS="-lnsl -lsocket ${LIBS}"
CPPFLAGS="-DHAVE_FILEDESCRIPTORBUG ${CPPFLAGS} -I/usr/local/include
-I/opt/sfw/include"

. configureextra/functions

#Test for GNU libiconv (e.g. SunFreeware)
test_library iconv    iconv_open
###################


Also the pbuf.c patch has not been applied.


[EMAIL PROTECTED] ~/ntop_2.2.96/ntop [5] cvs diff pbuf.c
Index: pbuf.c
===================================================================
RCS file: /export/home/ntop/ntop/pbuf.c,v
retrieving revision 2.153
diff -r2.153 pbuf.c
990c990
< u_char *tcp_data = (u_char *)((int)tcp + tcp->th_off * 4);
---


u_char *tcp_data = (u_char *)((int)tcp + tp.th_off * 4);




With these changes I see nothing stopping generic ./configure; make;
make install under Solaris 8 and 9.

Mike Tremaine
[EMAIL PROTECTED]

On Sun, 2003-11-23 at 07:50, Mike Tremaine wrote:


My bad, that was the case (SMCgd but no SMCliconv).

Just to carry this excerise out I removed the gd package and compiled a
fresh version of gd. Now when I run configure it works. However the make
now fails.

[EMAIL PROTECTED] ~/ntop_cvs/ntop [17] make
make: Fatal error in reader: Makefile, line 854: Macro assignment on
dependency
line

[EMAIL PROTECTED] ~/ntop_cvs/ntop [29] which make
/usr/ccs/bin/make


This could very well be pilot error also. Any ideas?


Mike Tremaine
[EMAIL PROTECTED]


On Sat, 2003-11-22 at 21:00, Burton M. Strauss III wrote:


Well the question is whether you have the SunFreeware version of gd but not
the corresponding libiconv installed on the machine that fails.  That would
be a pilot error, not ntop.

-----Burton


-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Mike Tremaine Sent: Saturday, November 22, 2003 8:22 PM To: [EMAIL PROTECTED] Subject: RE: [Ntop] Solaris 8 & 9 Ntop 2.2.96


Burton,


I gave this a quick try tonight and found that

On my Solaris 9 machine (after making the same changes you made to
confiureextra/SOLARIS8 to SOLARIS9) it configured and compiled fine.
This system has libiconv installed.

On a Solaris 8 box with out libiconv installed in did not compile and
failed in the same old place.

*              gd.h...yes
*              gdImageDestroy() in -lgd...no


So that's not exactly the silver bullet you were looking for.



Mike Tremaine [EMAIL PROTECTED]

On Thu, 2003-11-20 at 10:35, Burton M. Strauss III wrote:


Ok, here's the skinny from Googling...

1. There's reports of problems across a wide range of code - gnome, exim,
etc.

See for example:

http://mail.gnome.org/archives/balsa-list/2001-October/msg00165.html
"libiconv doesn't exist on solaris - the iconv_open function is in


libc."


http://mail.gnome.org/archives/balsa-list/2001-October/msg00166.html
  "The apriopriate part of configure.in is:

AC_CHECK_LIB(iconv, iconv_open, , [
        AC_CHECK_FUNC(iconv_open, , [
                        AC_MSG_ERROR([*** You need iconv for balsa.])
                        ])
        ])


2. It appears that there's a version of iconv in the library, but that the GNU libiconv version has more functionality, so people often install it. Here's the skinny from http://www.sunfreeware.com/programlistintel8.html#libiconv:

"GNU libiconv provides an iconv() implementation for use on systems which


do


not have one - installs in /usr/local."

I'm guessing that the gd version also on Sun Freeware also uses the Sun
Freeware libiconv.  Yup:

"GD Graphics Library - An ANSI C library for the dynamic creation of


images.


GD creates PNG and JPEG images, among other formats - installs in
/usr/local. The gd package requires the following library files -
libXpm.so.4.11 from xpm, libfreetype.so.6 from freetype, libgcc_s.so.1


from


libgcc-3.3 or from gcc-3.3.2, libiconv.so.2 from libiconv, libpng12.so.0
from libpng, and libz.so from zlib, and the jpeg package."




So...


If you hand compile gd and don't install libiconv, then you are OK with


the


iconv() in libc.

If you hand compile gd and have installed libiconv, we don't know which


one


is picked up.

If you install gd from SunFreeware (which requires libiconv), then you
need -liconv.


Can y'all try the attached patch?



-----Burton







-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Luca Deri Sent: Wednesday, November 19, 2003 3:32 AM To: ntop Subject: Re: [Ntop] Solaris 8 & 9 Ntop 2.2.96


-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Burton M. Strauss III wrote:

| Steve indicated his version is hand compiled, you're using the Sun
| Freeware version...
|
| (and yes, Steve, you should be building .so - shared - libraries)
|
| It's certainly possible that he created a version of gd on a system
| without libiconv that doesn't need it.  But I'm stumped about what's
| different between the 3 systems you're talking about...
|
|
| It shouldn't hurt to have an extra -l, so I wonder if we can get Luca
| to 'splain why he removed it... putting it back would be, IMHO, the
| simplest answer.
|
| Luca??


I have removed this libiconv because it's not part of Solaris, at least on the hosts I have access. What's the purpose of this library?

Cheers, Luca

|
|
| On the plus side, it looks like he commited the bus fix change into
| pbuf.c along with the other crud he did this morning (US time).
|
| -----Burton
|
|
| -----Original Message----- From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] Behalf Of Mike Tremaine Sent: Tuesday,
| November 18, 2003 12:43 PM To: [EMAIL PROTECTED] Subject: RE: [Ntop]
| Solaris 8 & 9 Ntop 2.2.96
|
|
|
|> Don't really know, but I believe Luca runs Solaris on both.
|>
|> Questions -
|>
|> 1. If you locate libiconv, do you find it on the various systems?
|>
| On 2 out of 3 systems I've tried it on. (So no pattern)
|
|> 2. Which gd are you using?  Hand compiled, or the binary from Sun
|
| Freeware?
|
|> (It could be that they have the dependency (and maybe are the
|> source of libiconv too, for that matter).
|
|
| Binary from SunFreeware because all these systems had MRTG installed
| first.
|
|> 3. You might try something fancy in the configureextra/SOLARIS9
|> file.  In the redhat9, I've got an example of using an if to test
|> for something:
|>
|> echo "        Setting RedHat 9 specific flag values"
|> CPPFLAGS="-DHAVE_FILEDESCRIPTORBUG ${CPPFLAGS}"
|>
| .. ..
|
|> would something like this work across all systems???
|>
|> if test -f /usr/lib/libiconv.so; then LIBS="-liconv ${LIBS}" fi
|>
|>
| Like I said having the libiconv is not the determining factor, I
| actaully wrote something like that as a test with pkginfo SMCiconv.
| But one system I tried it on DID NOT have the libiconv package
| installed and still failed the gd test so having that switch will not
| solve the problem. The dependency could be in GD but looks like at
| least one other person who built by hand has this problem also
| so....I'll poke around at it again when I have sometime but at least
| we know that 2.2.96 works with a few small tweaks.
|
|
|> -----Burton
|>
|
|
| -- Mike Tremaine [EMAIL PROTECTED] http://www.stellarcore.net
|
|
| _______________________________________________ Ntop mailing list
| [EMAIL PROTECTED] http://listgateway.unipi.it/mailman/listinfo/ntop
|


- -- Luca Deri <[EMAIL PROTECTED]> http://luca.ntop.org/ Hacker: someone who loves to program and enjoys being clever about it - Richard Stallman -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/uzibmMhDxnkh3zQRAs2dAJ90GKHfeymxruuiEXfXpjo/Kqx7FACdH296
hbleVTNMm8quev6JcCaEjCI=
=iNjf
-----END PGP SIGNATURE-----


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


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

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


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



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



--


+======================================================================+
| Leonardo Valcamonici                                                 |
|                                                                      |
| CASPUR                                                               |
| Italian Interuniversities Consortium for Supercomputing Applications |
| Via dei Tizii, 6b - 00185 Rome (Italy)                               |
+======================================================================+
| e-mail: [EMAIL PROTECTED]               voice : +39-6-44486311 |
| mobile: +39-335-1444455                       fax   : +39-6-4957083  |
+======================================================================+


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

Reply via email to