Bug 372600 - process loops forever when fatal signals are arriving quickly
Summary: process loops forever when fatal signals are arriving quickly
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.12 SVN
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-17 21:20 UTC by Philippe Waroquiers
Modified: 2016-11-20 15:06 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
reproducer and fix for process looping for ever when burst of fatal signals (6.10 KB, text/plain)
2016-11-17 21:20 UTC, Philippe Waroquiers
Details

Note You need to log in before you can comment on or make changes to this bug.
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.