From jin@gracie.lbl.gov  Tue Oct  2 14:18:24 2001
Return-Path: <jin@gracie.lbl.gov>
Received: from gracie.lbl.gov (gracie.lbl.gov [131.243.2.175])
	by hub.freebsd.org (Postfix) with ESMTP id 8304B37B403
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Oct 2001 14:18:24 -0700 (PDT)
Received: (from jin@localhost)
	by gracie.lbl.gov (8.11.6/8.11.6) id f92LIO325393;
	Tue, 2 Oct 2001 14:18:24 -0700 (PDT)
	(envelope-from jin)
Message-Id: <200110022118.f92LIO325393@gracie.lbl.gov>
Date: Tue, 2 Oct 2001 14:18:24 -0700 (PDT)
From: Jin Guojun (DSD staff) <jin@gracie.lbl.gov>
Reply-To: j_guojun@lbl.gov
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: xxgdb cannot open source file
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         30993
>Category:       ports
>Synopsis:       xxgdb cannot open source file
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    flz
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 02 14:20:00 PDT 2001
>Closed-Date:    Tue Apr 12 10:33:00 GMT 2005
>Last-Modified:  Tue Apr 12 10:33:00 GMT 2005
>Originator:     Jin Guojun (DSD staff)
>Release:        FreeBSD 4.4-RELEASE i386
>Organization:
>Environment:
System: FreeBSD ag-ds.lbl.gov 4.4-RELEASE FreeBSD 4.4-RELEASE #1: Thu Sep 27 12:44:46 PDT 2001 jin@ag-ds.lbl.gov:/usr/src/sys/compile/MinMax i386


	4.4-RELEASE

>Description:
	xxgdb-1.12 no longer works under 4.4-RELEASE (see How-To-Repeat).
	xxgdb-1.12 from 4.3-RELEASE does not work under FreeBSD 4.4 either.
	gdb works OK. So it just XXGDB issue.

>How-To-Repeat:

135 /tmp: cat x.c
main()
{
        printf("hello world\n");
}

136 /tmp: cc -g x.c
137 /tmp: xxgdb a.out
Warning: Cannot open file /tmp/x.c; Resource temporarily unavailable
138 /tmp: ./a.out
hello world


>Fix:

	
>Release-Note:
>Audit-Trail:

From: Ian Dowse <iedowse@maths.tcd.ie>
To: Jin Guojun <j_guojun@lbl.gov>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/30993: xxgdb cannot open source file 
Date: Wed, 24 Oct 2001 13:00:59 +0100

 In message <3BD616EC.40F97564@lbl.gov>, Jin Guojun writes:
 >789         XtSetValues(sourceWindow, args, n);
 >(gdb) s
 >Warning: Cannot open file /tmp/x.c; Resource temporarily unavailable
 
 Something within the X code must be interpreting a zero return from
 open() as a failure - I've seen this with xxgdb, but rather than
 digging into the X code I just changed xxgdb to not leave file
 descriptors 0 and 1 closed. A patch is below.
 
 Ian
 
 --- orig/calldbx.c	Wed Oct 24 12:38:41 2001
 +++ calldbx.c	Wed Oct 24 12:56:18 2001
 @@ -311,6 +311,11 @@
  	 */
  	close(0);
  	close(1);
 +	if (open("/dev/null", O_RDONLY) < 0 ||
 +	    open("/dev/null", O_WRONLY) < 0) {
 +		perror("/dev/null");
 +		exit(1);
 +	}
  
  #ifdef _POSIX_SOURCE
  	fcntl(master, F_SETFL, O_NONBLOCK);

From: "Jin Guojun[ITG]" <j_guojun@lbl.gov>
To: freebsd-gnats-submit@FreeBSD.org,
	Ian Dowse <iedowse@maths.tcd.ie>
