Bug 5234 - code observers gets updateHit several times when observing task hits the address
Summary: code observers gets updateHit several times when observing task hits the address
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks: 2229
  Show dependency treegraph
 
Reported: 2007-10-30 19:33 UTC by Petr Machata
Modified: 2008-04-21 10:28 UTC (History)
0 users

See Also:
Host: i686-redhat-linux-gnu
Target: i686-redhat-linux-gnu
Build: i686-redhat-linux-gnu
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Machata 2007-10-30 19:33:42 UTC
When you register one (observer, address) combination to several tasks, the
observer gets one updateHit for each registration when any of the tasks hits the
breakpoint.
Comment 1 Petr Machata 2007-10-30 22:57:45 UTC
Clarification.  The updateHit is really called several times, with the same
combination of task and address.  This ltrace output snippet exhibits the problem:
[22688] call thr->printf(3215026272, 0, 0, 0)\
[22688]  call thr->printf(3215026272, 0, 0, 0)\
[22688]   call thr->printf(3215026272, 0, 0, 0)\
[22688]    call thr->printf(3215026272, 0, 0, 0)\
[22688]     call thr->printf(3215026272, 0, 0, 0)\
[22688]      call thr->printf(3215026272, 0, 0, 0)
[22688]       syscall write(4, 4
, 3086082048)4

[22688]       syscall leave write = 2
[22688]      leave printf = 2
[22688]     leave printf = 2
[22688]    leave printf = 2
[22688]   leave printf = 2
[22688]  leave printf = 2
Comment 2 Petr Machata 2007-10-30 23:21:14 UTC
I added a testcase, testMultiTaskUpdateCalledSeveralTimes.
Comment 3 Mark Wielaard 2008-04-21 10:28:24 UTC
commit c9b6156e7b4d4ab4ccb29024e22625901595c15b
Author: Mark Wielaard <mwielaard@redhat.com>
Date:   Mon Apr 21 12:24:08 2008 +0200

    Record Task registering TaskObserver.Code with BreakpointAddresses. Bug #5234.

    frysk-core/frysk/proc/live/ChangeLog
    2008-04-21  Mark Wielaard  <mwielaard@redhat.com>

            * BreakpointAddresses.java: Mark class and methods package private.
            (CodeObserver): New final static helper class.
            (addBreakpoint): Take CodeObserver as argument, not
            TaskObserver.Code.
            (removeBreakpoint): Likewise.
            (getCodeObservers): Return collection of CodeObservers, not
            TaskObserver.Code.
            * LinuxPtraceProc.java (BreakpointAction.run): Install or remove
            BreakpointAddresses.CodeObserver instead of bare TaskObserver.Code.
            * LinuxPtraceTask.java (notifyCodeBreakpoint): Check Task against
            BreakpointAddresses.CodeObserver.
            * TestTaskObserverCode.java (testMultiTaskUpdateCalledSeveralTimes):
            Resolved bug #5234.