← Back to team overview

openjdk team mailing list archive

[Bug 1295987] Re: openjdk6 regression causes finalizers never to be called

 

Jamie: we've verified that the patch I applied *appears* to fix the bug
we are seeing. I say *appears* as the bug manifesting itself seems to be
a function of uninitialized values on the stack; on some runs it
explodes with leaking stuff straight away, other times it runs fine for
many many hours, and only later explodes. I haven't verified your .deb
files but could you tell me what patch(es) they are using? I can then
get QA here to play with them.

-- 
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-6 in Ubuntu.
https://bugs.launchpad.net/bugs/1295987

Title:
  openjdk6 regression causes finalizers never to be called

Status in “openjdk-6” package in Ubuntu:
  Fix Committed
Status in “openjdk-6” source package in Lucid:
  Triaged
Status in “openjdk-6” source package in Precise:
  Fix Committed
Status in “openjdk-6” source package in Quantal:
  In Progress
Status in “openjdk-6” source package in Saucy:
  In Progress
Status in “openjdk-6” source package in Trusty:
  Fix Committed

Bug description:
  Upgrading openjdk6 from 6b27-1.12.6-1ubuntu0.12.04.4 to
  6b30-1.13.1-1ubuntu2~0.12.04.1 (Precise update in Jan / Feb 2014)
  causes finalizers not to run reliably. Whilst it is good practice to
  avoid use of finalizers, JDBC uses them to close connections, sockets
  use them to close sockets etc., and after this upgrade both of them
  leak apparently randomly under moderate load.

  This is difficult to replicate but we believe it is due to:
  https://java.net/jira/browse/OPENJDK6-29 which was introduced in b28.
  The critical sentences here are: "This can cause mayhem in the JVM
  because the flag fields at the end of the struct end up taking values
  determined by the contents of the stack frame where info is allocated.
  In particular, it can cause the post-jdk6-b28 GC to enqueue discovered
  References using the wrong link field which means that no reference
  processing (including finalization) occurs."

  This is fixed in b31, and the fix is a one line obviously correct change:
    http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/04e4c3ec6516

  which correctly memset's a structure to zero, as opposed to only
  setting the first 8 bytes (64 bit) or 4 bytes (32 bit) to zero.

  As this is a clear regression caused by an update with a substantial
  impact (unresolvable memory leaks of objects with finalizers, other
  resource leaks including FD leaks), I think this is an SRU candidate
  for Precise (which is where we are seeing it).

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/1295987/+subscriptions


References