public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/53015] free_pi_tree(): Unresolved fixup is back
Date: Tue, 17 Apr 2012 09:11:00 -0000	[thread overview]
Message-ID: <bug-53015-4-3F58ktMrwJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53015-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53015

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-04-17 09:08:51 UTC ---
(In reply to comment #0)
> I get "Internal error - free_pi_tree(): Unresolved fixup" all over the place again, with versions 4.6.2, 4.7.0 and 4.8.0 of gfortran from svn. [...]
> the issue is very elusive: Sometimes it happens when compiling the modules
> themselves, sometimes when compiling a program that uses the modules.
> I have no clue what the error means and the rest of the case seems
> non-deterministic.

The pi_tree is used when reading a module file (.mod). Often, when reading a
symbol from the .mod file, not all pieces of information are available. Thus,
an incomplete symbol is created - and later the missing bits are added. The
information is storied in a binary tree ("pi_tree" as it stores a pointer and
an integer as id). And the ICE (= internal compiler error) occurs if that tree
has a bad status.

There are two kinds of possible problems, leading to such a failure:
(a) The tree is not properly walked (during fixup resolution); that typically
occurs when it is modified while walking the tree - as the modification might
cause a tree rebalancing. 
(b) Freed memory is accessed - which either shouldn't be accessed or shouldn't
be freed. Often the memory (still) contains the correct or at least somewhat
sensible data. [Or some variants of that.]

Both type of problems depend on many details - and not only on the compiler
input but also the hardware, libraries and how the compiler has been compiled.
Tiny differences can cause the program to fail or not to fail. Unfortunately,
it does not make it simple to find the bug.

In this case, my suspicion would be that there is a bug when reading a .mod
file. However, I remember a problem* where symbols where not properly resolved,
leading to writing insufficient data to the .mod file, such that at the end the
ICE occurred when reading the .mod file - but the bug was much earlier. (*
http://gcc.gnu.org/ml/fortran/2011-11/msg00000.html) Unfortunately, debugging
the pi_tree is very difficult as the pointers it contains lack type
information.


I hope that your problem is reproducible, i.e., if you find a test case, it
will more or less reliably also fail on, e.g., my computer. That will make
debugging tremendously easier. You could also try valgrind; there should be no
failure (except of leaking memory). However, I fear that valgrind won't help in
this case.

Other than that, I can only suggest to create a small rest case. For instance
using http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction [please use GCC 4.8
for that]. I do not have any other idea and I fear that even with a small test
case, debugging won't be easy.


  reply	other threads:[~2012-04-17  9:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17  6:30 [Bug fortran/53015] New: " brainschrat at gmx dot de
2012-04-17  9:11 ` burnus at gcc dot gnu.org [this message]
2012-04-17 13:51 ` [Bug fortran/53015] " brainschrat at gmx dot de
2012-04-18 15:26 ` brainschrat at gmx dot de
2012-04-19 12:16 ` janus at gcc dot gnu.org
2012-04-23 11:48 ` brainschrat at gmx dot de
2012-04-23 12:46 ` burnus at gcc dot gnu.org
2012-04-30 13:01 ` brainschrat at gmx dot de
2012-06-01 10:00 ` brainschrat at gmx dot de

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=bug-53015-4-3F58ktMrwJ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).