public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "stephan dot kramer at imperial dot ac dot uk" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug fortran/11354] New: error in evaluating variable length fortran strings causes stalls
Date: Sun, 07 Mar 2010 22:06:00 -0000	[thread overview]
Message-ID: <20100307220622.11354.stephan.kramer@imperial.ac.uk> (raw)

The below simple test program was compiled with gfortran 4.4.1, -g. After
putting a breakpoint on the print line, the displayed frame looks as follows:

Breakpoint 1, print_string (string=Cannot access memory at address 0x80487eb
) at string.f90:11

I don't mind so much the string not being printed correctly (lots of things in
fortran aren't), but in particular for big executables this seems to cause huge
waiting times for the frame to be printed out (several minutes). This makes gdb
7.0 and 7.1 currently unusable for our project.

After a digging a little deeper, the cause seems to be the length of the string
not being picked up correctly from stack. Putting a breakpoint on valops.c (cvs
1.237 of the gdb_7_1-branch) on line 942 value_fetch_lazy(), the length of the
value it tries to read is some random big number. It then tries to read this
from the debugged process memory, and fails reaching the end which takes quite a
while for a large process.

The sample program:

program main
  implicit none
  
  call print_string("hello world")
    
  contains
  
  subroutine print_string(string)
    character(len=*):: string
    
    print *, string
    
  end subroutine print_string
end program main

-- 
           Summary: error in evaluating variable length fortran strings
                    causes stalls
           Product: gdb
           Version: 7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: stephan dot kramer at imperial dot ac dot uk
                CC: gdb-prs at sourceware dot org


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

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


             reply	other threads:[~2010-03-07 22:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-07 22:06 stephan dot kramer at imperial dot ac dot uk [this message]
2010-09-14 19:21 ` [Bug fortran/11354] " stephan dot kramer at imperial dot ac dot uk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100307220622.11354.stephan.kramer@imperial.ac.uk \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).