bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Portability issue for error_tail().


From: Mats Erik Andersson
Subject: Portability issue for error_tail().
Date: Fri, 19 Aug 2011 03:11:14 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Dear all,

I have found an exceptional portability issue when
building GNU lib for NexentaCore/i386-pc-solaris2.11.

Said system lacks the library call

   error (status, errno, format, ...)

which therefore is brought in from GNU lib.

However, should a programmer happen to erroneously write

   error (EXIT_FAILURE, EPERM, NULL);

nothing serious will happen on GNU/Linux with Glibc,
but for NexentaCore the GNU lib code will produce a
segmentation fault in

   gnulib/error.c:265 (error_tail)  vfprintf(stderr, NULL, args)

Seemingly the Solaris library can not recover from a NULL
format string. Some sort of runtime check might be of benefit
in error_tail() to prevent this crash. Observe that the setting

   #undef _LIBC

is in effect on this particular OpenSolaris instance, and
probably on all such systems.

Best regards,
  Mats Erik Andersson, GNU Inetutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]