Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-453

Leaking/double-release of direct ByteBuffers in CI

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: QUADS_QUERY_BRANCH
    • Fix Version/s: None
    • Component/s: Other

      Description

      Martyn wrote:

      I ran through TestAll again and as usual ran out of resources about halfway. The first failure though was pretty interesting:

      Trace below consistently drops from

      com.bigdata.io.TestDirectBufferPoolAllocator.test_allocateThenClose(TestDirectBufferPoolAllocator.java:178)
      
      java.lang.IllegalArgumentException: buffer already released.
           at com.bigdata.io.DirectBufferPool.release(DirectBufferPool.java:593)
           at com.bigdata.io.DirectBufferPool.release(DirectBufferPool.java:552)
           at
      com.bigdata.io.DirectBufferPoolAllocator$AllocationContext.release(DirectBufferPoolAllocator.java:529)
           at
      com.bigdata.io.DirectBufferPoolAllocator.close(DirectBufferPoolAllocator.java:117)
           at
      com.bigdata.io.TestDirectBufferPoolAllocator.test_allocateThenClose(TestDirectBufferPoolAllocator.java:178)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at junit.framework.TestCase.runTest(TestCase.java:154)
           at junit.framework.TestCase.runBare(TestCase.java:127)
           at junit.framework.TestResult$1.protect(TestResult.java:106)
           at junit.framework.TestResult.runProtected(TestResult.java:124)
           at junit.framework.TestResult.run(TestResult.java:109)
           at junit.framework.TestCase.run(TestCase.java:118)
           at junit.framework.TestSuite.runTest(TestSuite.java:208)
           at junit.framework.TestSuite.run(TestSuite.java:203)
           at junit.framework.TestSuite.runTest(TestSuite.java:208)
           at junit.framework.TestSuite.run(TestSuite.java:203)
           at junit.framework.TestSuite.runTest(TestSuite.java:208)
           at junit.framework.TestSuite.run(TestSuite.java:203)
           at
      org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
           at
      org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
           at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
           at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
           at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
           at
      org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      
      

      It looks like there's a protocol problem with
      IAllocationContext.release() since it should be released by the DirectBufferPool or the call to release() should remove from the pool.
      If it is called directly, then the old code, without the checks, would have double released direct buffers when the DirectBufferPool was closed.

      The only other user of the DirectBufferPool outside the tests is ManagedResourceService and the only other call to IAllocation.release() is called from test_oneChunk() in com.bigdata.bop.fed.testNIChunkMessage
      where NIOChunkMessage releases all its IAllocations.

      DirectPoolAllocator.close() is called from ManagedResourceService and, interestingly, finalize.

        Attachments

          Activity

            People

            Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: