misc/141956: siginfo->si_pid null in signal handler

BERTRAND Joël joel.bertrand at systella.fr
Thu Dec 24 16:20:03 UTC 2009

>Number:         141956
>Category:       misc
>Synopsis:       siginfo->si_pid null in signal handler
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 24 16:20:02 UTC 2009
>Originator:     BERTRAND Joël
>Release:        8.0-STABLE
FreeBSD gauss.systella.fr 8.0-STABLE FreeBSD 8.0-STABLE #1: Mon Dec  7 15:46:01 CET 2009     root at gauss.systella.fr:/usr/obj/usr/src/sys/CUSTOM  i386

RPL/2 (http://www.rpl2.net) enters in deadlock when I try to quit application with ABORT intrinsic. I have written some test code and I find that the following code

interruption5(int signal, siginfo_t *siginfo, void *context)
    pthread_t               thread;
    struct_processus        *s_etat_processus;


    uprintf("<1> %d %d\n", (*siginfo).si_pid, getpid());
    // uprintf is a macro defined by fprintf(stderr, ...)
} // from src/interruptions.c

prints :

gauss:[~/rpl/build/src] > ./rpl -is
+++RPL/2 (R) version 4.0.8 (Thursday 12/24/09, 16:54:22 CET)
+++Copyright (C) 1989 à 2008, 2009 BERTRAND Joël

+++Ce logiciel est un logiciel libre sans aucune garantie de fonctionnement.
+++Pour plus de détails, utilisez la commande 'warranty'.

RPL/2> abort
<1> 0 32877
gauss:[~/rpl/build/src] > 

In this case, I have to see :
<1> 32877 32877
because calling process is in my case 32877 and cannot be null. RPL/2 uses this value to send a signal to a specified thread. As this value is always null, signal cannot be processed.

Of course, signal handler specification is :

        action.sa_sigaction = interruption5;
        action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO;
        // from src/rpl.c

thus siginfo->si_pid has to be filled.
Build RPL/2 and try to quit application with ABORT. The same program worked fine with FreeBSD 7.x (and with NetBSD, Linux, Solaris...).


More information about the freebsd-bugs mailing list