After building a FrontCodedStringBigList from the CLI with >2^31 elements, I get an error if I try to deserialize it. I couldn't find where the code of CharArrayFrontCodedList was, so I wasn't able to investigate further.
$ seq 1 47483700 | ~/swhgraph.sh it.unimi.dsi.big.util.FrontCodedStringBigList test-underflow.fcl
2021-06-11 21:56:02,043 149 INFO [main] i.u.d.b.u.FrontCodedStringBigList - Reading strings...
2021-06-11 21:56:09,137 7243 INFO [main] i.u.d.b.u.FrontCodedStringBigList - Completed.
2021-06-11 21:56:09,143 7249 INFO [main] i.u.d.b.u.FrontCodedStringBigList - Elapsed: 7s [47,483,700 strings, 6,694,445.23 strings/s, 149.38 ns/string]; used/avail/free/total/max mem: 1.38G/320.74G/1.60G/2.99G/322.12G
2021-06-11 21:56:09,143 7249 INFO [main] i.u.d.b.u.FrontCodedStringBigList - Writing front-coded list to file...
2021-06-11 21:56:10,000 8106 INFO [main] i.u.d.b.u.FrontCodedStringBigList - Completed.
$ java -cp ~/swh-graph-0.4.0.jar -Xmx100G FCLTest.java test-underflow.fcl
<no error>
% seq 1 2147483700 | ~/swhgraph.sh it.unimi.dsi.big.util.FrontCodedStringBigList test-overflow.fcl
[...]
2021-06-11 21:53:31,456 294037 INFO [main] i.u.d.b.u.FrontCodedStringBigList - Elapsed: 4m 53s [2,147,483,700 strings, 7,307,224.59 strings/s, 136.85 ns/string]; used/avail/free/total/max mem: 31.36G/290.77G/1.69G/33.05G/322.12G
2021-06-11 21:53:31,456 294037 INFO [main] i.u.d.b.u.FrontCodedStringBigList - Writing front-coded list to file...
2021-06-11 21:54:13,415 335996 INFO [main] i.u.d.b.u.FrontCodedStringBigList - Completed.
% java -cp ~/swh-graph-0.4.0.jar -Xmx100G FCLTest.java test-overflow.fcl
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 95049506 out of bounds for length 95049506
at it.unimi.dsi.fastutil.BigArrays.get(BigArrays.java:4096)
at it.unimi.dsi.fastutil.chars.CharArrayFrontCodedList.readInt(CharArrayFrontCodedList.java:180)
at it.unimi.dsi.fastutil.chars.CharArrayFrontCodedBigList.rebuildPointerArray(CharArrayFrontCodedBigList.java:433)
at it.unimi.dsi.fastutil.chars.CharArrayFrontCodedBigList.readObject(CharArrayFrontCodedBigList.java:447)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1175)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2325)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2196)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1679)
at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2464)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2358)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2196)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1679)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:493)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:451)
at it.unimi.dsi.fastutil.io.BinIO.loadObject(BinIO.java:95)
at it.unimi.dsi.fastutil.io.BinIO.loadObject(BinIO.java:106)
at FCLTest.main(FCLTest.java:9)
import it.unimi.dsi.big.util.FrontCodedStringBigList;
import it.unimi.dsi.fastutil.io.BinIO;
import java.io.IOException;
public class FCLTest {
static public void main(final String[] argv) throws IOException, ClassNotFoundException {
FrontCodedStringBigList testMap = (FrontCodedStringBigList) BinIO.loadObject(argv[0]);
}
}