Cc:  
Subject: Re: bin/30993: xxgdb cannot open source file
Date: Wed, 24 Oct 2001 11:05:33 -0700

  In message <3BD616EC.40F97564@lbl.gov>, Jin Guojun writes:
       >789         XtSetValues(sourceWindow, args, n);
       >(gdb) s
       >Warning: Cannot open file /tmp/x.c; Resource temporarily unavailable
       
       Something within the X code must be interpreting a zero return from
       open() as a failure - I've seen this with xxgdb, but rather than
       digging into the X code I just changed xxgdb to not leave file
       descriptors 0 and 1 closed. A patch is below.
       
       Ian
       
       --- orig/calldbx.c     Wed Oct 24 12:38:41 2001
       +++ calldbx.c  Wed Oct 24 12:56:18 2001
       @@ -311,6 +311,11 @@
               */
              close(0);
              close(1);
       +      if (open("/dev/null", O_RDONLY) < 0 ||
       +          open("/dev/null", O_WRONLY) < 0) {
       +              perror("/dev/null");
       +              exit(1);
       +      }
        
        #ifdef _POSIX_SOURCE
              fcntl(master, F_SETFL, O_NONBLOCK);
 
 This is an interesting solution that works.
 
 Thanks,
 
 -- 
 ------------ Jin Guojun ----------- v --- j_guojun@lbl.gov ---
 Distributed Systems Department		http://www.itg.lbl.gov/~jin
 M/S 50B-2239				Ph#:(510) 486-7531 Fax: 486-6363
 Lawrence Berkeley National Laboratory,	Berkeley, CA 94720

From: "Jin Guojun[ITG]" <j_guojun@lbl.gov>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/30993: xxgdb cannot open source file
Date: Thu, 31 Jan 2002 12:36:03 -0800

 This problem still exists in 4.5-RELEASE. Ian has provided some
 solution to this bug, I wonder if is this acceptable one or is
 there a better solution?
 If there is no other better solution to this problem, can we just
 use this solution for now?
 
 	-Jin
 
 -------- original discussion -------------
 
      From: Ian Dowse <iedowse@maths.tcd.ie>
      To: Jin Guojun <j_guojun@lbl.gov>
      Cc: freebsd-gnats-submit@FreeBSD.org
      Subject: Re: bin/30993: xxgdb cannot open source file 
      Date: Wed, 24 Oct 2001 13:00:59 +0100
 
       In message <3BD616EC.40F97564@lbl.gov>, Jin Guojun writes:
       >789         XtSetValues(sourceWindow, args, n);
       >(gdb) s
       >Warning: Cannot open file /tmp/x.c; Resource temporarily unavailable
       
       Something within the X code must be interpreting a zero return from
       open() as a failure - I've seen this with xxgdb, but rather than
       digging into the X code I just changed xxgdb to not leave file
       descriptors 0 and 1 closed. A patch is below.
       
       Ian
       
       --- orig/calldbx.c     Wed Oct 24 12:38:41 2001
       +++ calldbx.c  Wed Oct 24 12:56:18 2001
       @@ -311,6 +311,11 @@
               */
              close(0);
              close(1);
       +      if (open("/dev/null", O_RDONLY) < 0 ||
       +          open("/dev/null", O_WRONLY) < 0) {
       +              perror("/dev/null");
       +              exit(1);
       +      }
        
        #ifdef _POSIX_SOURCE
              fcntl(master, F_SETFL, O_NONBLOCK);
Responsible-Changed-From-To: freebsd-bugs->iedowse 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jul 12 18:05:17 PDT 2003 
Responsible-Changed-Why:  
Assign to ian to evaluate for committing to the port. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=30993 
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Thu Nov 6 16:38:29 PST 2003 
State-Changed-Why:  
Indicate that I'm trying to find out what the real state of 
this PR is. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=30993 

From: Mark Linimon <linimon@lonesome.com>
To: freebsd-gnats-submit@FreeBSD.org, j_guojun@lbl.gov,
	iedowse@FreeBSD.org
Cc:  
Subject: Re: ports/30993: xxgdb cannot open source file
Date: Tue, 04 Nov 2003 22:53:01 +0000

 Has there been any further action on this PR?  (I'm trying to go through
 and find PRs that seem to be "stuck", somehow).
 

