This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fortran/1531: segmentation fault for FOTRAN77 arrays (fwd)


The following reply was made to PR fortran/1531; it has been noted by GNATS.

From: Wu Zhou <woodzltc@cn.ibm.com>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: fortran/1531: segmentation fault for FOTRAN77 arrays (fwd)
Date: Tue, 28 Jun 2005 01:43:44 +0800 (CST)

 To test whether gdb-gnats will work or not. And also to let PR system to 
 record related correspondence.  Thanks.
 
 ---------- Forwarded message ----------
 Date: Mon, 27 Jun 2005 17:09:39 +0800 (CST)
 From: Wu Zhou <woodzltc@cn.ibm.com>
 To: Miroslav ILIAS <ilias@quantix.u-strasbg.fr>
 Cc: gdb-prs@sources.redhat.com
 Subject: Re: fortran/1531: segmentation fault for FOTRAN77 arrays
 
 On Mon, 27 Jun 2005, Miroslav ILIAS wrote:
 
 > Dear Wu,
 > 
 > I tested the newest cvs version of gdb, GNU gdb 6.3.50.20050627-cvs, on a
 > very small code, which is attached.
 > 
 > Observations:
 > 
 > a) In the main program, the A matrix (after beeing filled in the
 > subroutine) is handled correctly:
 > (gdb) p a
 > $1 = (( 1, 4, 7) ( 2, 5, 8) ( 3, 6, 9) )
 > (gdb) p a(1,1)
 > $2 = 1
 > (gdb) p a(1,2)
 > $3 = 2
 > (gdb) p a(1,3)
 > $4 = 3
 > 
 > b) in the subroutine, where the matrix is filled
 >  A( 1; 1)=  1.
 >  A( 1; 2)=  2.
 >  A( 1; 3)=  3.
 >  A( 2; 1)=  4.
 >  A( 2; 2)=  5.
 >  A( 2; 3)=  6.
 >  A( 3; 1)=  7.
 >  A( 3; 2)=  8.
 >  A( 3; 3)=  9.
 > 
 > we get a correct specification of A as a pointer:
 > (gdb) p a
 > $1 = (PTR TO -> ( real*4 (1,1))) 0xbffff6f0
 > 
 > and a correct access to the A(1,1) element:
 > 
 > (gdb) p A(1,1)
 > $2 = 1
 > 
 > but for other elements we don't have correct fortran indexing:
 > (gdb) p A(1,2)
 > $3 = 4
 > (gdb) p (A(1,3),A(3,1))
 > $2 = (7,7)
 
 Hmm...  That might be another different problem.  At least the 
 segmentation fault doesn't happen in your cases now.  Maybe you 
 can close this PR, and open a new one. 
 
 Will take some more look into this problem.
 
 Cheers
 - Wu Zhou  
 > 
 > 			Miro.
 > 
 > 
 > ------------------------------------------------------------
 > Miroslav ILIAS
 > Laboratoire de Chimie Quantique
 > UMR 7551 CNRS/ULP
 > Institut Le Bel
 > 4 rue Blaise Pascal     tel: +33 (0)3 90 24 12 27
 > F-67000  STRASBOURG     fax: +33 (0)3 90 24 15 89
 > France                Email: ilias@quantix-u.strasbg.fr
 >         web: http://quantique.u-strasbg.fr
 > ------------------------------------------------------------
 > 
 > 
 > On Mon, 27 Jun 2005 woodzltc@sources.redhat.com wrote:
 > 
 > > Synopsis: segmentation fault for FOTRAN77 arrays
 > >
 > > State-Changed-From-To: open->analyzed
 > > State-Changed-By: woodzltc
 > > State-Changed-When: Mon Jun 27 02:27:27 2005
 > > State-Changed-Why:
 > >     Dear ilias,
 > >
 > >     Maybe you means "print A", "print A(1,1)" here.  "print *A" will give you an error message liek this:
 > >       Attempt to take contents of a non-pointer value.
 > >
 > >     I also encounter this kind of SEGV error with a old GDB release and had commited a patch to fix this. With the latest GDB CVS, no segementation fault with your testcase anymore.  "print A(1,1)" will give you the correct value now.
 > >
 > >     Would you please try the latest GDB cvs tree and close this if it get fixed indeed.  Thanks.
 > >
 > >     Cheers
 > >     - Wu Zhou
 > >
 > > http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=1531
 > >


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]