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

Terracotta Project Issue Tracker | Jeffrey Samarziya | 7 years ago
  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 | 7 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 | 7 years ago | Jeffrey Samarziya
    java.lang.IllegalArgumentException: Illegal initial capacity: -128
  3. 0

    Sending garbage data will raise weird exception

    GitHub | 5 months ago | ph
    io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: Illegal initial capacity: -1982301064
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Saw this on one of the logs: {code} java.lang.IllegalArgumentException: Illegal initial capacity: -1 at java.util.HashMap.<init>(HashMap.java:172) at java.util.HashMap.<init>(HashMap.java:199) at com.aptana.internal.index.core.DiskIndex.readCategoryTable(DiskIndex.java:1101) at com.aptana.internal.index.core.DiskIndex.mergeCategory(DiskIndex.java:795) at com.aptana.internal.index.core.DiskIndex.mergeCategories(DiskIndex.java:768) at com.aptana.internal.index.core.DiskIndex.mergeWith(DiskIndex.java:929) at com.aptana.index.core.Index.save(Index.java:698) at com.aptana.index.core.Index.save(Index.java:671) at com.aptana.core.internal.build.IndexBuildParticipant.buildEnding(IndexBuildParticipant.java:66) at com.aptana.core.internal.build.LazyBuildParticipant.buildEnding(LazyBuildParticipant.java:67) at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.runParticipants(CommonReconcilingStrategy.java:341) at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.reconcile(CommonReconcilingStrategy.java:277) at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.reconcile(CommonReconcilingStrategy.java:235) at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.fullReconcile(CommonReconcilingStrategy.java:477) at com.aptana.editor.common.text.reconciler.CompositeReconcilingStrategy.fullReconcile(CompositeReconcilingStrategy.java:125) at com.aptana.editor.common.text.reconciler.CommonReconciler.process(CommonReconciler.java:162) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206) {code}

    Appcelerator JIRA | 4 years ago | Shalom Gibly
    java.lang.IllegalArgumentException: Illegal initial capacity: -1

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    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