WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
43.98k stars 1.92k forks source link

[Bug] File reload popup after Save + File size growing after resize and few saves #1655

Open glpnk opened 4 months ago

glpnk commented 4 months ago

Operating System

Linux

What's the issue you encountered?

  1. File was modified by external source message after saving in ImHex.
  2. If file size was increased, it's still increasing after next saves. (Not works with reducing file size and big reduce with small increase after)

How can the issue be reproduced?

  1. Create and Save OR Open small file (~2 bytes will be enough)
  2. Resize File (+n bytes)
  3. Save
  4. ImHex will ask for reloading the file, assuming that it has been modified by an external source. [BUG 1]
  5. Accept reloading, now your file looks bigger. But extra n bytes are not saved now, but looks like saved.
  6. Save + Reload few times. Your file is growing. [BUG 2]

ImHex Version

from commit 45a3bdffe on master (v1.33.1)

ImHex Build Type

Installation type

CLion build / GH Actions Arch Linux

Additional context?

Initially tested on Ubuntu 22.04 based distro running on BTRFS.

Windows seems not be affected by this issue.

I ask a friend with Arch running on BTRFS to test some latest build from GH Actions build artifacts. Issue was confirmed.

I don't know, is Apple affected or not.


Building small file commit was unsuccessful, so actually I use ca3708df71bc for testing.

In this version, the reload message appears a few seconds after the file is saved. But I think the issue is starts from small file commit.

If the file is larger than 128 MB, the issue does not occur anymore. (Because different access method is used.)


Not fixed by

https://github.com/WerWolv/ImHex/pull/1654 https://github.com/WerWolv/libwolv/pull/14