public inbox for frysk-bugzilla@sourceware.org
help / color / mirror / Atom feed
* [Bug general/4536] New: race in FCatch's exec code
@ 2007-05-22 17:06 cagney at redhat dot com
  2007-06-29 13:33 ` [Bug general/4536] " mcvet at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: cagney at redhat dot com @ 2007-05-22 17:06 UTC (permalink / raw)
  To: frysk-bugzilla

This code:

    
    if (attach == true)
      init();
    else
      {
        File exe = new File(command[0]);
        if (exe.exists())
          Manager.host.requestCreateAttachedProc(command, new CatchObserver());
        else
          {
            System.err.println("fcatch: can't find executable!");
            System.exit(1);
          }
      }

has a race - the executable could be removed between the exe.exists() call and
the requestCreateAttatchedProc call.

The code should instead handle the exec failure in the attatched observer.

-- 
           Summary: race in FCatch's exec code
           Product: frysk
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: frysk-bugzilla at sourceware dot org
        ReportedBy: cagney at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=4536

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug general/4536] race in FCatch's exec code
  2007-05-22 17:06 [Bug general/4536] New: race in FCatch's exec code cagney at redhat dot com
@ 2007-06-29 13:33 ` mcvet at redhat dot com
  2007-07-03 17:24 ` cagney at redhat dot com
  2008-03-11 19:43 ` swagiaal at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mcvet at redhat dot com @ 2007-06-29 13:33 UTC (permalink / raw)
  To: frysk-bugzilla


------- Additional Comments From mcvet at redhat dot com  2007-06-29 13:33 -------
What should be done, beyond the following?

public void addFailed (Object observable, Throwable w)
{
  throw new RuntimeException("Failed to attach to created proc", w);
}

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=4536

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug general/4536] race in FCatch's exec code
  2007-05-22 17:06 [Bug general/4536] New: race in FCatch's exec code cagney at redhat dot com
  2007-06-29 13:33 ` [Bug general/4536] " mcvet at redhat dot com
@ 2007-07-03 17:24 ` cagney at redhat dot com
  2008-03-11 19:43 ` swagiaal at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: cagney at redhat dot com @ 2007-07-03 17:24 UTC (permalink / raw)
  To: frysk-bugzilla


------- Additional Comments From cagney at redhat dot com  2007-07-03 17:24 -------
(In reply to comment #1)
> What should be done, beyond the following?
> 
> public void addFailed (Object observable, Throwable w)
> {
>   throw new RuntimeException("Failed to attach to created proc", w);
> }

Not much (And the test exe.exists() is removed) :-)

Just make certain that it is propogated back to main() so it can report the
error (in Throwable w) and exit.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=4536

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug general/4536] race in FCatch's exec code
  2007-05-22 17:06 [Bug general/4536] New: race in FCatch's exec code cagney at redhat dot com
  2007-06-29 13:33 ` [Bug general/4536] " mcvet at redhat dot com
  2007-07-03 17:24 ` cagney at redhat dot com
@ 2008-03-11 19:43 ` swagiaal at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: swagiaal at redhat dot com @ 2008-03-11 19:43 UTC (permalink / raw)
  To: frysk-bugzilla


------- Additional Comments From swagiaal at redhat dot com  2008-03-11 19:42 -------
This code segment has been rewritten.

commit 5492baa03cd955076e3b9cc5305def492de72920
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Mon Mar 10 16:29:44 2008 -0400

    swagiaal: converted fcatch to use ProcRunUtil.
    
    frysk-core/frysk/bindir/ChangeLog
    +2008-03-10  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +	* fcatch.java: Moved the bulk of the code to FCatch.
    +
    
    frysk-core/frysk/debuginfo/ChangeLog
    +2008-03-10  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +	* DebugInfoStackFactory.java: Added DEFAULT options.
    +
    
    frysk-core/frysk/util/ChangeLog
    +2008-03-10  Sami Wagiaalla  <swagiaal@redhat.com>
    +
    +	* FCatch.java: Now uses ProcRunUtil.
    +	* TestFCatch.java: Deleted.
    +

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=4536

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-03-11 19:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-22 17:06 [Bug general/4536] New: race in FCatch's exec code cagney at redhat dot com
2007-06-29 13:33 ` [Bug general/4536] " mcvet at redhat dot com
2007-07-03 17:24 ` cagney at redhat dot com
2008-03-11 19:43 ` swagiaal at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).