Thanks for the previous fix in #97. We have run into another integer overflow issue related to representing our larger FPGA devices (see Xilinx/RapidWright#176 for reference). When we serialize a message that has a greater number of bytes than Integer.MAX_VALUE=2147483647, we get an error when we try to read it:
Exception in thread "main" java.lang.IllegalArgumentException: capacity < 0: (-1862524376 < 0)
at java.base/java.nio.Buffer.createCapacityException(Buffer.java:256)
at java.base/java.nio.ByteBuffer.allocate(ByteBuffer.java:347)
at org.capnproto.Serialize.makeByteBuffer(Serialize.java:34)
at org.capnproto.Serialize.read(Serialize.java:89)
at com.xilinx.rapidwright.interchange.Interchange.readInterchangeFile(Interchange.java:76)
at com.xilinx.rapidwright.interchange.DeviceResourcesVerifier.verifyDeviceResources(DeviceResourcesVerifier.java:124)
at com.xilinx.rapidwright.interchange.DeviceResourcesExample.main(DeviceResourcesExample.java:35)
Which runs into an issue because of the use of a ByteBuffer that is allocated using an int. Since there is no option to allocate using a long, perhaps makeByteBuffer() could return an array of ByteBuffer objects and update handling accordingly?
Thanks for the previous fix in #97. We have run into another integer overflow issue related to representing our larger FPGA devices (see Xilinx/RapidWright#176 for reference). When we serialize a message that has a greater number of bytes than
Integer.MAX_VALUE=2147483647
, we get an error when we try to read it:Which runs into an issue because of the use of a
ByteBuffer
that is allocated using anint
. Since there is no option to allocate using along
, perhapsmakeByteBuffer()
could return an array ofByteBuffer
objects and update handling accordingly?