aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-02-06 12:52:50 +0100
committerTom de Vries <tdevries@suse.de>2023-02-06 12:52:50 +0100
commit9af467b82406614deb46151f838c336a7c8604db (patch)
tree6047860ffde5fb9f3b9279f2fd715ebc853a5fb7 /include
parent980dbf36225150bf2558e5eda5f8c374adfe1323 (diff)
downloadgdb-9af467b82406614deb46151f838c336a7c8604db.zip
gdb-9af467b82406614deb46151f838c336a7c8604db.tar.gz
gdb-9af467b82406614deb46151f838c336a7c8604db.tar.bz2
[gdb/testsuite] Fix gdb.threads/schedlock.exp on fast cpu
Occasionally, I run into: ... (gdb) PASS: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: \ set scheduler-locking on continue^M Continuing.^M PASS: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: \ continue (with lock) [Thread 0x7ffff746e700 (LWP 1339) exited]^M No unwaited-for children left.^M (gdb) Quit^M (gdb) FAIL: gdb.threads/schedlock.exp: schedlock=on: cmd=continue: \ stop all threads (with lock) (timeout) ... What happens is that this loop which is supposed to run "just short of forever": ... /* Don't run forever. Run just short of it :) */ while (*myp > 0) { /* schedlock.exp: main loop. */ MAYBE_CALL_SOME_FUNCTION(); (*myp) ++; } ... finishes after 0x7fffffff iterations (when a signed wrap occurs), which on my system takes only about 1.5 seconds. Fix this by: - changing the pointed-at type of myp from signed to unsigned, which makes the wrap defined behaviour (and which also make the loop run twice as long, which is already enough to make it impossible for me to reproduce the FAIL. But let's try to solve this more structurally). - changing the pointed-at type of myp from int to long long, making the wrap unlikely. - making sure the loop runs forever, by setting the loop condition to 1. - making sure the loop still contains different lines (as far as debug info is concerned) by incrementing a volatile counter in the loop. - making sure the program doesn't run forever in case of trouble, by adding an "alarm (30)". Tested on x86_64-linux. PR testsuite/30074 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30074
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions