Stream read eror on File Compare Next Difference (F6)

Bug reports concerning HxD.
Post Reply
sidwu
Posts: 6
Joined: 21 Apr 2008 11:42

Stream read eror on File Compare Next Difference (F6)

Post by sidwu »

I had seen this bug from a long time ago (forget from what version, but certainly v.1.6.x and v1.7.x have this bug), but I didn't expect that until now it's still unspotted.

Here are the steps to produce the bug:
-You should have two identical big size files (approx. 10MB up, more bigger more easier to produce the bug).
-In second file, I changed its byte 8th to 16th, so now both of them are non-indentic.
-Open both of them with HxD.
-Set cursor of both files to first byte and press CTRL+K, and click OK.
-After cursor set to first difference, hold F6 (Next Difference).
-You would get message box "No further differences found.", then click OK and you would get error message box "Stream read error" (note: this message was a bit scared me that I thought HxD had corrupted my files).
-That's it.


Btw, I'm really like this feature (the file compare) which I used it very often than other feature (ironic isn't it? HxD is actually hex editor, not file comparer :P).

EDIT: oh yeah, just a little request. If user activates the "Create backup copies (BAK-files)" option, there should be a warning/confirmation message dialog if user edited a big size file (i.e., 500 MB or bigger) intentionally/not, since creating backup of big file each time of saving would slow down the application usage experience.


Keep up the good work.

Maël
Site Admin
Posts: 1217
Joined: 12 Mar 2005 14:15

Re: Stream read eror on File Compare Next Difference (F6)

Post by Maël »

Thanks for the bug report!
sidwu wrote: Here are the steps to produce the bug:
-You should have two identical big size files (approx. 10MB up, more bigger more easier to produce the bug).
-In second file, I changed its byte 8th to 16th, so now both of them are non-indentic.
-Open both of them with HxD.
-Set cursor of both files to first byte and press CTRL+K, and click OK.
-After cursor set to first difference, hold F6 (Next Difference).
-You would get message box "No further differences found.", then click OK and you would get error message box "Stream read error" (note: this message was a bit scared me that I thought HxD had corrupted my files).
-That's it.
I tried to reproduce it a couple of times with some variations but couldn't. Could you make a small video? I guess it's a detail of how you do it that triggers the bug and which I do differently.
sidwu wrote: EDIT: oh yeah, just a little request. If user activates the "Create backup copies (BAK-files)" option, there should be a warning/confirmation message dialog if user edited a big size file (i.e., 500 MB or bigger) intentionally/not, since creating backup of big file each time of saving would slow down the application usage experience.
There is a progress window that appears when the backup file gets created. You can cancel that, so that the backup file is not created but the file is saved anyway (you'll be asked to confirm saving for safety reasons though). Or do you want something else?

sidwu
Posts: 6
Joined: 21 Apr 2008 11:42

Re: Stream read eror on File Compare Next Difference (F6)

Post by sidwu »

Here is the demo video link:
http://www.ziddu.com/download/12036854/ ... mo.7z.html
There is a progress window that appears when the backup file gets created. You can cancel that, so that the backup file is not created but the file is saved anyway (you'll be asked to confirm saving for safety reasons though). Or do you want something else?
I see, I dunno about that since I turned off the backup file option. However I think that's a good method too. Just one issue, if the option is turned on and user is saving a file with size more than 1 GB, then the process of creating of backup is running and then cancelled by user. The question: is there any impact of the backup-creating process to the PC? maybe such as: making the file system more fragmented, etc.

I dunno what's the best solution for all users. My idea might not be acceptable for other users. My idea is like this, there is an option in options dialog at security section:

Code: Select all

Don't create a backup copies for file with size equal or more than _________ MB
note: _________ is a textbox

Maël
Site Admin
Posts: 1217
Joined: 12 Mar 2005 14:15

Re: Stream read eror on File Compare Next Difference (F6)

Post by Maël »

Thanks. I could reproduce it now. It's a bit of a difficult to fix problem cause it's a race condition. I added some notes so I can reproduce and fix it later.

Simplified test case:

[*]File A and B are identical in size and content, except that file A has different byte values at at least 2 positions.
[*]Press Ctrl+K and confirm, this selects the first difference
[*]Press down F6 and hold it until the progress window appears (this selects the next difference and continues the search for differences)
[*]Error: Sometimes OS error exception appears, but there are always stream read errors after the progress window is gone and the "no more differences" dialog was confirmed.

Probable reason: race condition between the started comparison (the one that is done and represented by the progress window) and another one that is started while the progress window shows and is triggered because F6 is held down (instead of being just pressed once).

Post Reply