CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
90 lines
3.1 KiB
Plaintext
90 lines
3.1 KiB
Plaintext
# Copyright 2021-2024 Free Software Foundation, Inc.
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
# Make an inferior call to a function which uses longjmp. However,
|
|
# the backtrace for the function that is called is broken at the point
|
|
# where the longjmp is handled. This test is checking to see if the
|
|
# inferior call still completes successfully.
|
|
#
|
|
# This test forces a broken backtrace using Python, but in real life a
|
|
# broken backtrace can easily occur when calling through code for
|
|
# which there is no debug information if the prologue unwinder fails,
|
|
# which can often happen if the code has been optimized.
|
|
#
|
|
# The problem was that, due to the broken backtrace, GDB failed to
|
|
# find the inferior call's dummy frame. GDB then concluded that the
|
|
# inferior had longjmp'd backward past the dummy frame and so garbage
|
|
# collected the dummy frame, this causes the breakpoint within the
|
|
# dummy frame to be deleted.
|
|
#
|
|
# When the inferior continued, and eventually returned to the dummy
|
|
# frame, it would try to execute instruction from the dummy frame
|
|
# (which for most, or even all, targets, is on the stack), and then
|
|
# experience undefined behaviuor, often a SIGSEGV.
|
|
|
|
standard_testfile .c
|
|
|
|
require allow_python_tests
|
|
|
|
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
|
|
return -1
|
|
}
|
|
|
|
if {![runto_main]} {
|
|
return 0
|
|
}
|
|
|
|
set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
|
|
gdb_test_no_output "source ${pyfile}" "load python file"
|
|
|
|
set have_longjmp_probe [have_longjmp_probe]
|
|
|
|
set re_cannot_insert_bp \
|
|
[multi_line \
|
|
"Warning:" \
|
|
"Cannot insert breakpoint $::decimal\\." \
|
|
"Cannot access memory at address $::hex"]
|
|
|
|
gdb_test_multiple "p some_func ()" "" {
|
|
-re -wrap "\r\n$re_cannot_insert_bp\r\n.*" {
|
|
if { $have_longjmp_probe } {
|
|
fail $gdb_test_name
|
|
} else {
|
|
kfail gdb/26967 $gdb_test_name
|
|
return 0
|
|
}
|
|
}
|
|
-re -wrap " = 0" {
|
|
pass $gdb_test_name
|
|
}
|
|
}
|
|
|
|
# When frame debugging is turned on, this test has (previously)
|
|
# revealed some crashes due to the Python frame unwinder trying to
|
|
# read registers.
|
|
#
|
|
# Enable frame debug and rerun the test. We don't bother checking the
|
|
# output of calling 'p some_func ()' as the output will be full of
|
|
# debug, to format of which isn't fixed. All we care about is that
|
|
# GDB is still running afterwards.
|
|
#
|
|
gdb_test_no_output "set debug frame on"
|
|
gdb_test_lines "p some_func ()" \
|
|
"repeat p some_func () with frame debug on" \
|
|
".*"
|
|
gdb_test_no_output "set debug frame off"
|
|
|
|
gdb_test "p 1 + 2 + 3" " = 6"
|