public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <20070726092801.9395.virginie.trinite@thalesgroup.com>
@ 2008-12-23 19:43 ` jan dot kratochvil at redhat dot com
  2009-07-15  9:00 ` mhp77 at gmx dot at
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2008-12-23 19:43 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jan dot kratochvil at redhat dot com  2008-12-23 19:43 -------
FYI the support currently exists in a 3rd party patch:
http://sourceware.org/gdb/wiki/ProjectArcher
http://sourceware.org/gdb/wiki/ArcherBranchManagement
branch archer-jankratochvil-vla

GNU Fortran (GCC) version 4.4.0 20081219 (experimental) (x86_64-unknown-linux-gnu)
	compiled by GNU C version 4.4.0 20081219 (experimental), GMP version 4.2.2,
MPFR version 2.3.2.
GNU gdb Fedora (6.8-29.fc10)
(gdb) p tab
$1 = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
(gdb) p tab(1)
$2 = 1

The patch is going to be submitted in parts for FSF GDB.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan dot kratochvil at redhat
                   |                            |dot com


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <20070726092801.9395.virginie.trinite@thalesgroup.com>
  2008-12-23 19:43 ` [Bug fortran/9395] can not acces allocatable array in fortran90 jan dot kratochvil at redhat dot com
@ 2009-07-15  9:00 ` mhp77 at gmx dot at
  2009-10-02 13:23 ` jan dot kratochvil at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: mhp77 at gmx dot at @ 2009-07-15  9:00 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From mhp77 at gmx dot at  2009-07-15 09:00 -------
What is the current status of gdb support for dynamic Fortran arrays
(allocatable, assumed-shape arrays)?

I've tried to debug the test program above with:

gfortran -g ... [also tried -gdwarf-2, -gdwarf-3, -ggdb]
GNU Fortran (GCC) 4.5.0 20090710 (experimental) [also tried 4.4.0]

GNU gdb (GDB) 6.8.50.20090707-cvs [also tried GNU gdb (GDB) 6.8.50.20081228-cvs,
 tar.gz from http://sourceware.org/git/gitweb.cgi?p=archer.git]

The result is:

(gdb) p tab
$1 = ()

-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <20070726092801.9395.virginie.trinite@thalesgroup.com>
  2008-12-23 19:43 ` [Bug fortran/9395] can not acces allocatable array in fortran90 jan dot kratochvil at redhat dot com
  2009-07-15  9:00 ` mhp77 at gmx dot at
@ 2009-10-02 13:23 ` jan dot kratochvil at redhat dot com
  2010-01-11 13:10 ` mhp77 at gmx dot at
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2009-10-02 13:23 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jan dot kratochvil at redhat dot com  2009-10-02 13:23 -------
You need to checkout the branch:
git checkout -tb archer-jankratochvil-vla origin/archer-jankratochvil-vla


-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <20070726092801.9395.virginie.trinite@thalesgroup.com>
                   ` (2 preceding siblings ...)
  2009-10-02 13:23 ` jan dot kratochvil at redhat dot com
@ 2010-01-11 13:10 ` mhp77 at gmx dot at
  2010-01-12 15:21 ` mhp77 at gmx dot at
  2010-06-29 15:11 ` jan dot kratochvil at redhat dot com
  5 siblings, 0 replies; 13+ messages in thread
From: mhp77 at gmx dot at @ 2010-01-11 13:10 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From mhp77 at gmx dot at  2010-01-11 13:10 -------
Using GNU gdb (GDB) 6.8.50.20090909-cvs from the archer repository (branch
archer-jankratochvil-vla) and GNU Fortran (GCC) 4.5.0 20091215 (experimental), I
can debug the above test program. However, if I declare an allocatable array as
a type component as follows:

program test_gdb
  implicit none
  type :: a
     real :: b = 1.0
     real, dimension( : ), allocatable :: c
  end type a
  type( a ) :: d
  allocate( d%c( 3 ) )
  d%c = 1.0
  print *, d%c
end program test_gdb

gdb issues the following error message when trying to print d%c:
(gdb) p d%c
Cannot access memory at address 0x3f800004

Interestingly, if I remove the first type component (real :: b = 1.0) gdb works
correctly.

Btw, when can we expect the Fortran enhancements to be included in main-line gdb?

Thanks!

-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <20070726092801.9395.virginie.trinite@thalesgroup.com>
                   ` (3 preceding siblings ...)
  2010-01-11 13:10 ` mhp77 at gmx dot at
@ 2010-01-12 15:21 ` mhp77 at gmx dot at
  2010-06-29 15:11 ` jan dot kratochvil at redhat dot com
  5 siblings, 0 replies; 13+ messages in thread
From: mhp77 at gmx dot at @ 2010-01-12 15:21 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mhp77 at gmx dot at


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <20070726092801.9395.virginie.trinite@thalesgroup.com>
                   ` (4 preceding siblings ...)
  2010-01-12 15:21 ` mhp77 at gmx dot at
