🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
13 messages
13 total messages Started by Juan A. Garcia Tue, 22 Jul 1997 00:00
Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19464
Author: Juan A. Garcia
Date: Tue, 22 Jul 1997 00:00
35 lines
1625 bytes
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)

I've been looking for this routine (snprintf) in my C library, but
I think that it's pointing to an internal builtin function not
accesible:

snprintf.o (from /usr/lib/libc.a):
$ nm snprintf.o
[Index]   Value      Size    Type  Bind  Other Shndx   Name
 
[2]     |         0|       0|SECT |LOCL |0    |5      |
[3]     |         0|       0|SECT |LOCL |0    |4      |
[4]     |         0|       0|SECT |LOCL |0    |3      |
[5]     |         0|       0|SECT |LOCL |0    |2      |
[6]     |         0|     116|FUNC |GLOB |0    |2      |__snprintf
[7]     |         0|       0|NOTY |GLOB |0    |UNDEF  |_doprnt
[1]     |         0|       0|FILE |LOCL |0    |ABS    |snprintf.c



Any help would be apreciated.

Regards,
-- 
Juan.Garcia

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19467
Author: Dave Barr
Date: Tue, 22 Jul 1997 00:00
15 lines
1001 bytes
In article <33D4F714.41C6@rediris.es>,
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:

I wouldn't suggest trying to get 1.6b1 to work.  There are some serious
bugs in that release yet.

--Dave
-- 
http://www.cis.ohio-state.edu/~barr/
barr@cis.ohio-state.edu

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19473
Author: Ken Robinson
Date: Tue, 22 Jul 1997 00:00
24 lines
1350 bytes
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.



Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19500
Author: Ken Robinson
Date: Tue, 22 Jul 1997 00:00
27 lines
1516 bytes
On 22 Jul 1997 14:18:07 -0400, barr@stumble.cis.ohio-state.edu (Dave
Barr) wrote:

>I wouldn't suggest trying to get 1.6b1 to work.  There are some serious
>bugs in that release yet.

Is this just in the Solaris port, or in general?

Due to the SNI advisory, we've shut down our servers and are in the
process of upgrading to 1.6b1.  (NOTE: I'm doing this on a separate
machine in order to test the stability of it).

I know you probally don't want to answer this, but when do you expect
there to be a fairly stable (can still be a beta) version of 1.6?   Is
the current one fairly stable if you avoid certain options?

BTW,  has anybody identified (and are ready to release to the public)
where the printf problems are?  I.E.  Where do they show up ;  When
NNRPD is ran?  When a certain article is read?  When the news is first
accepted?  

Thanks.

 

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19502
Author: Dave Barr
Date: Tue, 22 Jul 1997 00:00
46 lines
2445 bytes
In article <33d60f44.590536206@nntp.uunet.ca>,
Ken Robinson <robinson@nrnsinc.on.ca> wrote:
>On 22 Jul 1997 14:18:07 -0400, barr@stumble.cis.ohio-state.edu (Dave
>Barr) wrote:
>
>>I wouldn't suggest trying to get 1.6b1 to work.  There are some serious
>>bugs in that release yet.
>
>Is this just in the Solaris port, or in general?

In general.

>Due to the SNI advisory, we've shut down our servers and are in the
>process of upgrading to 1.6b1.  (NOTE: I'm doing this on a separate
>machine in order to test the stability of it).

Good luck.  I'd be surprised if you get 1.6b1 running to an acceptable
level.

The basic story is that SNI acted in a completely irrational (and IMHO
unprofessional) manner in issuing the advisory the way they did.  First,
they should have waited until a true patch was available for the current INN.
If that wasn't forthcoming, they should have waited until 1.6 was
stable (i.e. released).  They were flat wrong in saying "go install 1.6"
when 1.6 DOES NOT EVEN EXIST!  There was only a beta version (which they did
say in the advisory), and their advisory gave no indication as to
how much of a problem it would be.

As a result, we have news admins running around in a panic with no
solution available, and people shutting down servers.  For what?
Out of ignorance.

>I know you probally don't want to answer this, but when do you expect
>there to be a fairly stable (can still be a beta) version of 1.6?

I'm not in a position to really know.  I have seen various patches
fly by for specific problems, but not for everything that is wrong
in the current 1.6beta.

