public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dave Korn <dave.korn.cygwin@googlemail.com>
To: Dave Korn <dave.korn.cygwin@googlemail.com>
Cc: Bryce McKinlay <bmckinlay@gmail.com>,
	  Java Patches <java-patches@gcc.gnu.org>,
	 GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [REVIVED: PATCH PR42811,4.5 regression] java.lang.ExceptionInInitializerError  in ecj1
Date: Thu, 18 Feb 2010 15:38:00 -0000	[thread overview]
Message-ID: <4B7D631B.8030401@gmail.com> (raw)
In-Reply-To: <4B7CC61E.1050709@gmail.com>

On 18/02/2010 04:46, Dave Korn wrote:

>>>        * jvmti.cc (_Jv_GetJVMTIEnv): Fix use of uninitialised memory
>>>        exposed by the above change.
>> This part is fine.
> 
>   Well: it appears to have caused a regression (investigating which is the
> reason why I took a while to respond to you).  I'm now seeing:
> 
>> Running /gnu/gcc/gcc/libjava/testsuite/libjava.loader/loader.exp ...
>> FAIL: /gnu/gcc/obj-pr42811-3/i686-pc-cygwin/libjava/testsuite/TestEarlyGC.exe output - /gnu/gcc/obj-pr42811-3/i686-pc-cygwin/libjava/testsuite/TestEarlyGC.exe
> 
> *sigh*, and it turns out to be because some memory is getting released by the
> garbage collector when its still in use.  I'm busy trying to learn how the GC
> works real fast so I can figure out what's going wrong.

  I'm now very sure that the problem is a side-effect of the libgcj DLL being
rebased at runtime, and not related to the clearing of memory in
_Jv_GetJVMTIEnv (which isn't even called in this testcase).  So I'd like to go
ahead with this part of the patch after all.  I'll spend up to another 24
hours trying to fix the knock-on failure before I commit it, it would be nice
to have the fix for that ready to go in at the same time.  That still OK with
you?  (Also, did my explanation for the other part of the patch make sense, or
do I need to go into more detail about anything?)

>  I was surprised to
> discover that the test executable links its own entirely separate copy of the
> GC library in addition to the one that's in the libjava DLL(s), is that
> supposed to happen?

  I was wrong about this, it was a red herring caused by the fact that libgcj
was getting rebased down to a runtime address so low that I thought it was in
the EXE's text section; in fact it was not.  I've now proven that by rebasing
all the other DLLs out of the way I can make the test pass or fail just by
moving around where libgcj gets loaded in the process memory space, and it
fails in different ways according to where I move it to, which is symptomatic
of a problem with base relocations in the generated DLL.  I'm going to look at
how the GC determines the extent of the DLL's data area when it looks for
pointers during the mark phase, because if the static data region ranges
aren't being fixed up correctly when the DLL gets rebased to a different load
address at runtime, that could cause this kind of problem.

    cheers,
      DaveK

      reply	other threads:[~2010-02-18 15:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05 22:09 [PATCH " Dave Korn
2010-02-06  6:12 ` Dave Korn
2010-02-15  2:49   ` [REVIVED: PATCH " Dave Korn
2010-02-15 13:04     ` Bryce McKinlay
2010-02-18  4:28       ` Dave Korn
2010-02-18 15:38         ` Dave Korn [this message]

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=4B7D631B.8030401@gmail.com \
    --to=dave.korn.cygwin@googlemail.com \
    --cc=bmckinlay@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=java-patches@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).