Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 2003 23:28:34 +0200
From:      Enache Adrian <enache@rdslink.ro>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        enache@rdslink.ro
Subject:   bin/49087: Signals lost in programs linked with libc_r
Message-ID:  <20030310212834.GA827@ratsnest.hole>

next in thread | raw e-mail | index | archive | help

>Number:         49087
>Category:       bin
>Synopsis:       Signals lost in programs linked with libc_r
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 10 13:30:10 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Enache Adrian
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD ratsnest.hole 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Thu Feb 13 15:39:05 EET 2003 root@ratsnest.hole:/opt/tmp/CUBATAO i386


	
>Description:

	FreeBSD seems to lose blocked signals in programs linked
	with libc_r. This bug shows up when running the perl
	test suite with a multithreaded perl ( i.e. linked to
	libc_r.so ), more precisely at test 11 of ext/POSIX/t/posix.t.

	
>How-To-Repeat:
	
	Built the test program below ( freely translated from Perl's
	test) with/without -lc_r ( or -pthread ) and run it.

On my -current box, I get:

$ cc sig.c -o sig
$ ./sig
sigint delayed ...
SIGINT !
*

$ cc -lc_r sig.c -o sig
$ ./sig
sigint delayed ...
*

-----< sig.c >---------------------------------------------------
#include <unistd.h>
#include <signal.h>
#include <stdio.h>

void sighup(int dummy)
{
	kill(getpid(),SIGINT);
	sleep(1);
	printf("sigint delayed ...\n");
}

void sigint(int dummy)
{
	printf("SIGINT !\n");
}

struct sigaction act;

int main()
{
	act.sa_handler = sighup;
	sigaddset(&act.sa_mask, SIGINT);
	sigaction(SIGHUP, &act, NULL);
	signal(SIGINT,sigint);
	kill(getpid(),SIGHUP);
	sleep(2);
	printf("*\n");
	return 0;
}
-----------------------------------------------------------------
>Fix:

	Any pointers appreciated.
	




>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030310212834.GA827>