@ 2010-06-29 15:11 ` jan dot kratochvil at redhat dot com
  5 siblings, 0 replies; 13+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-06-29 15:11 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |11744
              nThis|                            |


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <bug-9395-4717@http.sourceware.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2012-02-17 16:57 ` at_gdb at mathalacarte dot com
@ 2012-02-17 17:00 ` at_gdb at mathalacarte dot com
  6 siblings, 0 replies; 13+ messages in thread
From: at_gdb at mathalacarte dot com @ 2012-02-17 17:00 UTC (permalink / raw)
  To: gdb-prs

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

Fred Krogh <at_gdb at mathalacarte dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|6.5                         |7.4

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <bug-9395-4717@http.sourceware.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-08-06 19:18 ` at_gdb at mathalacarte dot com
@ 2012-02-17 16:57 ` at_gdb at mathalacarte dot com
  2012-02-17 17:00 ` at_gdb at mathalacarte dot com
  6 siblings, 0 replies; 13+ messages in thread
From: at_gdb at mathalacarte dot com @ 2012-02-17 16:57 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from Fred Krogh <at_gdb at mathalacarte dot com> 2012-02-17 16:56:29 UTC ---
I just tried the program test1 that I posted in the above comment.  Got the
same (bad) result, but this time using GNU gdb (Gentoo 7.4 p1) 7.4, and GNU
Fortran (Gentoo 4.6.2 p1.1, pie-0.4.5) 4.6.2.  This bug really complicates the
debugging of Fortran programs using allocatable arrays.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <bug-9395-4717@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-02-25 18:13 ` jan.kratochvil at redhat dot com
@ 2011-08-06 19:18 ` at_gdb at mathalacarte dot com
  2012-02-17 16:57 ` at_gdb at mathalacarte dot com
  2012-02-17 17:00 ` at_gdb at mathalacarte dot com
  6 siblings, 0 replies; 13+ messages in thread
From: at_gdb at mathalacarte dot com @ 2011-08-06 19:18 UTC (permalink / raw)
  To: gdb-prs

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

Fred Krogh <at_gdb at mathalacarte dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |at_gdb at mathalacarte dot
                   |                            |com

--- Comment #9 from Fred Krogh <at_gdb at mathalacarte dot com> 2011-08-06 19:18:00 UTC ---
It seems I'm having this problem when using GNU gdb (Gentoo 7.2 p1) 7.2, and
GNU Fortran (Gentoo 4.6.1 p1.0, pie-0.4.5) 4.6.1.  Here is the program I'm
running which includes comments on what gdb does.

  program test1
!   Gdb does not print entries in allocatable arrays
    integer, allocatable :: itest(:)
    allocate (itest(10))
    do i = 1, 10
      itest(i) = i
    end do
    print '("itest =", 10i3)', itest(1:10)
    print '("Stop gdb on this statement and look at itest")'
! p itest(1:2) says slice our of range
! p itest(1) gives 0
! p itest(2) gives -1   
    stop
  end program test1

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <bug-9395-4717@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-02-25 13:59 ` joachim.protze at zih dot tu-dresden.de
@ 2011-02-25 18:13 ` jan.kratochvil at redhat dot com
  2011-08-06 19:18 ` at_gdb at mathalacarte dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-02-25 18:13 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-02-25 18:13:48 UTC ---
(In reply to comment #7)
> It seems, that we now have infinite loops in some cases

Thanks, the code was reading some memory after the end of the array.

For small arrays it makes no difference but with such a large array GDB tried
to read unmapped memory pages which resulted in very ptrace reading and day it
would say:
Cannot access memory at address 0x7ffff0c75f58

Fixed now on archer-jankratochvil-vla by:
530ce8bb0aeeb513f566da7a7fae46d6414f8dc1

(gdb) p buffer(10,10,9:10)
$1 = (813010, 903010)

The VLA code needs a rewrite for merge, though.  I do not find viable to fix
the Comment 4 with the current codebase.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <bug-9395-4717@http.sourceware.org/bugzilla/>
  2011-02-16 16:51 ` joachim.protze at zih dot tu-dresden.de
  2011-02-18  0:02 ` jan.kratochvil at redhat dot com
@ 2011-02-25 13:59 ` joachim.protze at zih dot tu-dresden.de
  2011-02-25 18:13 ` jan.kratochvil at redhat dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: joachim.protze at zih dot tu-dresden.de @ 2011-02-25 13:59 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from Joachim Protze <joachim.protze at zih dot tu-dresden.de> 2011-02-25 13:59:14 UTC ---
Created attachment 5266
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5266
fortran program with bigger 3d-array

It seems, that we now have infinite loops in some cases (for 300x300x300
array):

(gdb) p buffer(10,10,:10)
$1 = (3010, 93010, 183010, 273010, 363010, 453010, 543010, 633010, 723010,
813010, 903010)
(gdb) p buffer(10,9:10,10)
$2 = (902710, 903010)

but:
(gdb) p buffer(10,10,9:10)
-> hangs, should just display the last two values of $1

With 200x200x200 array the last one gives correct answer.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <bug-9395-4717@http.sourceware.org/bugzilla/>
  2011-02-16 16:51 ` joachim.protze at zih dot tu-dresden.de
