I want to report a bug.
Freedom Dev
freedom1b2830 at gmail.com
Tue Feb 13 02:53:15 UTC 2024
I want to report a bug. But I couldn't find the registration page
```
Linux archlinux 6.7.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 05 Feb 2024
22:07:49 +0000 x86_64 GNU/Linux
openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment (build 21.0.2+13)
OpenJDK 64-Bit Server VM (build 21.0.2+13, mixed mode, sharing)
```
```
package bug.streambuilder;
import java.util.ArrayList;
import java.util.Objects;
import java.util.stream.Stream;
import java.util.stream.Stream.Builder;
public final class BugStreamBuilder {
public static void main(final String[] args) {
final var list = new ArrayList<>();
ArrayIndexOutOfBoundsException bound = null;
NullPointerException npe = null;
while (true) {
try {
final Builder<Object> builder = Stream.builder();
list.parallelStream().forEach(builder::accept);
list.add(new Object());
} catch (final ArrayIndexOutOfBoundsException e) {
bound = e;
} catch (final NullPointerException e) {
npe = e;
} catch (final Exception e) {
e.printStackTrace();
}
if (Objects.nonNull(bound) && Objects.nonNull(npe)) {
break;
}
}
System.err.println(list.size());
Objects.requireNonNull(bound);
Objects.requireNonNull(npe);
System.err.println("#".repeat(150));
bound.printStackTrace();
System.err.println("#".repeat(150));
npe.printStackTrace();
}
}
```
```
28
######################################################################################################################################################
java.lang.ArrayIndexOutOfBoundsException
at
java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at
java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:542)
at
java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:567)
at
java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:670)
at
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
at
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
at
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
at
java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at
java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:765)
at bug.streambuilder.BugStreamBuilder.main(BugStreamBuilder.java:20)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 24 out of
bounds for length 16
at
java.base/java.util.stream.SpinedBuffer.accept(SpinedBuffer.java:263)
at
java.base/java.util.stream.Streams$StreamBuilderImpl.accept(Streams.java:362)
at
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at
java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at
java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
at
java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
at
java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at
java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
at
java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
at
java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
at
java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
######################################################################################################################################################
java.lang.NullPointerException
at
java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at
java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:542)
at
java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:567)
at
java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:670)
at
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
at
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
at
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
at
java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at
java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:765)
at bug.streambuilder.BugStreamBuilder.main(BugStreamBuilder.java:20)
Caused by: java.lang.NullPointerException: Cannot store to object array
because "this.curChunk" is null
at
java.base/java.util.stream.SpinedBuffer.accept(SpinedBuffer.java:263)
at
java.base/java.util.stream.Streams$StreamBuilderImpl.accept(Streams.java:362)
at
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at
java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at
java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
at
java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
at
java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at
java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
at
java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
at
java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
at
java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
```
More information about the jdk-dev
mailing list