HxD sometimes hangs when past-writing at file end

Bug reports concerning HxD.
Post Reply
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

HxD sometimes hangs when past-writing at file end

Post by Maël »

Test case to reproduce bug:

Copy first 7 bytes (any number of bytes will do), then change first byte (press a random key), go to file end, paste-overwrite (Ctrl+B)

=> HxD will hang

Related bug test case:

Copy first 7 bytes (any number of bytes will do), change nothing!, go to file end, paste-overwrite (Ctrl+B)

=> Listindex error
asdvw43
Posts: 10
Joined: 29 Jun 2022 19:54

Re: HxD sometimes hangs when past-writing at file end

Post by asdvw43 »

I get the error on empty document using CTRL+B
Hang where there is data

I don't need to change any first byte content, just CTRL+B near -or at end of document so some bytes won't fit inside current docuiment size = Hang

CTRL+V is fine as it ADDS to any document, but your idea of CTRL+B seems to be a "overwriting only inside current sized document", well ofcourse any CTRL+B will cause error (when catchable) of hang when not, when adding data beyond last byte, your function should make sure the copy buffer fits inside the document without making it larger if that's the point, or best: overwrite till end of document and ADD the remaining if that's what's wanted.

Cheers :)
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: HxD sometimes hangs when past-writing at file end

Post by Maël »

The bug is a bit more complicated than that, it will expand the document/EditStream when necessary, of course, but related datastructures that monitor this change don't get updated properly.

Thanks for the additional test case. It is a special case of the second test case in my first post (which also does not modify the file before Ctrl+B). Mine makes sure to have a defined clipboard content first (that can be pasted, i.e., has the right format), and also goes to the file end (which is not necessary for an empty file).

But it's good to have an additional simplified test case, as well.
Post Reply