You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I experienced strange behaviour of OHMap after removal of element. Here is sample code to generate issue:
String KEY = "KEY";
String VALUE = "VALUE";
OHMap<String, String> ohMap = new OHMap<>(10);
ohMap.put(KEY, VALUE);
ohMap.remove(KEY);
Iterator<String> iterator = ohMap.values().iterator();
if (iterator.hasNext()) {
iterator.next();
}
It generates JVM crash:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f2a1f9c9aed, pid=25433, tid=0x00007f2a1e608700
#
# JRE version: OpenJDK Runtime Environment (8.0_242-b08) (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.242-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0xa81aed]
or Exception:
java.lang.NegativeArraySizeException
at com.cfelde.bohmap.BOHMap$ValuesIterator.next(BOHMap.java:1009)
at com.cfelde.bohmap.BOHMap$ValuesIterator.next(BOHMap.java:944)
at com.cfelde.bohmap.OHMap$Values$1.next(OHMap.java:282)
at com.cfelde.bohmap.OHMap$Values$1.next(OHMap.java:274)
It looks like iterator#hasNext return true, but Iterator#next causes exception/crash.
The text was updated successfully, but these errors were encountered:
Hi,
I experienced strange behaviour of OHMap after removal of element. Here is sample code to generate issue:
It generates JVM crash:
or Exception:
It looks like iterator#hasNext return true, but Iterator#next causes exception/crash.
The text was updated successfully, but these errors were encountered: