This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gdbserver/Linux: unbreak thread event randomization
- From: sergiodj+buildbot at redhat dot com
- To: gdb-testers at sourceware dot org
- Date: Thu, 19 Mar 2015 11:23:03 -0400
- Subject: [binutils-gdb] gdbserver/Linux: unbreak thread event randomization
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 8bf3b159e55b42bb084f9da1af400a285025618f ***
Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 8bf3b159e55b42bb084f9da1af400a285025618f
gdbserver/Linux: unbreak thread event randomization
Wanting to make sure the new continue-pending-status.exp test tests
both cases of threads 2 and 3 reporting an event, I added counters to
the test, to make it FAIL if events for both threads aren't seen.
Assuming a well behaved backend, and given a reasonable number of
iterations, it should PASS.
However, running that against GNU/Linux gdbserver, I found that
surprisingly, that FAILed. GDBserver always reported the breakpoint
hit for the same thread.
Turns out that I broke gdbserver's thread event randomization
recently, with git commit 582511be ([gdbserver] linux-low.c: better
starvation avoidance, handle non-stop mode too). In that commit I
missed that the thread structure also has a status_pending_p field...
The end result was that count_events_callback always returns 0, and
then if no thread is stepping, select_event_lwp always returns the
event thread. IOW, no randomization is happening at all. Quite
curious how all the other changes in that patch were sufficient to fix
non-stop-fair-events.exp anyway even with that broken.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/gdbserver/ChangeLog:
2015-03-19 Pedro Alves <palves@redhat.com>
* linux-low.c (count_events_callback, select_event_lwp_callback):
Use the lwp's status_pending_p field, not the thread's.
gdb/testsuite/ChangeLog:
2015-03-19 Pedro Alves <palves@redhat.com>
* gdb.threads/continue-pending-status.exp (saw_thread_2)
(saw_thread_3): New globals.
(top level): Increment them when an event for the corresponding
thread is seen.
(no thread starvation): New test.
- Follow-Ups:
- Failures on Fedora-ppc64le-native-extended-gdbserver-m64, branch master
- Failures on Fedora-ppc64be-cc-with-index, branch master
- Failures on Debian-i686-native-gdbserver, branch master
- Failures on Fedora-ppc64be-native-gdbserver-m64, branch master
- Failures on Fedora-ppc64le-m64, branch master
- Failures on Fedora-ppc64be-m64, branch master
- Failures on Debian-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-ppc64be-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-cc-with-index, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-gdbserver-m32, branch master