[ 
https://issues.apache.org/jira/browse/GEODE-10217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17528847#comment-17528847
 ] 

Jacob Barrett commented on GEODE-10217:
---------------------------------------

ByteBuddy was introduced in 3b8f4401bf117f811f455b8723803edfe61b71fe.

> NullPointerException or NoClassDefFoundError in ThreadLocalRandom causes 
> multiple test failures
> -----------------------------------------------------------------------------------------------
>
>                 Key: GEODE-10217
>                 URL: https://issues.apache.org/jira/browse/GEODE-10217
>             Project: Geode
>          Issue Type: Bug
>          Components: core, tests
>            Reporter: Patrick Johnsn
>            Priority: Major
>
> The below stack traces were seen in the unit-test-openjdk8 job in the 
> pipeline. In addition to the two failures shown, multiple other failures due 
> to {{NoClassDefFoundError}} for {{ThreadLocalRandom}} were also present.
> {noformat}
> DiskEntryHelperTest > doSynchronousWriteReturnsTrueWhenDiskRegionIsSync FAILED
> 10:19:40    org.mockito.exceptions.base.MockitoException: 
> 10:19:40    Mockito cannot mock this class: class 
> org.apache.geode.internal.cache.DiskRegion.
> 10:19:40
> 10:19:40    If you're not sure why you're getting this error, please report 
> to the mailing list.
> 10:19:40
> 10:19:40
> 10:19:40    Java               : 1.8
> 10:19:40    JVM vendor name    : BellSoft
> 10:19:40    JVM vendor version : 25.322-b06
> 10:19:40    JVM name           : OpenJDK 64-Bit Server VM
> 10:19:40    JVM version        : 1.8.0_322-b06
> 10:19:40    JVM info           : mixed mode
> 10:19:40    OS name            : Linux
> 10:19:40    OS version         : 5.4.0-1069-gcp
> 10:19:40
> 10:19:40
> 10:19:40    You are seeing this disclaimer because Mockito is configured to 
> create inlined mocks.
> 10:19:40    You can learn about inline mocks and their limitations under item 
> #39 of the Mockito class javadoc.
> 10:19:40
> 10:19:40    Underlying exception : 
> org.mockito.exceptions.base.MockitoException: Could not modify all classes 
> [class org.apache.geode.internal.cache.DiskRegion, interface 
> org.apache.geode.internal.cache.persistence.DiskRegionView, class 
> org.apache.geode.internal.cache.AbstractDiskRegion]
> 10:19:40        at 
> org.apache.geode.internal.cache.entries.DiskEntryHelperTest.<init>(DiskEntryHelperTest.java:44)
> 10:19:40
> 10:19:40        Caused by:
> 10:19:40        org.mockito.exceptions.base.MockitoException: Could not 
> modify all classes [class org.apache.geode.internal.cache.DiskRegion, 
> interface org.apache.geode.internal.cache.persistence.DiskRegionView, class 
> org.apache.geode.internal.cache.AbstractDiskRegion]
> 10:19:40            at 
> net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:157)
> 10:19:40            at 
> net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:371)
> 10:19:40            at 
> net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:179)
> 10:19:40            at 
> net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:382)
> 10:19:40            ... 1 more
> 10:19:40
> 10:19:40            Caused by:
> 10:19:40            java.lang.IllegalStateException: 
> 10:19:40            Byte Buddy could not instrument all classes within the 
> mock's type hierarchy
> 10:19:40
> 10:19:40            This problem should never occur for javac-compiled 
> classes. This problem has been observed for classes that are:
> 10:19:40             - Compiled by older versions of scalac
> 10:19:40             - Classes that are part of the Android distribution
> 10:19:40                at 
> org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.triggerRetransformation(InlineBytecodeGenerator.java:280)
> 10:19:40                at 
> org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.mockClass(InlineBytecodeGenerator.java:213)
> 10:19:40                at 
> org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.lambda$mockClass$0(TypeCachingBytecodeGenerator.java:47)
> 10:19:40                at 
> net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:157)
> 10:19:40                at 
> net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:371)
> 10:19:40                at 
> net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:179)
> 10:19:40                at 
> net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:382)
> 10:19:40                at 
> org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.mockClass(TypeCachingBytecodeGenerator.java:40)
> 10:19:40                at 
> org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.createMockType(InlineDelegateByteBuddyMockMaker.java:389)
> 10:19:40                at 
> org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.doCreateMock(InlineDelegateByteBuddyMockMaker.java:349)
> 10:19:40                at 
> org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.createMock(InlineDelegateByteBuddyMockMaker.java:328)
> 10:19:40                at 
> org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.createMock(InlineByteBuddyMockMaker.java:56)
> 10:19:40                at 
> org.mockito.internal.util.MockUtil.createMock(MockUtil.java:53)
> 10:19:40                at 
> org.mockito.internal.MockitoCore.mock(MockitoCore.java:96)
> 10:19:40                at org.mockito.Mockito.mock(Mockito.java:1965)
> 10:19:40                at org.mockito.Mockito.mock(Mockito.java:1880)
> 10:19:40                ... 1 more
> 10:19:40
> 10:19:40                Caused by:
> 10:19:40                java.lang.ExceptionInInitializerError
> 10:19:40                    at 
> java.util.concurrent.ConcurrentHashMap.fullAddCount(ConcurrentHashMap.java:2526)
> 10:19:40                    at 
> java.util.concurrent.ConcurrentHashMap.addCount(ConcurrentHashMap.java:2266)
> 10:19:40                    at 
> java.util.concurrent.ConcurrentHashMap.replaceNode(ConcurrentHashMap.java:1166)
> 10:19:40                    at 
> java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:1097)
> 10:19:40                    at 
> org.mockito.internal.util.concurrent.WeakConcurrentMap.expungeStaleEntries(WeakConcurrentMap.java:139)
> 10:19:40                    at 
> org.mockito.internal.util.concurrent.WeakConcurrentMap$WithInlinedExpunction.containsKey(WeakConcurrentMap.java:272)
> 10:19:40                    at 
> org.mockito.internal.creation.bytebuddy.MockMethodAdvice.isMock(MockMethodAdvice.java:169)
> 10:19:40                    at java.lang.Object.equals(Object.java:149)
> 10:19:40                    at 
> java.lang.reflect.Method.equals(Method.java:317)
> 10:19:40                    at java.util.HashMap.getNode(HashMap.java:573)
> 10:19:40                    at java.util.HashMap.get(HashMap.java:558)
> 10:19:40                    at 
> net.bytebuddy.utility.dispatcher.JavaDispatcher$ProxiedInvocationHandler.invoke(JavaDispatcher.java:1143)
> 10:19:40                    at 
> net.bytebuddy.description.method.$Proxy44.getParameterCount(Unknown Source)
> 10:19:40                    at 
> net.bytebuddy.description.method.ParameterList$ForLoadedExecutable.size(ParameterList.java:226)
> 10:19:40                    at 
> net.bytebuddy.description.method.ParameterList$AbstractBase.asTypeList(ParameterList.java:105)
> 10:19:40                    at 
> net.bytebuddy.description.method.MethodDescription$AbstractBase.getStackSize(MethodDescription.java:463)
> 10:19:40                    at 
> net.bytebuddy.asm.Advice$ArgumentHandler$ForAdvice$Default$ForMethodEnter.mapped(Advice.java:4743)
> 10:19:40                    at 
> net.bytebuddy.asm.Advice$Dispatcher$Inlining$CodeTranslationVisitor.visitVarInsn(Advice.java:9335)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.MethodVisitor.visitVarInsn(MethodVisitor.java:359)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.ClassReader.readCode(ClassReader.java:2408)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.ClassReader.readMethod(ClassReader.java:1514)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:744)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:424)
> 10:19:40                    at 
> net.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$AdviceMethodInliner.apply(Advice.java:8325)
> 10:19:40                    at 
> net.bytebuddy.asm.Advice$AdviceVisitor.onAfterExceptionTable(Advice.java:10579)
> 10:19:40                    at 
> net.bytebuddy.utility.visitor.ExceptionTableSensitiveMethodVisitor.considerEndOfExceptionTable(ExceptionTableSensitiveMethodVisitor.java:49)
> 10:19:40                    at 
> net.bytebuddy.utility.visitor.ExceptionTableSensitiveMethodVisitor.visitLabel(ExceptionTableSensitiveMethodVisitor.java:81)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.Label.accept(Label.java:358)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.ClassReader.readCode(ClassReader.java:2057)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.ClassReader.readMethod(ClassReader.java:1514)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:744)
> 10:19:40                    at 
> net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:424)
> 10:19:40                    at 
> net.bytebuddy.dynamic.scaffold.TypeWriter$Default$ForInlining.create(TypeWriter.java:3951)
> 10:19:40                    at 
> net.bytebuddy.dynamic.scaffold.TypeWriter$Default.make(TypeWriter.java:2213)
> 10:19:40                    at 
> net.bytebuddy.dynamic.scaffold.inline.RedefinitionDynamicTypeBuilder.make(RedefinitionDynamicTypeBuilder.java:224)
> 10:19:40                    at 
> net.bytebuddy.dynamic.scaffold.inline.AbstractInliningDynamicTypeBuilder.make(AbstractInliningDynamicTypeBuilder.java:123)
> 10:19:40                    at 
> net.bytebuddy.dynamic.DynamicType$Builder$AbstractBase.make(DynamicType.java:3661)
> 10:19:40                    at 
> org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.transform(InlineBytecodeGenerator.java:394)
> 10:19:40                    at 
> sun.instrument.TransformerManager.transform(TransformerManager.java:188)
> 10:19:40                    at 
> sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
> 10:19:40                    at 
> sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
> 10:19:40                    at 
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> 10:19:40                    at 
> org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.triggerRetransformation(InlineBytecodeGenerator.java:276)
> 10:19:40                    ... 16 more
> 10:19:40
> 10:19:40                    Caused by:
> 10:19:40                    java.lang.NullPointerException
> 10:19:40                        at 
> java.util.concurrent.ThreadLocalRandom.getProbe(ThreadLocalRandom.java:980)
> 10:19:40                        at 
> java.util.concurrent.ConcurrentHashMap.fullAddCount(ConcurrentHashMap.java:2526)
> 10:19:40                        at 
> java.util.concurrent.ConcurrentHashMap.addCount(ConcurrentHashMap.java:2266)
> 10:19:40                        at 
> java.util.concurrent.ConcurrentHashMap.replaceNode(ConcurrentHashMap.java:1166)
> 10:19:40                        at 
> java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:1097)
> 10:19:40                        at 
> org.mockito.internal.util.concurrent.WeakConcurrentMap.expungeStaleEntries(WeakConcurrentMap.java:139)
> 10:19:40                        at 
> org.mockito.internal.util.concurrent.WeakConcurrentMap$WithInlinedExpunction.containsKey(WeakConcurrentMap.java:272)
> 10:19:40                        at 
> org.mockito.internal.creation.bytebuddy.MockMethodAdvice.isMock(MockMethodAdvice.java:169)
> 10:19:40                        at 
> org.mockito.internal.creation.bytebuddy.MockMethodAdvice.isMocked(MockMethodAdvice.java:174)
> 10:19:40                        at 
> java.util.Hashtable.isEmpty(Hashtable.java:245)
> 10:19:40                        at sun.misc.VM.getSavedProperty(VM.java:258)
> 10:19:40                        at 
> java.util.concurrent.ThreadLocalRandom.initialSeed(ThreadLocalRandom.java:139)
> 10:19:40                        at 
> java.util.concurrent.ThreadLocalRandom.<clinit>(ThreadLocalRandom.java:136)
> 10:19:40                        ... 59 more
> MemoryAllocatorJUnitTest > testBasics FAILED
> 10:22:14    java.lang.NoClassDefFoundError: Could not initialize class 
> java.util.concurrent.ThreadLocalRandom
> 10:22:14        at 
> java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:857)
> 10:22:14        at 
> java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1979)
> 10:22:14        at 
> java.util.concurrent.ConcurrentSkipListSet.add(ConcurrentSkipListSet.java:241)
> 10:22:14        at 
> org.apache.geode.internal.offheap.FreeListManager.freeHuge(FreeListManager.java:872)
> 10:22:14        at 
> org.apache.geode.internal.offheap.FreeListManager.free(FreeListManager.java:840)
> 10:22:14        at 
> org.apache.geode.internal.offheap.FreeListManager.free(FreeListManager.java:824)
> 10:22:14        at 
> org.apache.geode.internal.offheap.ReferenceCounterInstance.release(ReferenceCounterInstance.java:110)
> 10:22:14        at 
> org.apache.geode.internal.offheap.ReferenceCounterInstance.release(ReferenceCounterInstance.java:60)
> 10:22:14        at 
> org.apache.geode.internal.offheap.ReferenceCounter.release(ReferenceCounter.java:44)
> 10:22:14        at 
> org.apache.geode.internal.offheap.OffHeapStoredObject.release(OffHeapStoredObject.java:366)
> 10:22:14        at 
> org.apache.geode.internal.offheap.MemoryAllocatorJUnitTest.testBasics(MemoryAllocatorJUnitTest.java:191)
> 10:22:27{noformat}
> ={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}=  Test Results URI 
> ={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}=
> [http://files.apachegeode-ci.info/builds/apache-develop-main/1.15.0-build.1069/test-results/test/1649179431/]
> ={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}={-}=
> Test report artifacts from this job are available at:
> [http://files.apachegeode-ci.info/builds/apache-develop-main/1.15.0-build.1069/test-artifacts/1649179431/unittestfiles-openjdk8-1.15.0-build.1069.tgz]



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to