--Dave
-- 
http://www.cis.ohio-state.edu/~barr/
barr@cis.ohio-state.edu

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19604
Author: USENET news
Date: Thu, 24 Jul 1997 00:00
64 lines
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.

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19608
Author: Andrew A. Vasilyev
Date: Thu, 24 Jul 1997 00:00
20 lines
1276 bytes
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)

  In Solaris 2.5.1 there are internal __snprintf() and __vsnprintf()
  functions, and in 2.6 they will be named as snprintf()/vsnprintf()

  So you can simply #define snprintf __snprintf in clibrary.h until
  2.6 be released.
________
	ANDY

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19619
Author: Casper H.S. Dik - Network Securi...
Date: Thu, 24 Jul 1997 00:00
21 lines
1324 bytes
"Andrew A. Vasilyev" <andy@demos.su> writes:

>  In Solaris 2.5.1 there are internal __snprintf() and __vsnprintf()
>  functions, and in 2.6 they will be named as snprintf()/vsnprintf()

>  So you can simply #define snprintf __snprintf in clibrary.h until
>  2.6 be released.


But then you *must* recompile when 2.6 is out as those function
are not present in 2.6's libc.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19623
Author: Casper H.S. Dik - Network Securi...
Date: Thu, 24 Jul 1997 00:00
58 lines
3027 bytes
news@news.cam.ac.uk (USENET news) writes:

>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.

What does this do?

>(b) Add " -Dsun -D__svr4__ -Xc" to the "live" CFLAGS line (not the 
>commented-out alternative one) in Makefile.

Why do they need this?

Gcc uses __svr4__ && __SVR4; Sun's compiler's use __SVR4.  Why not
use __SVR4?

Why -Xc?  That tells the include files not to include anything that's
not standard conformant. (i.e., anything that conflicts with the
user defined namespace).  Do they need to have __STDC__ defined as 1?
(Which should mean obsolute standard conformance; but gcc maintainers
feel you can defined __STDC__ as 1 w/o being standard conformant; and
have invented __STRICT_ANSI__ for that purpose.  Kinda defeats the
reason of having standards in the first place)

>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...).

You dont' need that in Solaris; it's syslog will truncate such messages.

>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


Actually, it sets __STDC__ as 0.  And you'd perhaps want
-Xc -D__EXTENSIONS__ instead. (__STDC__ as 1 but w/ the extensions)


Beats me why they think float.h is bad.


Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19625
Author: USENET news
Date: Thu, 24 Jul 1997 00:00
100 lines
5565 bytes
In article <casper.869756597@uk-usenet.uk.sun.com>,
Casper H.S. Dik - Network Security Engineer <Casper.Dik@Holland.Sun.COM> wrote:
>news@news.cam.ac.uk (USENET news) writes:
>
>>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.
>
>What does this do?

It "#undef's __STDC__" in one source file, though why that is needed is not
explained anywhere that I've noticed. This probably ties in with your 
comments below about gcc's interpretation of __STDC__ and knock-on effects 
for code written with gcc in mind.

>>(b) Add " -Dsun -D__svr4__ -Xc" to the "live" CFLAGS line (not the 
>>commented-out alternative one) in Makefile.
>
>Why do they need this?
>
>Gcc uses __svr4__ && __SVR4; Sun's compiler's use __SVR4.  Why not
>use __SVR4?
>
>Why -Xc?  That tells the include files not to include anything that's
>not standard conformant. (i.e., anything that conflicts with the
>user defined namespace).  Do they need to have __STDC__ defined as 1?
>(Which should mean obsolute standard conformance; but gcc maintainers
>feel you can defined __STDC__ as 1 w/o being standard conformant; and
>have invented __STRICT_ANSI__ for that purpose.  Kinda defeats the
>reason of having standards in the first place)

I think the answer to both questions is "because the newlog package assumes 
gcc will be used". Since I hadn't been planning on spending time building a 
new version of INN until later in the summer (and was expecting that to be 
just building 1.5.1 for our main server, when I'd been running it for a 
while on other systems), my aim was to get it working without extensive
rewriting or analysis of the supplied source code. 

The code appeared to misbehave if _STDC_ wasn't defined (tested in some
places with "#if defined(__STDC__)", in others, "#if __STDC__") and since it 
was supposedly portable (for some odd definition of portable :-), shouldn't
need any Sun extensions so that -Xc should be OK. Conditional sections
elsewhere in the code rely on test like "#if defined(sun) &&
defined(__svr4__)", so defining them explicitly was the quick solution.

[Until I worked out the above combination, linking e.g. the test programs 
needed -lsocket -lsunmath -lm, and then caused syslog messages to vanish.]

