apache / fury

A blazingly fast multi-language serialization framework powered by JIT and zero-copy.
https://fury.apache.org/
Apache License 2.0
2.97k stars 218 forks source link

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 8192 #1723

Open yzhsss opened 2 months ago

yzhsss commented 2 months ago

Search before asking

Version

      <dependency>
            <groupId>org.apache.fury</groupId>
            <artifactId>fury-core</artifactId>
            <version>0.5.1</version>
        </dependency>

Component(s)

Java

Minimal reproduce step

    int processorCount = Runtime.getRuntime().availableProcessors();
    SERIALIZER = Fury.builder()
        .withLanguage(Language.JAVA)
        .requireClassRegistration(false)
        .withRefTracking(true)
        .withCompatibleMode(CompatibleMode.COMPATIBLE)
        .withDeserializeUnexistedClass(true)
        .buildThreadSafeFuryPool(processorCount, processorCount * 2, 5, TimeUnit.MINUTES);

Occasional errors occur

What did you expect to see?

no error

What did you see instead?

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 8192 at io.fury.collection.IntArray.pop(IntArray.java:51) at io.fury.resolver.MapRefResolver.reference(MapRefResolver.java:194) at xx.ListSearchResponseTypeFuryRefCompatibleCodec_1_1441410416_471140463.read(ListSearchResponseTypeFuryRefCompatibleCodec_1_1441410416_471140463.java:312) at io.fury.Fury.readDataInternal(Fury.java:899) at io.fury.Fury.deserializeJavaObject(Fury.java:1060) at io.fury.Fury.deserializeJavaObject(Fury.java:1042) at io.fury.pool.ThreadPoolFury.deserializeJavaObject(ThreadPoolFury.java:152) at xx.ZstdFuryFormatter.deserialize(ZstdFuryFormatter.java:77) at xx.ServiceClientBase.deserializeResponse(ServiceClientBase.java:2466) at xx.ServiceClientBase.invokeInternal(ServiceClientBase.java:1635) at xx.ServiceClientBase.lambda$invoke0$7(ServiceClientBase.java:1568) at xx.facade.CommandExecutor.execute(CommandExecutor.java:57) at xx.CHystrixCommandExecutor.execute(CHystrixCommandExecutor.java:134) at xxoss.baiji.rpc.client.ServiceClientBase.invoke0(ServiceClientBase.java:1565) at xxoss.baiji.rpc.client.ServiceClientBase.invoke(ServiceClientBase.java:1536) at xxoss.baiji.rpc.client.ServiceClientBase.invoke(ServiceClientBase.java:1530) at xx.ServiceClientExtension.invokeSync(ServiceClientExtension.java:272) at xx.ServiceClientExtension.invoke(ServiceClientExtension.java:145) at xx.listSearch(FlightXFacade.java:370) at xx.getFlightResponse(FlightXFacade.java:106) at xx.requestLeg(FlightXFlightBusiness.java:2052) at xx.lambda$requestFlight$26(FlightXFlightBusiness.java:1874) at xx.FlightParallel.lambda$process$0(FlightParallel.java:230) at xx.cat.async.CatWrappedRunnable.lambda$run$0(CatWrappedRunnable.java:30) at xx.cat.async.CatAsyncSupportTemplate.doExecute(CatAsyncSupportTemplate.java:121) at xx.cat.async.CatAsyncSupportTemplate.execute(CatAsyncSupportTemplate.java:96) at xx.cat.async.CatWrappedRunnable.run(CatWrappedRunnable.java:29) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82) at java.base/java.util.concurrent.ThreadPerTaskExecutor$TaskRunner.run(ThreadPerTaskExecutor.java:314) at java.base/java.lang.VirtualThread.run(VirtualThread.java:309)

Anything Else?

No response

Are you willing to submit a PR?

chaokunyang commented 2 months ago

Hi @yzhsss , thanks for reporting this issue, could you provide reproduction code?This is a data related bug. Without reproduction code, it's hard to know whatgoes wrong

yzhsss commented 2 months ago

What kind of code do you need? I can try to get you a base64String data

chaokunyang commented 1 month ago

We need an unit test to debug line by line.