Bug 372600

Summary: process loops forever when fatal signals are arriving quickly
Product: [Developer tools] valgrind Reporter: Philippe Waroquiers <philippe.waroquiers>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: ivosh, philippe.waroquiers
Priority: NOR    
Version: 3.12 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: reproducer and fix for process looping for ever when burst of fatal signals

Description Philippe Waroquiers 2016-11-17 21:20:29 UTC
Created attachment 102283 [details]
reproducer and fix for process looping for ever when burst of fatal signals

When fatal signal are arriving quickly, several threads might handle
these fatal signals, and in parallel believe they have to vgkill the
other threads and wait for the other threads to disappear.
When this happens, the valgrind process loops forever 100% of cpu.
This a bug that was already existing in 3.11 but in 3.11 was manifesting
itself with several messages telling the process was being killed.

The patch I will attach contains a regression test which 
very quickl reproduces the problem on ppc64. You might need some
more loops on amd64.
To reproduce the problem (with the untouched trunk, as the patch fixes it):
while true
do
   ../trunk/vg-in-place --tool=none none/tests/pth_2sig
done
And after some time, V loops at 100% of cpu.

With the fix, the loop has done hundreds of runs without blocking,
on amd64 and ppc64.
Comment 1 Philippe Waroquiers 2016-11-19 14:26:15 UTC
Fixed in revision 16140
Comment 2 Ivo Raisr 2016-11-20 15:06:55 UTC
Follow up revisions r16143 and r16147.