bug-gnulib
[Top][All Lists]
Advanced

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

strerror.m4 test fails incorrectly on solaris 8 and earlier [and bonus g


From: Gary V. Vaughan
Subject: strerror.m4 test fails incorrectly on solaris 8 and earlier [and bonus gnutls bug]
Date: Tue, 28 Oct 2008 13:49:34 +0800

[[Simon, I'm Cc:ing you for the gnutls bug at the bottom]]

The current test code inside strerror.m4 says:

AC_LANG_PROGRAM(
            [[#include <string.h>
            ]],
            [[return !*strerror (-2);]])

Which is fine for Solaris 9 and 10 which return "Unknown Error",
but causes a SIGSEGV on older Solaris machines (note RETURN VALUES
below):

Standard C Library Functions                         strerror(3C)

NAME
     strerror - get error message string

SYNOPSIS
     #include <string.h>

     char *strerror(int errnum);

DESCRIPTION
     The strerror() function maps the error number in  errnum  to
     an  error  message  string,  and  returns  a pointer to that
     string.  It  uses  the  same  set  of  error   messages   as
     perror(3C). The returned string should not be overwritten.

RETURN VALUES
     The strerror() function returns NULL if  errnum  is  out-of-
     range.

The easy fix would be to change both instances of 'strerror(-2)'
to 'strerror(1)' in strerror.m4, but that is still prone to the
same failure if 1 is not a valid errno.  Maybe forcing an errno
setting error by opening a non-existent file is more prudent?

I found this while linking against gnutls, which uses the string
module, which then uses '#define strerror rpl_strerror' in its lgpl
library when strerror is not found.  That, in turn, leads to an
undefined rpl_strerror symbol in libgnutls.so.

Even with the strerror detection fixed, gnutls will still create
an unusable libgnutls.so whenever it is built on a machine that
doesn't provide a strerror implementation natively.  To fix *that*,
we either need to distribute the gnulib strerror under lgpl so
that gnutls can use it in it's lgpl library, or gnutls itself
should not reference strerror... as best as I can tell, only
cdk_strerror in opencdk/main.c calls strerror, and nothing in
gnutls calls cdk_strerror... so removing that function is also a
possible solution.

Cheers,
        Gary
--
Email me:          address@hidden                        (\(\
Read my blog:      http://blog.azazil.net              ( o.O)
And my other blog: http://www.machaxor.net              (uu )o
...and my book:    http://sources.redhat.com/autobook  ("("_)





reply via email to

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