Finalizer being run while class still in use (escape analysis bug)

Andrew Haley aph at redhat.com
Wed Oct 10 16:24:11 UTC 2018


On 10/10/2018 05:17 PM, Volker Simonis wrote:
> On Wed, Oct 10, 2018 at 5:16 PM Andrew Haley <aph at redhat.com> wrote:
>
>> Incidentally, I can't find the review thread for 8199462.
> 
> The thread was called "[PATCH] Reduce Chance Of Mistakenly Early
> Backing Memory Cleanup" and the bug was only created at the very end
> of the discussion. You can find it at:
> 
> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-February/thread.html#51221
> http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-March/thread.html#51863

LOL! Why did I not guess?

> Very interesting reading :)

On Feb 7, 2018, at 7:22 AM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
>
> JIT-compilers in HotSpot aggressively prune dead locals [1], but
> they do that based on method bytecode analysis [2] (and not on
> optimized IR).  So, any usage of a local extends its live range,
> even if that usage is eliminated in generated code. It means an oop
> in that local will live past its last usage in generated code and
> all safepoints (in generated code) till last usage (on bytecode
> level) will enumerate the local it is held in.

That's just a fscking bug, surely. I'm appalled that we rely on
that. Appalled, I tell you! ;-)

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-dev mailing list