Bug 3131 - Adding a second observer to a running task with a syscall observer = exception
Summary: Adding a second observer to a running task with a syscall observer = exception
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Phil Muldoon
URL:
Keywords:
Depends on:
Blocks: 1524
  Show dependency treegraph
 
Reported: 2006-08-25 13:44 UTC by Andrew Cagney
Modified: 2008-03-13 21:44 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2006-08-25 13:44:44 UTC
From downstream:

Description of problem:
Adding a second observer to a running task with a syscall observer = exception

This problem is reproducible with:

frysk-0.0.1.2006.08.24.rh1-1.fc6

on:
Linux outgrabe.boston.redhat.com 2.6.17-1.2519.4.14.el5 #1 SMP Thu Aug 24
19:31:14 EDT 2006 i686 i686 i386 GNU/Linux

And on FC5 with Frysk as built from CVS head on 20060824 (08:00EDT)

Version-Release number of selected component (if applicable):
frysk-0.0.1.2006.08.24.rh1-1.fc6

How reproducible:
100%

Steps to Reproduce:
1. Create a new debug session, assign a syscall observer to a shell - in my case
tcsh - process
2. Open the frysk monitor
3. Right click on the process - add a fork observer (or other type)
  
Actual results:
{frysk.proc.LinuxTask@8a0420,pid=5866,tid=5866,state=runningInSyscall} in state
"runningInSyscall" did not handle handleAddObserver

frysk.proc.State.unhandled(frysk)
frysk.proc.TaskState.handleAddObserver(frysk)
frysk.proc.Task.handleAddObserver(frysk)
frysk.proc.TaskObservation.handleAdd(frysk)
frysk.proc.ProcState$3.handleAddObservation(frysk)
frysk.proc.Proc.handleAddObservation(frysk)
frysk.proc.Proc$6.execute(frysk)
frysk.event.EventLoop.runEventLoop(frysk)
frysk.event.EventLoop.run(frysk)
frysk.gui.Gui$4.run(frysk)
java.lang.Thread.run(libgcj.so.7rh)

Expected results:
The second observer should be added

Additional info:
The problem doesn't occur if you start the session by assigning both observers
to the shell process - hence the 'running state' exception, I guess.
Comment 1 Andrew Cagney 2006-08-25 13:45:50 UTC
Downstream RHEL bug:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=204074
Comment 2 Phil Muldoon 2006-08-25 14:01:44 UTC
2006-08-24  Phil Muldoon  <pmuldoon@redhat.com>
	
* ObserversMenu.java: Check if observer has been added already.Do not allow
"same" multiple observers to one task/proc
Comment 3 Len DiMaggio 2006-08-25 14:52:02 UTC
Still broken - the exception is handled - but the syscall observer added never
fires.
Comment 4 Phil Muldoon 2006-08-26 23:38:08 UTC
The underlying bug is allowing two of the exact same observers on the same Task.
I've modified the rules associated with this now. 

If the syscall observer is not firing, it might be a different bug. This
check-in gates the users ability to add two observers of the same type to the
same task (and Proc)

2006-08-26  Phil Muldoon  <pmuldoon@redhat.com>
	
	* SessionProcDataModel.java (addTask): set parent GuiProc.
	* GuiTask.java (setParent): New.
	(getParent): New.
	* ObserversMenu.java (addGuiObject): Remove post
	observer check.
	(setCurrentProc): Disable observers in menu
	the the Proc already has.
	(setCurrentTask): Disable observers in menu
	the the Task *and* the Proc already has.
Comment 5 Mark Wielaard 2008-03-13 21:44:19 UTC
The gui changed a lot since when this was filed. But I can monitor a bash
process now in the gui and can duplicate a syscall observer and add two of them
(and get every syscall reported multiple times).