Appimage chdir'ing so relative paths doesn't work

probono probono at puredarwin.org
Tue Jan 10 10:17:06 PST 2017


2017-01-08 19:30 GMT+01:00 Dirk Hohndel <dirk at hohndel.org>:
>> On Jan 8, 2017, at 09:38, Anton Lundin <glance at acc.umu.se> wrote:
>> Hi.
>>
>> I was about to test some stuff with the appimage-build and noted:
>>
>> strace -e chdir,open ./Subsurface-4.6-Beta-2-x86_64.AppImage testdata/ostc4.xml |& grep -E 'ostc|chdir'
>> chdir("/tmp/.mount_xyn3Tx")             = 0
>> chdir("usr")                            = 0
>> open("testdata/ostc4.xml", O_RDONLY) = -1 ENOENT (No such file or directory)
>>
>>
>> The chdir'ing might make sense in some case, but in this case it really
>> doesn't.
>
> I think it needs to chdir in order to find its libraries, but I haven't looked
> at this in enough detail.

The chdir is required only in cases in which binaries are not
relocatable at runtime (i.e., "/usr" is hardcoded at compile time, for
example for loading resources). If this is not the case (e.g., in the
case of Subsurface), then we should get away without chdir'ing.


More information about the subsurface mailing list