Update of /export/home/ntop/gdchart0.94c
In directory jabber:/tmp/cvs-serv14673

Modified Files:
        buildAll.sh 
Log Message:
This is a fix to buildAll.sh to handle a nasty situation w/ RedHat 
and libpng - you can pick your target for blame.  Me? I'm mad at both!

The libpng library comes in two versions, 1.0.x and 1.2.x.

Guess what - the two versions are incompatible.  If you compile 
with one and call the other, BOOM.  No downward compatibility, 
no compatibility functions, just BOOM.  Prints a message and dies...
regardless of whether it's running as a detached thread or not.

What does that mean for ntop?

BOOM - the webserver threads die as soon as ANYONE asks for 
ANY chart.

What causes the problem?

In the ntop source tree, we have v1.2.4.

RedHat 7.x systems have been updated to libpng-1.0.14, not any 
of the 1.2.x versions...

RedHat splits the png.h from the libpng.so files:

$ rpm -q libpng -all
/usr/lib/libpng.so.2
/usr/lib/libpng.so.2.1.0.14
/usr/share/doc/libpng-1.0.14
/usr/share/doc/libpng-1.0.14/CHANGES
/usr/share/doc/libpng-1.0.14/README
/usr/share/doc/libpng-1.0.14/TODO
/usr/share/doc/libpng-1.0.14/example.c
/usr/share/doc/libpng-1.0.14/libpng.txt
/usr/share/man/man5/png.5.gz

$ rpm -q libpng-devel -all
/usr/include/png.h
/usr/include/pngconf.h
/usr/lib/libpng.a
/usr/lib/libpng.so
/usr/share/man/man3/libpng.3.gz
/usr/share/man/man3/libpngpf.3.gz


What happens, is that if you have only installed 
libpng-1.0.14-0.7x.3 (or whatever) and not the -devel rpm,
you get gdchart compiled against 1.2.4 but running against
1.0.14 and BOOM - the webserver threads die as soon as
ANYONE asks for ANY chart.

You would think that if you installed only the .so, ntop should find
the png.h is missing and complain.  Nope - the ntop ./configure 
system is SMART - it looks for the files in LOTS of places because 
stupid distributions put them in lots of places.  And there isn't 
an easy way to tell which version is which without some complex 
and fragile grep commands...

Trying to force ntop to use the version in it's source tree
is a losing proposition, because ld sees the libpng.so file
and favors it over the libpng.a in the ntop source tree.

BOOM - the webserver threads die as soon as ANYONE asks for 
ANY chart.

What this patch does is to look for the .so and DELETE the
libpng from the ntop source tree (gdchart0.94c/gd-1.8.3/libpng-1.2.4)

This SHOULD allow ntop to compile AND use the installed libpng 1.0.14
successfully.  And if you've only installed libpng and not libpng-devel,
it should complain about the missing file!

(FWIW, the current versions of libpng are now 1.0.15 and 1.2.5 -- argh!)
(No, I don't PLAN on updating)

-----Burton



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

Reply via email to