exbin / bined-intellij-plugin

Hex viewer/editor plugin for JetBrains IntelliJ platform
https://bined.exbin.org/intellij-plugin
Apache License 2.0
59 stars 9 forks source link

IndexOutOfBoundsException thrown while searching #17

Closed SimonIT closed 2 years ago

SimonIT commented 5 years ago

I opened a big csv file (71.36MB). Then, I wanted to search a text and the exception was thrown.

java.lang.IndexOutOfBoundsException
    at java.io.RandomAccessFile.readBytes(Native Method)
    at java.io.RandomAccessFile.read(RandomAccessFile.java:377)
    at org.exbin.deltahex.delta.DeltaDataPageWindow.loadPage(DeltaDataPageWindow.java:62)
    at org.exbin.deltahex.delta.DeltaDataPageWindow.getByte(DeltaDataPageWindow.java:84)
    at org.exbin.deltahex.delta.FileDataSource.getByte(FileDataSource.java:73)
    at org.exbin.deltahex.delta.FileSegment.getByte(FileSegment.java:59)
    at org.exbin.deltahex.delta.DeltaDocumentWindow.getByte(DeltaDocumentWindow.java:55)
    at org.exbin.deltahex.delta.DeltaDocument.getByte(DeltaDocument.java:91)
    at org.exbin.deltahex.delta.DeltaDocument.copyToArray(DeltaDocument.java:230)
    at org.exbin.deltahex.intellij.DeltaHexFileEditor.searchForText(DeltaHexFileEditor.java:1350)
    at org.exbin.deltahex.intellij.DeltaHexFileEditor.access$2800(DeltaHexFileEditor.java:87)
    at org.exbin.deltahex.intellij.DeltaHexFileEditor$31.performFind(DeltaHexFileEditor.java:1130)
    at org.exbin.deltahex.intellij.panel.HexSearchPanel.performFind(HexSearchPanel.java:837)
    at org.exbin.deltahex.intellij.panel.HexSearchPanel$19$1.run(HexSearchPanel.java:804)
    at java.lang.Thread.run(Thread.java:745)

IntelliJ IDEA 2018.2.5 (Ultimate Edition) Build #IU-182.4892.20, built on October 16, 2018 JRE: 1.8.0_152-release-1248-b19 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

hajdam commented 5 years ago

Thank you for your report. I'll try to look into big files in next version.

As a workaround for now I suggest to switch to memory mode instead of delta mode - in options or in bottom right corner next to INS/OVR (popup menu). Whole file will be loaded into memory thou.

There could be multiple reasons for this issue:

hajdam commented 4 years ago

I tried to look into this, but it seems to be some kind of race condition when performing search. I'll check it in future, in version 0.2.2 it should throw different error thou.