>>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...).
>
>You dont' need that in Solaris; it's syslog will truncate such messages.

I thought I'd seen that mentioned (quite probably by you on 
comp.unix.solaris!) - but wasn't sure which versions (as shipped, or with
patches?), and in any case, short of hacking things (not necessarily
extensively!), it's what happens naturally once you get past the other
problems.

>>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
>
>
>Actually, it sets __STDC__ as 0.  And you'd perhaps want
>-Xc -D__EXTENSIONS__ instead. (__STDC__ as 1 but w/ the extensions)

Ah, useful to know (and not mentioned or hinted at by "man cc", as far as 
I can see quickly :-).

>Beats me why they think float.h is bad.

It looks like the newlog code makes some odd assumptions about float.h and
then has to fix reality to match, but I haven't tried analysing just what
its requirements actually are. The README file indicates newlog's basically
bits of BSD 4.4-lite modified to fix the syslog buffer overflow problems,
plus providing snprintf for systems that don't have it. [Since this has all 
been something of a rush, I - for one - have not followed up by mailing the 
newlog contact address about these issues.]

For info, the functions which appear to be defined in the libnewlog
resulting from using the above recipe (from "nm -g") are BSD__sfvwrite,
BSD__dtoa, BSD_vfprintf, closelog, openlog, setlogmask, snprintf, strerror,
syslog, vsnprintf, vsyslog.

                                John Line
--
Cambridge University Computing Service - USENET news manager. Usually John Line
newsmaster@ucs.cam.ac.uk    (alias {newsmaster,news,usenet}@news.cam.ac.uk)

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19626
Author: Michael Douglass
Date: Thu, 24 Jul 1997 00:00
52 lines
2197 bytes
Juan A. Garcia <juan.garcia@rediris.es> wrote:

In some global header file do the following:

#define snprintf __snprintf
#define vsnprintf __vsnprintf

And you will be fine. :)

: 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)

: I've been looking for this routine (snprintf) in my C library, but
: I think that it's pointing to an internal builtin function not
: accesible:

: snprintf.o (from /usr/lib/libc.a):
: $ nm snprintf.o
: [Index]   Value      Size    Type  Bind  Other Shndx   Name
:  
: [2]     |         0|       0|SECT |LOCL |0    |5      |
: [3]     |         0|       0|SECT |LOCL |0    |4      |
: [4]     |         0|       0|SECT |LOCL |0    |3      |
: [5]     |         0|       0|SECT |LOCL |0    |2      |
: [6]     |         0|     116|FUNC |GLOB |0    |2      |__snprintf
: [7]     |         0|       0|NOTY |GLOB |0    |UNDEF  |_doprnt
: [1]     |         0|       0|FILE |LOCL |0    |ABS    |snprintf.c



: Any help would be apreciated.

: Regards,
: -- 
: Juan.Garcia

-- 
Michael Douglass
Texas Networking, Inc.

   <de> 'hail sparc, full of rammage'
   <de> 'the kernel is with thee'
   <de> 'blessed art thou amongst processors'

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19653
Author: Casper H.S. Dik - Network Securi...
Date: Fri, 25 Jul 1997 00:00
26 lines
1672 bytes
news@news.cam.ac.uk (USENET news) writes:

>>You dont' need that in Solaris; it's syslog will truncate such messages.

>I thought I'd seen that mentioned (quite probably by you on 
>comp.unix.solaris!) - but wasn't sure which versions (as shipped, or with
>patches?), and in any case, short of hacking things (not necessarily
>extensively!), it's what happens naturally once you get past the other
>problems.

As shipped (2.5 +) and patched (2.4 and earlier)

>Ah, useful to know (and not mentioned or hinted at by "man cc", as far as 
>I can see quickly :-).

It's a feature of the OS, not the compiler :-)

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

Re: Problem with 'snprintf' in Solaris 2.5 (INN 1.6b1)
#19778
Author: Andrew A. Vasilyev
Date: Mon, 28 Jul 1997 00:00
11 lines
958 bytes
Casper H.S. Dik - Network Security Engineer <Casper.Dik@Holland.Sun.COM> wrote:
CHS D-NSE> But then you *must* recompile when 2.6 is out as those function
CHS D-NSE> are not present in 2.6's libc.

  I *will* recompile it at any case: when 2.6 becomes stable
  INN becomes 1.7 :)))
________
	ANDY

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads