mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fixed up 56ca006784
Run lldb just before sending ABRT or KILL signal. Some tests terminate child processes by TERM signal intentionally.
This commit is contained in:
parent
de5e0f7c06
commit
eb2b7fca43
1 changed files with 13 additions and 6 deletions
|
@ -87,14 +87,19 @@ module EnvUtil
|
|||
pgroup = pid
|
||||
end
|
||||
|
||||
if /darwin/ =~ RUBY_PLATFORM
|
||||
# sudo -n: --non-interactive
|
||||
# lldb -p: attach
|
||||
# -o: run command
|
||||
puts `sudo -n lldb -p #{pid} --batch -o "bt all" -o "call rb_vmdebug_stack_dump_all_threads()" -o quit`
|
||||
end
|
||||
lldb = true if /darwin/ =~ RUBY_PLATFORM
|
||||
|
||||
while signal = signals.shift
|
||||
|
||||
if lldb and [:ABRT, :KILL].include?(signal)
|
||||
lldb = false
|
||||
# sudo -n: --non-interactive
|
||||
# lldb -p: attach
|
||||
# -o: run command
|
||||
system(*%W[sudo -n lldb -p #{pid} --batch -o bt\ all -o call\ rb_vmdebug_stack_dump_all_threads() -o quit])
|
||||
true
|
||||
end
|
||||
|
||||
begin
|
||||
Process.kill signal, pgroup
|
||||
rescue Errno::EINVAL
|
||||
|
@ -108,6 +113,8 @@ module EnvUtil
|
|||
begin
|
||||
Timeout.timeout(reprieve) {Process.wait(pid)}
|
||||
rescue Timeout::Error
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue