Squid and mallinfo() on Solaris 2

From: WWW server manager <webadm@dont-contact.us>
Date: Sun, 24 Aug 1997 11:07:24 +0100 (BST)

Some cachemgr output that was included in a recent message, and which
included detailed malloc statistics, prompted me to investigate why I don't
get such statistics (with Squid 1.NOVM.15 at present, but I don't recall
seeing the stats with earlier versions), on a Solaris 2.5 system.

Looking at the Squid source, configure.in, config.cache, suggests that
configure is deciding that neither basic mallinfo nor an extended (extra
information available) version can be found, even though "man mallinfo" said
mallinfo() existed, though on closer examination I saw that was misleading.

"man mallinfo" finds a man page (in section 3x) which includes a
non-extended mallinfo along with malloc etc. (and documents needing -lmalloc
for linking), but "man malloc" finds a section 3c man page which does not
include mallinfo (when linking without -lmalloc). It looks as though libc
does not include mallinfo, but that an extended library (actually
/usr/ccs/lib/libmalloc.*) includes mallinfo. Worryingly, configure.in seems
to have an explicit check which avoids looking for libmalloc on Solaris 2
systems...

If not lost in the mists of time, does anyone know why configure.in
explicitly avoids the library which includes mallinfo? Is it, in fact, safe
to use -lmalloc with Squid on Solaris 2 (2.4? 2.5?), getting mallinfo and
the associated version of malloc etc.? If it *is* OK to use -lmalloc, is
there any way to get configure to use it short of attacking configure.in
with an editor to remove the explicit check (and is that sufficient for it
to find it in /usr/ccs/lib)?

I suspect the answer will be "mallinfo is ignored because that library is
broken", but alternatively it may be "... that library was broken in earlier
versions of Solaris 2", and it's OK to use now.

[The -lmalloc versions are documented as *not* preserving the
contents of freed blocks (mmm, wonder why that should matter to anyone :-)
unless M_KEEP is set with mallopt(), and "undocumented features of
malloc(3C) have not been duplicated". I don't know if either of these points
matters to squid.]

                                John Line

-- 
University of Cambridge WWW manager account (usually John Line)
Send general WWW-related enquiries to webmaster@ucs.cam.ac.uk
Received on Sun Aug 24 1997 - 03:11:21 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:36:48 MST