Eclipse freezes the whole system when I try to open file with the extension .bin
Brought to you by:
randallco
Eclipse under Linux platform is not opening files(with extension .bin)in Hex mode for relatively larger files(file size greater than 5MB) and is freezing the system when trying to do so. The issue is observed only in Linux environment and not in Windows. Also if the file size is in KB(Kilo Bytes) then Hex Editor is able to open it successfully without any issues, Issue occurs only for files with size greater than 5MB.
Attachment is a compressed file and the uncompressed one is about to 64 MB. when the file is opened in Eclipse(in Linux platform), it freezes the system. Need to do a hard reset and reboot to use the system.
Kindly resolve this issue as soon as possible....
Hi Raguram. In order to reproduce and fix this issue, I will have to get hands on some Linux with Eclipse. It may take some time...
Hi Randallco. Can i know how long it may take to resolve this one.
Hi Randallco. Sorry for interrupting you. May i know when it will be resolved(i.e..,any schedule ?). Anticipating your response.
Thanks,
Raguram M
Hi Randallco.
Hereby i post my findings about this issue in EHEP plugin (in Linux environment), the issue actually takes place upon invoking of the below line:
Line #: hexEditorControl.getHexTable().pack();
in createPartControl() method of HexEditor.java
This line is taking a huge time to complete execution, that's why eclipse appears to be freezed when tried to open a binary file in Hex Editor mode. If we comment out this line and when tried opening the file, the file is opening immediately (in Hex mode). I'm not sure why this happens only in Linux and not in Windows environment.
Kindly look into this issue.
Also if a file is successfully opened in Hex mode then performing a scroll operation over the file (or trying to perform a close operation on that file) eclipse response was very slow. Unable to root cause these issues.
I'd would be very thankful if these issues are resolved at the earliest.
Thanks,
Raguram
Hi Randallco,
I think the problem is with SWT classes used in Linux, the problem is with the below method:
private void determineVisibleRows() {
Line #: int numVisible = table.getClientArea().height / table.getItemHeight();
visibleRows.x = table.getVerticalBar().getSelection();
visibleRows.y = Math.min(visibleRows.x + numVisible - 1, table.getItemCount() - 1);
if (EhepPlugin.isDebugMode())
System.out.println("visibleRows: " + Integer.toHexString(visibleRows.x) + "-" + Integer.toHexString(visibleRows.y) + " numvisi:" + numVisible); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
In Line #, table.getClientArea().height is computed wrongly in Linux (height is coming around Lakhs) due to which Eclipse freezes.
Kindly provide me a solution for this fix..
I'm also attaching a binary file for reproducing the same..
Last edit: Raguram 2014-06-03
Hi Randall,
As stated in my previous comment, the issue is with SWT classes (of Linux) where the getClientArea() method is been computed incorrectly. So i tried invoking the same method from its associated parent's display and found that it was working good.
i.e.., i replaced the Line # (of my previous comment) with the following one:
int numVisible = table.getDisplay().getClientArea().height / table.getItemHeight();
and observed that the binary file was opening instantly.
I've also attached the modified file along with this comment.
Kindly review and provide your feedback..
Thanks,
Raguram
Hi Randall,
Kindly provide your reply for the fix done.
Thanks.
Hi Randall,
Kindly let me know how to export the EHEP sources so that i may verify the fix in release mode. Kindly help us in providing the steps for exporting the EHEP sources.
Anticipating your response...
Thanks..
Hi Raguram,
Finally I found some time to fix the EHEP Plugin based on your valuable input. The attached ZIP file is a pre-release of EHEP 1.1.1. Please can you install it and test it in your Linux environment please? Then let me know whether the problem you reported is fixed.
Thanks a lot.
Randallco, EHEP Project
Hi Randall,
I tried with the attachment and it opens the binary file instantly, but when attempting to perform a scroll operation [to the opened file in editor] the response is too slow [dead slow]. In order to reproduce this issue you can use the binary file [sample.bin] which I'd already attached in my previous comment [comment 6 from top].
Thanks for your response.
Raguram
Hi Raguram,
Thanks for testing. I did some tests of EHEP 1.1.1-prerelease with your “sample.bin” file (30 MB) and it worked great on my PC. The file got open almost instantly, paging down/up with PgDn/PgUp keys and scrolling with mouse and scrollbar was very fast. Also inserting individual bytes with “Ins” key and deleting individual bytes with “Del” key was very fast, without any noticeable delay. I guess in your case there may be yet another bug in Eclipse/SWT libs that occurs in Linux only. Hard to say.
Spec of my test PC:
- Windows 7 64-bit Ultimate Edition SP1;
- CPU Intel i7-4930MX, 8 cores, 3.20 GHz;
- 32 GB RAM;
Is there anything else you could try on your Linux? I don't have any Linux available...so it's hard to troubleshoot for me...
Thanks.
Best regards,
Randallco
Hi Randall,
Kindly fix this compatibility issue existing b/w Linux SWT classes and EHEP sources as we are not much aware of these.
Thanks.
Raguram
Hi Randall,
Is it possible to fix the bug existing in Linux (based on the information provided) ?.
Kindly provide your reply. I'm unable to fix this bug completely (even though I am able to open the large file in hex editor).
Please do the needful.
Regards,
Raguram
Yes, I see that method "getClientArea()" is invoked multiple times in the following classes:
- net.sourceforge.ehep.gui.HexEditorControl
- net.sourceforge.ehep.gui.HexTable
I will have to go through all of these instances and replace them with your suggested workaround...
Hi Randall,
Any update ?? when this is expected to release.
Hi Raguram,
Can you please find some Eclipse log files right after EHEP crashes?
Usually they are located here on your file system under "<workspace-folder>/.metadata" folder, file name is ".log" with some suffixes. Look into those files and attach in here the ones that mention EHEP. Thanks.
Hi Randall,
As already mentioned, this issue is not related to ECLIPSE CRASH and so NO LOG FILES could be found in the "<workspace>/.metadata" folder.
As already told, the computation of the editor client area is been wrongly computed (value is greater than expected) due to which the RESPONSE TIME seems to more. It is during this period of time eclipse (or to be more precise EHEP) appears to be freezed.
This was the actual issue and I couldn't able to find any log files (as eclipse never crashes because of this process). I guess LOG FILES will be created only if application is getting crashed. But here it is not the case and the application seems to be FREEZED and not CRASHED (i.e.., some background process is running which makes the application less responsive).
This issue could be easily duplicated if tried in some Linux systems.
Pl. try to duplicate the issue.
Thanks.
Please enable logging in EHEP as follows:
- Open Eclipse;
- Navigate to Window -> Preferences -> General -> Editors -> Hex Editor;
- Now mark the check box next to "Enable logging";
- Click "OK";
- Restart Eclipse;
- Now reproduce the problem when Eclipse is hanged by EHEP;
- Locate the log file under ".metadata" folder;
- Attach it to this bug report;