develooper Front page | perl.perl5.porters | Postings from March 2001

Linux sigaction() bug?

From:
Jarkko Hietaniemi
Date:
March 9, 2001 06:26
Subject:
Linux sigaction() bug?
Message ID:
20010309082614.H17121@chaos.wustl.edu
It seems that Anders Johnson (author the recent POSIX::sigaction
patch) exposed a bug in Linux, into which I stumbled.  The attached
C program compiles and runs without assertion failures in

	AIX 4.3.1.0 (power3)
	AIX 4.3.2.0 (ppc)
	HP-UX 11.0 (hppa)
	IRIX64 6.5 (mips)
	OpenBSD 2.7 (sparc)
	Solaris 7 (sparc)
	Tru64 4.0D (alpha)
	Tru64 4.0F (alpha)
	UNICOS/MK 2.0.5.39 (alpha)

but the very last assertion fails in

	Debian 2.2 Linux 2.2.16 (x86)

Here are, I think, the relevant POSIX and SUSv2 sections, and you
can also check your own manual pages.

Assuming this is a genuine bug (even without quoting the standards
the rather exceptional behaviour of Linux smells like a problem),
how does one go reporting this Officially?

---[snip snip]---

ISO/IE 9945-1 ANSI/IEEE Std 1003.1 Second edition 1996-07-12

3.3.4 Examine and Change Signal Action

3.3.4.1 Synopsis

Function: sigaction()

#include <signal.h>

int sigaction(int sig, const struct sigaction *act,
                struct sigaction *oact);

3.3.4.2 Description

...

The structure sigaction, used to describe an action to be taken,
is defined in the header <signal.h> to include at least the
following members:

        Member Type     Member Name     Description

        void (*)()      sa_handler      SIG_DFL, SIG_IGN, or a pointer
                                        to a function.

        sigset_t        sa_mask         Additional set of signal to be
                                        blocked during execution of
                                        signal-catching function.

        int             sa_flags        Special flags to affect behavior
                                        of signal.

        void (*)(int, siginfo_t *, void *)
                        sa_sigaction    Pointer to a function.

...

If the argument act is not NULL, it points to a structure specifying
the action to be associated with the specified signal.  If the argument
oact is not NULL, the action previously associated with the signal is
stored in the location pointed to be the argument oact.  ...

And SUSv2:

If the argument act is not a null pointer, it points to a structure
specifying the action to be associated with the specified signal.
If the argument oact is not a null pointer, the action previously
associated with the signal is stored in the location pointed to by the
argument oact. If the argument act is a null pointer, signal handling
is unchanged; thus, the call can be used to enquire about the current
handling of a given signal.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About