perlundq/yajsync

IAE when receiving existing file larger than 2 GiB

Closed this issue · 0 comments

Example:

$ stat -c %s file.2G
2147483648
$ yajsync file.2G out
Warning: this software is still unstable and there might be data corruption bugs hiding. So use it only carefully at your own risk.
$ yajsync file.2G out
Warning: this software is still unstable and there might be data corruption bugs hiding. So use it only carefully at your own risk.
$ stat -c %s file.2G+1
2147483649
$ yajsync file.2G+1 out
Warning: this software is still unstable and there might be data corruption bugs hiding. So use it only carefully at your own risk.
$ yajsync file.2G+1 out
Warning: this software is still unstable and there might be data corruption bugs hiding. So use it only carefully at your own risk.
Exception in thread "main" java.lang.IllegalArgumentException: Negative position
        at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:676)
        at com.github.perlundq.yajsync.session.Receiver.matchReplica(Receiver.java:1474)
        at com.github.perlundq.yajsync.session.Receiver.combineDataToFile(Receiver.java:1371)
        at com.github.perlundq.yajsync.session.Receiver.mergeDataFromPeerAndReplica(Receiver.java:1281)
        at com.github.perlundq.yajsync.session.Receiver.matchData(Receiver.java:882)
        at com.github.perlundq.yajsync.session.Receiver.receiveFiles(Receiver.java:747)
        at com.github.perlundq.yajsync.session.Receiver.call(Receiver.java:308)
        at com.github.perlundq.yajsync.session.Receiver.call(Receiver.java:65)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)