Bug 11593 - mi-nsmoribund.exp: unexpected stop
Summary: mi-nsmoribund.exp: unexpected stop
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: threads (show other bugs)
Version: unknown
: P2 normal
Target Milestone: 7.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-12 13:12 UTC by Jan Kratochvil
Modified: 2010-05-12 13:13 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-fedora12-linux-gnu
Build:
Last reconfirmed:


Attachments
gdb.log dump (1.82 KB, text/plain)
2010-05-12 13:13 UTC, Jan Kratochvil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2010-05-12 13:12:32 UTC
at least on Fedora kernels (tested kernel-2.6.32.12-116.fc12.x86_64) ptrace
implemented on top of utrace gdb.mi/mi-nsmoribund.exp randomly FAILs:
        FAIL: gdb.mi/mi-nsmoribund.exp: unexpected stop

It is due to moribund breakpoint location being retired too early.

Unaware if it happens with legacy ptrace implementation, it probably does not.
utrace has been optimized for the best parallelization for maximum performance
on multicore systems while still maintaining full ptrace backward
compatibility.

In the attached new debug messages instrumentated debug dump one can see
LWP 12856 has been still running the time "-break-delete" has been executed,
then (too) many stop-and-continue operations happened for other LWPs and only
then LWP 12856 finally reported SIGTRAP having already its moribund breakpoint
location retired.

Any increased value of this expression cannot help to fix the bug:
              old_loc->events_till_retirement = 3 * (thread_count () + 1);

I believe to safely retire moribunds each existing thread must get into 
(a) !is_executing() state and 
(b) all its events must get processed.

The (b) requirement may cause moribunds to be never retired during some 
debugging situations.  Also unaware how to find the (b) point now,
stop_and_resume_callback is needlessly expensive.
Comment 1 Jan Kratochvil 2010-05-12 13:13:07 UTC
Created attachment 4784 [details]
gdb.log dump