@ 2011-02-18  0:02 ` jan.kratochvil at redhat dot com
  2011-02-25 13:59 ` joachim.protze at zih dot tu-dresden.de
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-02-18  0:02 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-02-18 00:01:51 UTC ---
Many thanks for the bugreport.
archer-jankratochvil-vla commit 678cbb7340d8edfa92ce6de931d8d4e9c3b86c06 should
have it fixed.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug fortran/9395] can not acces allocatable array in fortran90
       [not found] <bug-9395-4717@http.sourceware.org/bugzilla/>
@ 2011-02-16 16:51 ` joachim.protze at zih dot tu-dresden.de
  2011-02-18  0:02 ` jan.kratochvil at redhat dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: joachim.protze at zih dot tu-dresden.de @ 2011-02-16 16:51 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Joachim Protze <joachim.protze at zih dot tu-dresden.de> 2011-02-16 16:51:11 UTC ---
Created attachment 5246
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5246
fortran program with 3d-array

I checked out the branch and found some strange behavior regarding subarrays
and at last gdb segfaulted:

(gdb) b 18
Breakpoint 1 at 0x400aae: file array-segf.f90, line 18.
(gdb) r
Starting program: array-segf 

Breakpoint 1, typesubarray () at array-segf.f90:18
18      buffer=100
(gdb) p buffer
$1 = (( ( 0, 1, 2, 3) ( 4, 5, 6, 7) ( 8, 9, 10, 11) ( 12, 13, 14, 15) ) ( ( 16,
17, 18, 19) ( 20, 21, 22, 23) ( 24, 25, 26, 27) ( 28, 29, 30, 31) ) ( ( 32, 33,
34, 35) ( 36, 37, 38, 39) ( 40, 41, 42, 43) ( 44, 45, 46, 47) ) ( ( 48, 49, 50,
51) ( 52, 53, 54, 55) ( 56, 57, 58, 59) ( 60, 61, 62, 63) ) )
(gdb) p buffer(:,:,0)
$2 = (( 0, 1, 2, 3) ( 4, 5, 6, 7) ( 8, 9, 10, 11) ( 12, 13, 14, 15) )
(gdb) p buffer(:,:,1)
$3 = (( 0, 1, 2, 3) ( 4, 5, 6, 7) ( 8, 9, 10, 11) ( 12, 13, 14, 15) )
(gdb) p buffer(:,:,4)
no such vector element
(gdb) p buffer(:,0,0)
$4 = (0, 1, 2, 3)
(gdb) p buffer(:,2,3)
$5 = (0, 1, 2, 3)
(gdb) p buffer(1,:,3)
$6 = (0, 4, 8, 12)
(gdb) p buffer(2:3,0,0)
$7 = (0, 1)
(gdb) p buffer(3,1,:)
segfault


The subarrays that are printed are choosen wrong. Size and dimension are
choosen right, but all subarrays are aligned to (0,0,0).
If the first dimension (last digit) is set to range, gdb always segfaults.

GNU Fortran (Ubuntu 4.4.3-4ubuntu5) 4.4.3
GNU gdb (GDB) 7.2.50.20110213-cvs

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2012-02-17 17:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20070726092801.9395.virginie.trinite@thalesgroup.com>
2008-12-23 19:43 ` [Bug fortran/9395] can not acces allocatable array in fortran90 jan dot kratochvil at redhat dot com
2009-07-15  9:00 ` mhp77 at gmx dot at
2009-10-02 13:23 ` jan dot kratochvil at redhat dot com
2010-01-11 13:10 ` mhp77 at gmx dot at
2010-01-12 15:21 ` mhp77 at gmx dot at
2010-06-29 15:11 ` jan dot kratochvil at redhat dot com
     [not found] <bug-9395-4717@http.sourceware.org/bugzilla/>
2011-02-16 16:51 ` joachim.protze at zih dot tu-dresden.de
2011-02-18  0:02 ` jan.kratochvil at redhat dot com
2011-02-25 13:59 ` joachim.protze at zih dot tu-dresden.de
2011-02-25 18:13 ` jan.kratochvil at redhat dot com
2011-08-06 19:18 ` at_gdb at mathalacarte dot com
2012-02-17 16:57 ` at_gdb at mathalacarte dot com
2012-02-17 17:00 ` at_gdb at mathalacarte 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).