Open richardg867 opened 2 years ago
AppRun
uses libapprun_hooks
to intercept libc functions that takes a file path as argument to allow patching it at runtime. The bug should be there. I'm currently involved on a big fix of AppRun so it would take me a week or two to get to this issue. But if you want to jump into debugging and patching the code I could assist you.
Small update: this was apparently fixed in our project by defining _FILE_OFFSET_BITS=64
, _LARGEFILE_SOURCE
and _LARGEFILE64_SOURCE
on i386 builds. I'm keeping this issue open, though, as it could theoretically affect anything not compiled with 64-bit file support.
I've recently introduced AppImage packaging with appimage-builder to 86Box/86Box. While the setup I came up with works perfectly on
x86_64
,armhf
andaarch64
, I run into a consistent segfault related to widechar file operations (used to load our86box.cfg
config file) oni386
, reproduced on glibc 2.31 both provided by the system and the AppImage, and both Debug and Release versions of AppRun:The relevant
config_read
function is here (line 303). Some debugging with gdb reveals that the segfault is caused by an access tofp->_wide_data
, because theFILE
structure returned byfopen
is somehow bogus (I've had it end up in the middle of a Qt5-related string on other occasions):If the config reading code is skipped (by
86box.cfg
being absent), the config saving code (line 417) doesn't segfault, but the resulting86box.cfg
file ends up empty, because all calls tofwprintf
return-1
(with noerrno
set) due to the bogusFILE
. While debugging this issue, I recall inserting a standard non-wcharfprintf
into that code, and that did work butfwprintf
did not.All this weird file behavior doesn't happen when the 86Box binary is executed without AppRun, either directly or through a manually-generated AppImage, or with AppRun on non-
i386
architectures.