toddfarmer / arrow-migration

0 stars 1 forks source link

Unit tests fail if assertions are disabled #1961

Closed toddfarmer closed 7 years ago

toddfarmer commented 8 years ago

Note: This issue was originally created as ARROW-105. Please see the migration documentation for further details.

Original Issue Description:

Some unit tests fail with the following stack trace if assertions are disabled.

java.lang.NullPointerException
    at org.apache.arrow.memory.BaseAllocator.verifyAllocator(BaseAllocator.java:589)
    at org.apache.arrow.memory.BaseAllocator.verifyAllocator(BaseAllocator.java:570)
    at org.apache.arrow.memory.RootAllocator.verify(RootAllocator.java:37)
    at org.apache.arrow.memory.TestBaseAllocator.testAllocator_claimedReservation(TestBaseAllocator.java:574)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    Suppressed: java.lang.IllegalStateException: Memory was leaked by query. Memory leaked: (64)
Allocator(claimedReservation) 0/64/64/8192 (res/actual/peak/limit)

        at org.apache.arrow.memory.BaseAllocator.close(BaseAllocator.java:497)
        at org.apache.arrow.memory.TestBaseAllocator.testAllocator_claimedReservation(TestBaseAllocator.java:580)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at mockit.integration.junit4.internal.JUnit4TestRunnerDecorator.executeTestMethod(JUnit4TestRunnerDecorator.java:120)
        at mockit.integration.junit4.internal.JUnit4TestRunnerDecorator.invokeExplosively(JUnit4TestRunnerDecorator.java:65)
        at mockit.integration.junit4.internal.MockFrameworkMethod.invokeExplosively(MockFrameworkMethod.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at mockit.internal.util.MethodReflection.invokeWithCheckedThrows(MethodReflection.java:95)
        at mockit.internal.annotations.MockMethodBridge.callMock(MockMethodBridge.java:76)
        at mockit.internal.annotations.MockMethodBridge.invoke(MockMethodBridge.java:41)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        ... 6 more
    Suppressed: java.lang.IllegalStateException: Memory was leaked by query. Memory leaked: (64)
Allocator(ROOT) 0/64/64/8192 (res/actual/peak/limit)

        at org.apache.arrow.memory.BaseAllocator.close(BaseAllocator.java:497)
        at org.apache.arrow.memory.TestBaseAllocator.testAllocator_claimedReservation(TestBaseAllocator.java:581)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at mockit.integration.junit4.internal.JUnit4TestRunnerDecorator.executeTestMethod(JUnit4TestRunnerDecorator.java:120)
        at mockit.integration.junit4.internal.JUnit4TestRunnerDecorator.invokeExplosively(JUnit4TestRunnerDecorator.java:65)
        at mockit.integration.junit4.internal.MockFrameworkMethod.invokeExplosively(MockFrameworkMethod.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at mockit.internal.util.MethodReflection.invokeWithCheckedThrows(MethodReflection.java:95)
        at mockit.internal.annotations.MockMethodBridge.callMock(MockMethodBridge.java:76)
        at mockit.internal.annotations.MockMethodBridge.invoke(MockMethodBridge.java:41)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        ... 6 more
toddfarmer commented 8 years ago

Note: Comment by Laurent Goujon (laurent): BaseAllocator.java is accessing DEBUG_LOCK before checking if DEBUG is true. This should be the opposite.

toddfarmer commented 8 years ago

Note: Comment by Laurent Goujon (laurent): pull request: https://github.com/apache/arrow/pull/64

toddfarmer commented 8 years ago

Note: Comment by Laurent Goujon (laurent): This was merged in e316b3f765167fa1f45197061624e73332b095f4