[rfc][icedtea-web] Java -> Javascript object leak tests

Pavel Tisnovsky ptisnovs at redhat.com
Mon Sep 30 08:21:31 PDT 2013


Hi Adam!

This fix/refactoring looks good, ok for HEAD.

Would you mind if I push this patch instead of you?

Cheers,
Pavel

----- Adam Domurad <adomurad at redhat.com> wrote:
> On 08/28/2013 02:58 PM, Adam Domurad wrote:
> > Hi all. The fixes will be posted soon, but I am putting this here so the
> > reviewer can have a head-start.
> >
> > These tests currently fail.
> >
> > Bundled also are some C++ unit test infrastructure improvements:
> >
> > * Ability to query Java objects stored in PluginObjectStore for the C++
> > unit tests. MemoryLeakDetector was augmented to use this to calculate
> > Javascript-bound Java object leaks.
> > * The tests now fail if there is a leak of any of the three kinds:
> >   - NPAPI (eg browser_functions.memalloc)
> >   - C++ (new/delete)
> >   - Bound Java object leak (reference to Javascript-bound Java object in
> > PluginObjectStore never freed)
> > * Minor output improvements
> >
> > ChangeLog:
> > 2013-XX-XX  Adam Domurad  <adomurad at redhat.com>
> >
> >          Add Java-object leak unit tests & reproducer. Treat unit test
> > leak as
> >          failure.
> >          * plugin/icedteanp/java/sun/applet/PluginObjectStore.java
> >          (getStoredClassCount): New, allow for querying amount of currently
> >          bound plugin Java classes.
> >          (getStoredInstanceCount): New, allow for querying amount of
> > currently
> >          bound plugin Java objects.
> >          * tests/cpp-unit-tests/java_query.cc: Uses reflection to access
> >          PluginObjectStore (getStoredInstanceCount) and
> > (getStoredClassCount).
> >          * tests/cpp-unit-tests/java_query.h: Same, as well introduce
> >          JavaValueID, which keeps track of Java object references.
> >          * tests/cpp-unit-tests/IcedTeaJavaRequestProcessorTest.cc: Make
> > use of
> >          JavaValueID wherever possible.
> >          * tests/cpp-unit-tests/IcedTeaNPPluginTest.cc: Update to new
> >          MemoryLeakDetector interface.
> >          * tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc: Same.
> >          * tests/cpp-unit-tests/MemoryLeakDetector.h: Unify warning
> > messages
> >          with leak detection.
> >          * tests/cpp-unit-tests/main.cc: More forceful memory leak
> > detection:
> >          Treat any of the 3 kinds of memory detection as failure.
> >          *
> > tests/reproducers/simple/JavascriptMemoryLeak/resources/JavascriptMemoryLeak.html:
> >
> >          Test if binding large objects continuously causes
> > OutOfMemoryError.
> >          *
> > tests/reproducers/simple/JavascriptMemoryLeak/resources/JavascriptMemoryLeak.js:
> >
> >          Same.
> >          *
> > tests/reproducers/simple/JavascriptMemoryLeak/srcs/JavascriptMemoryLeak.java:
> >
> >          Same.
> >          *
> > tests/reproducers/simple/JavascriptMemoryLeak/testcases/JavascriptMemoryLeakTest.java:
> >
> >          Same.
> >
> > With this patch on HEAD, 36/42 unit tests should pass (6 failures), and
> > the reproducer should fail.
> >
> > Happy hacking,
> > -Adam
> 
> 
> These test fixes came up during creation of the patch.
> 
> To be applied after the tests patch.
> 
> Cheers,
> -Adam



More information about the distro-pkg-dev mailing list