Article View: news.software.nntp
Article #19604Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
From: USENET news
Date: Thu, 24 Jul 1997 00:00
Date: Thu, 24 Jul 1997 00:00
64 lines
3584 bytes
3584 bytes
In article <33d4fff4.586615989@nntp.uunet.ca>,
Ken Robinson <robinson@nrnsinc.on.ca> wrote:
>On Tue, 22 Jul 1997 20:08:20 +0200, "Juan A. Garcia"
><juan.garcia@rediris.es> wrote:
>
>>I get the following error when I try to compile INN 1.6b1 under
>>Solaris 2.5:
>>
>>cd frontends ; make DESTDIR= all ; cd ..
>>gcc -g -o inews inews.o ../libinn.a -lnsl -lsocket -lelf
>>Undefined first referenced
>> symbol in file
>>snprintf ../libinn.a(genid.o)
>
>The README has the following to say about this.
>
> - Many potential buffer overruns fixed. Fixing these requires
>using snprintf(), which some systems don't have. An implementation is
>supplied in the tar ball newlog-1.0.4.tar.gz
>
>I haven't tried an install yet, but this may fix your problem for ya.
Yes, you need to extra the newlog files (into a separate subdirectory, which
it will do by default as packaged currently) and run make to build
libnewlog.a. Then update LIBS in INN's config.data to include libnewlog.a in
the places that will be searched during linking. Then build INN.
On Solaris 2.5.1 with Sun's C compiler (V4.0), the recipe which I found to
work was
(a) Enable the assignment "BAD_FLOAT = -DBad_float_h" (near the top of the
newlog Makefile) by removing the "#" comment character.
(b) Add " -Dsun -D__svr4__ -Xc" to the "live" CFLAGS line (not the
commented-out alternative one) in Makefile.
without both of those steps, it would either fail to link or (if you
provided the libraries it appeared to need in order to link) would "work"
but nothing would get logged by INN via syslog. It provides a replacement
syslog() which will truncate the logged message if necessary - with an
indication that it's happened - but without the magic noted above, syslogd
wouldn't recognise those messages (or something...).
It's possible (indeed, quite likely) that both those steps are unnecessary
(and wrong) with gcc - the comment accompanying the BAD_FLOAT definition
in Makefile implies that float.h is *always* broken if you aren't using gcc
(and hence is right if using gcc :-); that seems far-fetched, but
un-commenting the line did make things work with Sun's cc, even though it
compiled OK (but didn't work) without. (b) is needed because Sun's cc
defines different preprocessor symbols to indicate you're on Sun hardware
and SVR4, and its default mode (ANSI C plus Sun extensions) does not set
_STDC_, which you get only if you specify strict ANSI C compliance with -Xc
...
John Line
PS INN 1.6b2 is available; I would advise trying that rather than 1.6b1. Up
17 hours without any crashes (admittedly on a test server with little
happening other than an incoming feed...) on Solaris 2.5.1. One instance of
core-dumping has been mentioned on the inn-workers mailing list by someone
else, though.
Technical Details
Message-ID:
<5r7gf7$knm@lyra.csx.cam.ac.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<33D4F714.41C6@rediris.es> <33d4fff4.586615989@nntp.uunet.ca>Show Full Headers
Complete Article Headers
Message-ID: <5r7gf7$knm@lyra.csx.cam.ac.uk> Subject: Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1) Date: Thu, 24 Jul 1997 00:00:00 +0000 From: news@news.cam.ac.uk (USENET news) References: <33D4F714.41C6@rediris.es> <33d4fff4.586615989@nntp.uunet.ca> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 258502380 Organization: Computing Service, Cambridge University, England Newsgroups: news.software.nntp