java.lang.IllegalArgumentException: Illegal initial capacity: -128

Terracotta Project Issue Tracker | Jeffrey Samarziya | 8 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    An overflow bug exists in PhysicalStateClassLoader#createGetObjectReferencesMethod (line 551). When the number of fields in a managed object is sufficiently large, the generated getObjectReferences() method attempts to invoke the HashSet constructor with an overflowed byte value. This results in a server crash when retrieval of the managed object is attempted. java.lang.IllegalArgumentException: Illegal initial capacity: -128 at java.util.HashMap.<init>(HashMap.java:172) at java.util.HashMap.<init>(HashMap.java:199) at java.util.HashSet.<init>(HashSet.java:125) at com.tc.state.idx1.ObjectWithFields_V1.getObjectReferences(Unknown Source) at com.tc.objectserver.managedobject.PhysicalManagedObjectState.addObjectReferencesTo(PhysicalManagedObjectState.java:112) at com.tc.objectserver.managedobject.ManagedObjectImpl.addObjectReferencesTo(ManagedObjectImpl.java:146) at com.tc.objectserver.managedobject.ManagedObjectTraverser.markProcessed(ManagedObjectTraverser.java:42) at com.tc.objectserver.managedobject.ManagedObjectTraverser.traverse(ManagedObjectTraverser.java:33) at com.tc.objectserver.impl.ObjectManagerImpl.addReachableObjectsIfNecessary(ObjectManagerImpl.java:521) at com.tc.objectserver.impl.ObjectManagerImpl.basicLookupObjectsFor(ObjectManagerImpl.java:497) at com.tc.objectserver.impl.ObjectManagerImpl.lookupObjectsForOptionallyCreate(ObjectManagerImpl.java:196) at com.tc.objectserver.impl.ObjectManagerImpl.lookupObjectsAndSubObjectsFor(ObjectManagerImpl.java:180) at com.tc.objectserver.impl.ObjectRequestManagerImpl.basicRequestObjects(ObjectRequestManagerImpl.java:119) at com.tc.objectserver.impl.ObjectRequestManagerImpl.splitAndRequestObjects(ObjectRequestManagerImpl.java:98) at com.tc.objectserver.impl.ObjectRequestManagerImpl.requestObjects(ObjectRequestManagerImpl.java:85) at com.tc.objectserver.impl.ObjectRequestManagerRestartImpl.requestObjects(ObjectRequestManagerRestartImpl.java:118) at com.tc.objectserver.handler.ManagedObjectRequestHandler.handleEventFromClient(ManagedObjectRequestHandler.java:93) at com.tc.objectserver.handler.ManagedObjectRequestHandler.handleEvent(ManagedObjectRequestHandler.java:52) at com.tc.async.impl.StageImpl$WorkerThread.run(StageImpl.java:142)

    Terracotta Project Issue Tracker | 8 years ago | Jeffrey Samarziya
    java.lang.IllegalArgumentException: Illegal initial capacity: -128
  2. 0

    An overflow bug exists in PhysicalStateClassLoader#createGetObjectReferencesMethod (line 551). When the number of fields in a managed object is sufficiently large, the generated getObjectReferences() method attempts to invoke the HashSet constructor with an overflowed byte value. This results in a server crash when retrieval of the managed object is attempted. java.lang.IllegalArgumentException: Illegal initial capacity: -128 at java.util.HashMap.<init>(HashMap.java:172) at java.util.HashMap.<init>(HashMap.java:199) at java.util.HashSet.<init>(HashSet.java:125) at com.tc.state.idx1.ObjectWithFields_V1.getObjectReferences(Unknown Source) at com.tc.objectserver.managedobject.PhysicalManagedObjectState.addObjectReferencesTo(PhysicalManagedObjectState.java:112) at com.tc.objectserver.managedobject.ManagedObjectImpl.addObjectReferencesTo(ManagedObjectImpl.java:146) at com.tc.objectserver.managedobject.ManagedObjectTraverser.markProcessed(ManagedObjectTraverser.java:42) at com.tc.objectserver.managedobject.ManagedObjectTraverser.traverse(ManagedObjectTraverser.java:33) at com.tc.objectserver.impl.ObjectManagerImpl.addReachableObjectsIfNecessary(ObjectManagerImpl.java:521) at com.tc.objectserver.impl.ObjectManagerImpl.basicLookupObjectsFor(ObjectManagerImpl.java:497) at com.tc.objectserver.impl.ObjectManagerImpl.lookupObjectsForOptionallyCreate(ObjectManagerImpl.java:196) at com.tc.objectserver.impl.ObjectManagerImpl.lookupObjectsAndSubObjectsFor(ObjectManagerImpl.java:180) at com.tc.objectserver.impl.ObjectRequestManagerImpl.basicRequestObjects(ObjectRequestManagerImpl.java:119) at com.tc.objectserver.impl.ObjectRequestManagerImpl.splitAndRequestObjects(ObjectRequestManagerImpl.java:98) at com.tc.objectserver.impl.ObjectRequestManagerImpl.requestObjects(ObjectRequestManagerImpl.java:85) at com.tc.objectserver.impl.ObjectRequestManagerRestartImpl.requestObjects(ObjectRequestManagerRestartImpl.java:118) at com.tc.objectserver.handler.ManagedObjectRequestHandler.handleEventFromClient(ManagedObjectRequestHandler.java:93) at com.tc.objectserver.handler.ManagedObjectRequestHandler.handleEvent(ManagedObjectRequestHandler.java:52) at com.tc.async.impl.StageImpl$WorkerThread.run(StageImpl.java:142)

    Terracotta Project Issue Tracker | 8 years ago | Jeffrey Samarziya
    java.lang.IllegalArgumentException: Illegal initial capacity: -128

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Illegal initial capacity: -128

      at java.util.HashMap.<init>()
    2. Java RT
      HashSet.<init>
      1. java.util.HashMap.<init>(HashMap.java:172)
      2. java.util.HashMap.<init>(HashMap.java:199)
      3. java.util.HashSet.<init>(HashSet.java:125)
      3 frames
    3. com.tc.state
      ObjectWithFields_V1.getObjectReferences
      1. com.tc.state.idx1.ObjectWithFields_V1.getObjectReferences(Unknown Source)
      1 frame
    4. com.tc.objectserver
      ManagedObjectRequestHandler.handleEvent
      1. com.tc.objectserver.managedobject.PhysicalManagedObjectState.addObjectReferencesTo(PhysicalManagedObjectState.java:112)
      2. com.tc.objectserver.managedobject.ManagedObjectImpl.addObjectReferencesTo(ManagedObjectImpl.java:146)
      3. com.tc.objectserver.managedobject.ManagedObjectTraverser.markProcessed(ManagedObjectTraverser.java:42)
      4. com.tc.objectserver.managedobject.ManagedObjectTraverser.traverse(ManagedObjectTraverser.java:33)
      5. com.tc.objectserver.impl.ObjectManagerImpl.addReachableObjectsIfNecessary(ObjectManagerImpl.java:521)
      6. com.tc.objectserver.impl.ObjectManagerImpl.basicLookupObjectsFor(ObjectManagerImpl.java:497)
      7. com.tc.objectserver.impl.ObjectManagerImpl.lookupObjectsForOptionallyCreate(ObjectManagerImpl.java:196)
      8. com.tc.objectserver.impl.ObjectManagerImpl.lookupObjectsAndSubObjectsFor(ObjectManagerImpl.java:180)
      9. com.tc.objectserver.impl.ObjectRequestManagerImpl.basicRequestObjects(ObjectRequestManagerImpl.java:119)
      10. com.tc.objectserver.impl.ObjectRequestManagerImpl.splitAndRequestObjects(ObjectRequestManagerImpl.java:98)
      11. com.tc.objectserver.impl.ObjectRequestManagerImpl.requestObjects(ObjectRequestManagerImpl.java:85)
      12. com.tc.objectserver.impl.ObjectRequestManagerRestartImpl.requestObjects(ObjectRequestManagerRestartImpl.java:118)
      13. com.tc.objectserver.handler.ManagedObjectRequestHandler.handleEventFromClient(ManagedObjectRequestHandler.java:93)
      14. com.tc.objectserver.handler.ManagedObjectRequestHandler.handleEvent(ManagedObjectRequestHandler.java:52)
      14 frames
    5. com.tc.async
      StageImpl$WorkerThread.run
      1. com.tc.async.impl.StageImpl$WorkerThread.run(StageImpl.java:142)
      1 frame