|
From: Tom H. <th...@cy...> - 2003-10-21 23:10:05
|
In message <1066774658.4409.2.camel@localhost.localdomain>
Jeremy Fitzhardinge <je...@go...> wrote:
> OK, there seems to be some slight timing difference between 2.4-RH and
> 2.6, or something. Anyway, I think this is the right fix - can you test
> it out?
I'm running on a dual processor box which may change things given
that there are at least three threads of control running here.
That patch certainly improves things - it fixes the case where there is
no handler installed for the signal. The modified test program that is
attached to this message, and which installs a SIGCHLD handler, exhibits
a different problem however.
Specifically the wait4 system call exists with ERESTARTSYS but is isn't
restarted and the waitpid library call returns 114 which is the number of
the wait4 system call, as shown here:
==9444== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
==9444== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==9444== Using valgrind-20030725, a program supervision framework for x86-linux.
==9444== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
--9444-- sys_wait_results: got PX_SetSigmask for TID 1
--9444-- sys_wait_results: got PX_SetSigmask for TID 1
==9444== Estimated CPU clock rate is 2005 MHz
==9444== For more details, rerun with: -v
==9444==
SYSCALL[9444,1](174) special:sigaction ( 17, 0xBFFFD420, 0x0 )
SYSCALL[9444,1]( 2):fork ()
fork: process 9444 created child 9451
SYSCALL[9444,1]( 37):kill ( 9451, 9 )
SYSCALL[9444,1](114) blocking:wait4 ( 9451, 0xBFFFD504, 0, 0x0 )
--9444-- sys_wait_results: got PX_Signal for TID 1, signal 17
--9444-- sys_wait_results: got PX_RunSyscall for TID 1: syscall 114 result -512
--9444-- sys_wait_results: got PX_SetSigmask for TID 1
SYSCALL[9444,1](197):fstat64 ( 1, 0xBFFFCD20 )
SYSCALL[9444,1](192):mmap2 ( 0x0, 4096, 3, 34, -1, 0 )
==9444== Use of uninitialised value of size 4
==9444== at 0x4027C94F: _IO_vfprintf_internal (in /lib/i686/libc-2.3.2.so)
==9444== by 0x40285311: _IO_printf (in /lib/i686/libc-2.3.2.so)
==9444== by 0x8048668: main (in /home/thh/vgtest/sigkill)
==9444== by 0x40248A06: __libc_start_main (in /lib/i686/libc-2.3.2.so)
==9444==
==9444== Conditional jump or move depends on uninitialised value(s)
==9444== at 0x4027C957: _IO_vfprintf_internal (in /lib/i686/libc-2.3.2.so)
==9444== by 0x40285311: _IO_printf (in /lib/i686/libc-2.3.2.so)
==9444== by 0x8048668: main (in /home/thh/vgtest/sigkill)
==9444== by 0x40248A06: __libc_start_main (in /lib/i686/libc-2.3.2.so)
==9444==
==9444== Conditional jump or move depends on uninitialised value(s)
==9444== at 0x4027C020: _IO_vfprintf_internal (in /lib/i686/libc-2.3.2.so)
==9444== by 0x40285311: _IO_printf (in /lib/i686/libc-2.3.2.so)
==9444== by 0x8048668: main (in /home/thh/vgtest/sigkill)
==9444== by 0x40248A06: __libc_start_main (in /lib/i686/libc-2.3.2.so)
==9444==
==9444== Conditional jump or move depends on uninitialised value(s)
==9444== at 0x4027C07E: _IO_vfprintf_internal (in /lib/i686/libc-2.3.2.so)
==9444== by 0x40285311: _IO_printf (in /lib/i686/libc-2.3.2.so)
==9444== by 0x8048668: main (in /home/thh/vgtest/sigkill)
==9444== by 0x40248A06: __libc_start_main (in /lib/i686/libc-2.3.2.so)
==9444==
==9444== Conditional jump or move depends on uninitialised value(s)
==9444== at 0x4027C0AF: _IO_vfprintf_internal (in /lib/i686/libc-2.3.2.so)
==9444== by 0x40285311: _IO_printf (in /lib/i686/libc-2.3.2.so)
==9444== by 0x8048668: main (in /home/thh/vgtest/sigkill)
==9444== by 0x40248A06: __libc_start_main (in /lib/i686/libc-2.3.2.so)
==9444==
==9444== Conditional jump or move depends on uninitialised value(s)
==9444== at 0x4027C0E0: _IO_vfprintf_internal (in /lib/i686/libc-2.3.2.so)
==9444== by 0x40285311: _IO_printf (in /lib/i686/libc-2.3.2.so)
==9444== by 0x8048668: main (in /home/thh/vgtest/sigkill)
==9444== by 0x40248A06: __libc_start_main (in /lib/i686/libc-2.3.2.so)
==9444==
==9444== Conditional jump or move depends on uninitialised value(s)
==9444== at 0x4027C10C: _IO_vfprintf_internal (in /lib/i686/libc-2.3.2.so)
==9444== by 0x40285311: _IO_printf (in /lib/i686/libc-2.3.2.so)
==9444== by 0x8048668: main (in /home/thh/vgtest/sigkill)
==9444== by 0x40248A06: __libc_start_main (in /lib/i686/libc-2.3.2.so)
SYSCALL[9444,1]( 4) blocking:write ( 1, 0x40230000, 40 )
Child 114 exited with status 1073831928
--9444-- sys_wait_results: got PX_RunSyscall for TID 1: syscall 4 result 40
SYSCALL[9444,1]( 91):munmap ( 0x40230000, 4096 )
--9444-- Caught __NR_exit; running __libc_freeres()
SYSCALL[9444,1]( 91):munmap ( 0x0, 0 )
--9444-- __libc_freeres() done; really quitting!
==9444==
==9444== ERROR SUMMARY: 25 errors from 7 contexts (suppressed: 0 from 0)
==9444== malloc/free: in use at exit: 0 bytes in 0 blocks.
==9444== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==9444== For a detailed leak analysis, rerun with: --leak-check=yes
==9444== For counts of detected errors, rerun with: -v
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|