From: Ian Dowse <iedowse@maths.tcd.ie>
To: Mark Linimon <linimon@lonesome.com>
Cc: freebsd-gnats-submit@FreeBSD.org, j_guojun@lbl.gov
Subject: Re: ports/30993: xxgdb cannot open source file 
Date: Fri, 07 Nov 2003 01:33:57 +0000

 In message <3FA82DCD.1080908@lonesome.com>, Mark Linimon writes:
 >Has there been any further action on this PR?  (I'm trying to go through
 >and find PRs that seem to be "stuck", somehow).
 
 I think I've compiled xxgdb on a more recent -STABLE and it worked
 fine without the patch, and it seems to be ok on -CURRENT now too.
 I've no idea what might have fixed it though; maybe a newer version
 of X.
 
 Jin, can you check whether it works for you without the patch now?
 
 Ian

From: "Jin Guojun [DSD]" <j_guojun@lbl.gov>
To: Ian Dowse <iedowse@maths.tcd.ie>
Cc: Mark Linimon <linimon@lonesome.com>,
	freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/30993: xxgdb cannot open source file
Date: Fri, 07 Nov 2003 12:45:29 -0800

 Ian Dowse wrote:
 
 > In message <3FA82DCD.1080908@lonesome.com>, Mark Linimon writes:
 > >Has there been any further action on this PR?  (I'm trying to go through
 > >and find PRs that seem to be "stuck", somehow).
 >
 > I think I've compiled xxgdb on a more recent -STABLE and it worked
 > fine without the patch, and it seems to be ok on -CURRENT now too.
 > I've no idea what might have fixed it though; maybe a newer version
 > of X.
 >
 > Jin, can you check whether it works for you without the patch now?
 >
 > Ian
 
 Ian,
 
 I checked xxgdb on both 5.1 and 4.x, now I remember why I am still using
 the patch from 4.5-RELEASE.
 
 The problem of reading source goes away, but the X API is generally broken
 under XFree86 4.x. I am sure I send out the problem, however, I could not
 find it in the archive. This happens in both FreeBSD and Linux, so it looks
 like a XFree86 4.x related problem.
 
 Here is the problem description:
     The cursor does not function properly. When using mouse to move cursor
 to a place in the text (source code), after a click, it will stick there and
 hardly
 to change again. At this point, using arrow keys can still move the cursor, but
 the cursor position is not related to the mouse. That is, using arrow keys to
 move the cursor, then click mouse on "break" button to set a break-point will
 fail and it may bring the cursor to some other random place.
 This make current xxgdb 1.12 very difficult to set up break point for debug.
 
 I am not sure that we should keep this case open for this problem, or should
 we close this one, and open a new one.
 
 --
 ------------ Jin Guojun ----------- v --- j_guojun@lbl.gov ---
 Distributed Systems Department          http://www.itg.lbl.gov/~jin
 M/S 50B-2239                            Ph#:(510) 486-7531 Fax: 486-6363
 Lawrence Berkeley National Laboratory,  Berkeley, CA 94720
 
 
 
State-Changed-From-To: feedback->suspended 
State-Changed-By: linimon 
State-Changed-When: Thu Apr 8 20:28:10 PDT 2004 
State-Changed-Why:  
This PR has been in 'feedback' for some time now, even though the 
submitter has responded.  Mark it as 'suspended' until someone 
can come up with a solution to the problem.  Ian, should I reset 
you as Responsible? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=30993 
Responsible-Changed-From-To: iedowse->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Apr 9 06:23:51 PDT 2004 
Responsible-Changed-Why:  
Ian agrees that this one should be returned to the pool. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=30993 
State-Changed-From-To: suspended->closed 
State-Changed-By: flz 
State-Changed-When: Tue Apr 12 10:31:09 GMT 2005 
State-Changed-Why:  
Ian said it was working correctly in -STABLE and -CURRENT more 
than ore year ago and Jin said it was a problem in XFree86 4.x. 
These are two reasons to not keep the PR open. 


Responsible-Changed-From-To: freebsd-ports-bugs->flz 
Responsible-Changed-By: flz 
Responsible-Changed-When: Tue Apr 12 10:31:09 GMT 2005 
Responsible-Changed-Why:  
Take replies, I'll re-open the PR if any party thinks I should. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=30993 
>Unformatted:
