1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Dump a backtrace with gdb

Because Ruby often fails to dump a C backtrace.
This commit is contained in:
Takashi Kokubun 2020-12-12 18:46:13 -08:00
parent 92dfe9aefb
commit 246d7e4f1d
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD
2 changed files with 2 additions and 0 deletions

View file

@ -530,6 +530,7 @@ def cleanup_coredump
core_path = "/tmp/bootstraptest-core.#{Time.now.utc.iso8601}"
warn "A core file is found. Saving it at: #{core_path.dump}"
FileUtils.mv('core', core_path)
system('gdb', RbConfig.ruby, '-c', core_path, '-ex', 'bt', '-batch')
end
FileUtils.rm_f Dir.glob('core.*')
FileUtils.rm_f @ruby+'.stackdump' if @ruby

View file

@ -357,6 +357,7 @@ module Test
core_path = "/tmp/test-unit-core.#{Time.now.utc.iso8601}"
warn "A core file is found. Saving it at: #{core_path.dump}"
FileUtils.mv('core', core_path)
system('gdb', RbConfig.ruby, '-c', core_path, '-ex', 'bt', '-batch')
end
STDERR.flush
exit c