|
From: Crispin F. <val...@fl...> - 2004-01-14 16:07:27
|
Hi,
I am using 2.1.0, (debian package), and have come across a problem with
the signal handling.
The program is a test case, where normally, and under previous versions
of valgrind, it would exit after 1 second. However using 2.1.0 it just
sits in the read() forever. This seems to be because the read() function
call is getting restarted, which is not what normally happens.
== START ==
#include <unistd.h>
#include <signal.h>
static void nullfunction( int ) {}
static void
setup_signal( int sig, void(*routine)(int) )
{
struct sigaction act;
act.sa_flags = 0;
act.sa_handler = (void(*)(int))routine;
sigemptyset( &act.sa_mask );
sigaction( sig, &act, 0 );
}
int main()
{
char buff[8];
setup_signal( SIGALRM, nullfunction );
alarm( 1 );
read( 0, buff, sizeof( buff ) );
alarm( 0 );
return 0;
}
== CUT ==
System: debian unstable,
Kernel 2.6.1, libc: debian package 2.3.2.ds1-9
Shall I put this into bugzilla ?
Crispin
|
|
From: Tom H. <th...@cy...> - 2004-01-14 16:29:44
|
In message <107...@st...>
Crispin Flowerday <val...@fl...> wrote:
> The program is a test case, where normally, and under previous versions
> of valgrind, it would exit after 1 second. However using 2.1.0 it just
> sits in the read() forever. This seems to be because the read() function
> call is getting restarted, which is not what normally happens.
[ snipped test case ]
> Shall I put this into bugzilla ?
Yes please. Looks like a problem with Jeremy's system call and signal
handling changes.
You can get the same result without using alarm by installing that
handler on SIGINT and then hitting Control-C to interrupt it - it
works normally but under valgrind the read gets restarted.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Crispin F. <val...@fl...> - 2004-01-14 16:44:10
|
> > Shall I put this into bugzilla ? > > Yes please. Looks like a problem with Jeremy's system call and signal > handling changes. Done, bug 72650 > You can get the same result without using alarm by installing that > handler on SIGINT and then hitting Control-C to interrupt it - it > works normally but under valgrind the read gets restarted. Oh, yeah, thats even worse :) Crispin |