Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APPRUN_ERROR: No such file or directory #272

Closed
carlonluca opened this issue Nov 3, 2022 · 11 comments · Fixed by #283 or viam-modules/viam-camera-realsense#6
Closed

APPRUN_ERROR: No such file or directory #272

carlonluca opened this issue Nov 3, 2022 · 11 comments · Fixed by #283 or viam-modules/viam-camera-realsense#6

Comments

@carlonluca
Copy link
Contributor

I'm having a problem very similar to #148; when running the appimage I get:

APPRUN_ERROR: No such file or directory

The problem only appears on arm64, the x64 appimage works properly. As said in #148, I mounted the appimage and this is what I see in the env file:

APPDIR_EXEC_PATH=$APPDIR/usr/bin/procweb-qt

and in fact it is there:

file usr/bin/procweb-qt
usr/bin/procweb-qt: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter lib/ld-linux-aarch64.so.1, BuildID[sha1]=5570c8568939fa5570ecf5ede3982e7b88d28867, for GNU/Linux 3.7.0, not stripped

Is the relative path for the interpreter correct? Can this be caused by a missing dependency?

This is the first time I use appimage-builder, so I do not fully understand how it works yet. My project is however open source, so this is the recipe I built: https://github.com/carlonluca/procweb/blob/master/appimage-builder/AppImageBuilder_aarch64.yml.

Any idea how I could debug further? Thanks!

@goldstar611
Copy link
Contributor

I noticed in your x64 yml you have deb [arch=amd64] http:// in the source lines. If you change
deb http://
to
deb [arch=arm64] http://

does that help? I wonder if non-arm64 binaries are inside the appimage.

@goldstar611
Copy link
Contributor

I had a quick moment to run the AppImageBuilder tool against your yml file (but not enough time to compile your project). Assuming your project is compiled correctly, I can see one large issue with the architecture of AppRun, which appears to be x86_64:

~/Desktop/UntitledFolder/AppDir $ find . -type f -executable -exec file {} \;

...
./AppRun: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=b33b58c29edac92944e344dc47324f896ae2f3fe, not stripped

@carlonluca
Copy link
Contributor Author

Hello,
if I mount my appimage I get:

/tmp/.mount_procwe7C6j7n $ file AppRun
AppRun: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=db3c30272ec045e00c179e753dda3fb03ad699f7, not stripped

by running the same command you used I can only see aarch64 libraries. I can make it explicit to use arm64 repos, but libs installed from the repos seem to be for the aarch64 arch.

@goldstar611
Copy link
Contributor

How about if you use the strace program to see which file is attempting to be accessed that produces the ENOENT (not found) error. This would be my next step.

@carlonluca
Copy link
Contributor Author

Unfortunately I did that but I did not get much more info:

chdir("/tmp/.mount_procwengdYOC/runtime/compat") = 0
execve("/tmp/.mount_procwengdYOC/usr/bin/procweb-qt", ["/tmp/.mount_procwengdYOC/usr/bin"...], 0x394e2af0 /* 71 vars */) = -1 ENOENT (No such file or directory)
write(2, "APPRUN_ERROR: No such file or di"..., 39APPRUN_ERROR: No such file or directory) = 39
exit_group(1)                           = ?
+++ exited with 1 +++

@carlonluca
Copy link
Contributor Author

carlonluca commented Nov 15, 2022

It is probably something done to the binary by appimage-builder itself. When I copy the binary into the AppDir directory and appimage-builder is executed, the md5 of the binary changes. The new binary stops working and returns the same error of the appimage:

# AppDir/usr/bin/procweb-qt 
bash: AppDir/usr/bin/procweb-qt: No such file or directory

The original binary was working instead.

This is what changes in the elf:

70c70
<        0000000000000260  0000000000000010  WA       6     0     8
---
>        0000000000000220  0000000000000010  WA       6     0     8
102c102
<       [Requesting program interpreter: /lib/ld-linux-aarch64.so.1]
---
>       [Requesting program interpreter: lib/ld-linux-aarch64.so.1]
108c108
<                  0x0000000000000260 0x0000000000000260  RW     0x8
---
>                  0x0000000000000220 0x0000000000000220  RW     0x8
455,456c455,456
<      1: 0000000000004480     0 SECTION LOCAL  DEFAULT   11 .init
<      2: 000000000007b000     0 SECTION LOCAL  DEFAULT   24 .data
---
>      1: 0000000000004480     0 SECTION LOCAL  DEFAULT   11 
>      2: 000000000007b000     0 SECTION LOCAL  DEFAULT   24 
623,649c623,649
<      1: 0000000000000238     0 SECTION LOCAL  DEFAULT    1 .interp
<      2: 0000000000000254     0 SECTION LOCAL  DEFAULT    2 .note.gnu.build-id
<      3: 0000000000000278     0 SECTION LOCAL  DEFAULT    3 .note.ABI-tag
<      4: 0000000000000298     0 SECTION LOCAL  DEFAULT    4 .gnu.hash
<      5: 00000000000002b8     0 SECTION LOCAL  DEFAULT    5 .dynsym
<      6: 0000000000001230     0 SECTION LOCAL  DEFAULT    6 .dynstr
<      7: 000000000000280c     0 SECTION LOCAL  DEFAULT    7 .gnu.version
<      8: 0000000000002958     0 SECTION LOCAL  DEFAULT    8 .gnu.version_r
<      9: 0000000000002a88     0 SECTION LOCAL  DEFAULT    9 .rela.dyn
<     10: 0000000000003700     0 SECTION LOCAL  DEFAULT   10 .rela.plt
<     11: 0000000000004480     0 SECTION LOCAL  DEFAULT   11 .init
<     12: 00000000000044a0     0 SECTION LOCAL  DEFAULT   12 .plt
<     13: 0000000000004dc0     0 SECTION LOCAL  DEFAULT   13 .text
<     14: 000000000000b350     0 SECTION LOCAL  DEFAULT   14 .fini
<     15: 000000000000b370     0 SECTION LOCAL  DEFAULT   15 .rodata
<     16: 0000000000068b14     0 SECTION LOCAL  DEFAULT   16 .eh_frame_hdr
<     17: 0000000000068dc8     0 SECTION LOCAL  DEFAULT   17 .eh_frame
<     18: 0000000000069cac     0 SECTION LOCAL  DEFAULT   18 .gcc_except_table
<     19: 000000000007a4a0     0 SECTION LOCAL  DEFAULT   19 .init_array
<     20: 000000000007a4b8     0 SECTION LOCAL  DEFAULT   20 .fini_array
<     21: 000000000007a4c0     0 SECTION LOCAL  DEFAULT   21 .data.rel.ro
<     22: 000000000007a848     0 SECTION LOCAL  DEFAULT   22 .dynamic
<     23: 000000000007aaa8     0 SECTION LOCAL  DEFAULT   23 .got
<     24: 000000000007b000     0 SECTION LOCAL  DEFAULT   24 .data
<     25: 000000000007b1d8     0 SECTION LOCAL  DEFAULT   25 .qtversion
<     26: 000000000007b1e8     0 SECTION LOCAL  DEFAULT   26 .bss
<     27: 0000000000000000     0 SECTION LOCAL  DEFAULT   27 .comment
---
>      1: 0000000000000238     0 SECTION LOCAL  DEFAULT    1 
>      2: 0000000000000254     0 SECTION LOCAL  DEFAULT    2 
>      3: 0000000000000278     0 SECTION LOCAL  DEFAULT    3 
>      4: 0000000000000298     0 SECTION LOCAL  DEFAULT    4 
>      5: 00000000000002b8     0 SECTION LOCAL  DEFAULT    5 
>      6: 0000000000001230     0 SECTION LOCAL  DEFAULT    6 
>      7: 000000000000280c     0 SECTION LOCAL  DEFAULT    7 
>      8: 0000000000002958     0 SECTION LOCAL  DEFAULT    8 
>      9: 0000000000002a88     0 SECTION LOCAL  DEFAULT    9 
>     10: 0000000000003700     0 SECTION LOCAL  DEFAULT   10 
>     11: 0000000000004480     0 SECTION LOCAL  DEFAULT   11 
>     12: 00000000000044a0     0 SECTION LOCAL  DEFAULT   12 
>     13: 0000000000004dc0     0 SECTION LOCAL  DEFAULT   13 
>     14: 000000000000b350     0 SECTION LOCAL  DEFAULT   14 
>     15: 000000000000b370     0 SECTION LOCAL  DEFAULT   15 
>     16: 0000000000068b14     0 SECTION LOCAL  DEFAULT   16 
>     17: 0000000000068dc8     0 SECTION LOCAL  DEFAULT   17 
>     18: 0000000000069cac     0 SECTION LOCAL  DEFAULT   18 
>     19: 000000000007a4a0     0 SECTION LOCAL  DEFAULT   19 
>     20: 000000000007a4b8     0 SECTION LOCAL  DEFAULT   20 
>     21: 000000000007a4c0     0 SECTION LOCAL  DEFAULT   21 
>     22: 000000000007a848     0 SECTION LOCAL  DEFAULT   22 
>     23: 000000000007aaa8     0 SECTION LOCAL  DEFAULT   23 
>     24: 000000000007b000     0 SECTION LOCAL  DEFAULT   24 
>     25: 000000000007b1d8     0 SECTION LOCAL  DEFAULT   25 
>     26: 000000000007b1e8     0 SECTION LOCAL  DEFAULT   26 
>     27: 0000000000000000     0 SECTION LOCAL  DEFAULT   27

init, data and other sections are lost it seems. Is this expected?

@JohnXLivingston
Copy link

As mentionned by @carlonluca , it seems to be the same issue than #278
In #278 , the problem occurs using an official documented config file (bash AppImage), by just replacing the repository: amd64 => aarch64.

@goldstar611
Copy link
Contributor

goldstar611 commented Dec 13, 2022

<       [Requesting program interpreter: /lib/ld-linux-aarch64.so.1]
                                         ^
---
>       [Requesting program interpreter: lib/ld-linux-aarch64.so.1]
                                         ^

I wonder if this is an "off by one" error or intentional. I can understand the reasoning for using a relative path to ld-linux but it seems suspicious to me.

Does the resulting AppDir have a lib/ld-linux-aarch64.so.1 file in it?

@carlonluca
Copy link
Contributor Author

Yes, I noticed that, but I suspect that is expected. This is inside the AppDir:

./AppDir/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1
./AppDir/lib/ld-linux-aarch64.so.1
./AppDir/runtime/default/lib/ld-linux-aarch64.so.1

and also it seems on x64 the change is identical:

<       [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
---
>       [Requesting program interpreter: lib64/ld-linux-x86-64.so.2]

Missing init and data section is also suspect.

@goldstar611
Copy link
Contributor

Are the sections actually missing or did the names get stripped? I'm not familiar with either ELF format basics or stripping of ELF files.

@carlonluca
Copy link
Contributor Author

carlonluca commented Dec 14, 2022

Unfortunately I do not have an answer to this. I guess the names are stripped, not sure if this is a problem or not. However, the fact that the binary cannot be even started seems to suggest there is a problem very early in the process.

carlonluca added a commit to carlonluca/appimage-builder that referenced this issue Dec 20, 2022
Without the aarch64 linux interpreter in the patterns, the interpreter
is not placed under the runtime/compat directory. This fixes AppImageCrafters#272.
azubieta pushed a commit that referenced this issue Dec 21, 2022
Without the aarch64 linux interpreter in the patterns, the interpreter
is not placed under the runtime/compat directory. This fixes #272.
azubieta pushed a commit that referenced this issue Mar 29, 2023
Add armhf to the list like in #283
abe-winter added a commit to viam-modules/viam-camera-realsense that referenced this issue Aug 15, 2023
abe-winter added a commit to viam-modules/viam-camera-realsense that referenced this issue Aug 15, 2023
* meta.json, upload-module step

* tweak appimage-tag to run in branch (without uploading)

* Revert "tweak appimage-tag to run in branch (without uploading)"

This reverts commit c73a5c0.

* explicitly bundle ref name

* bugfix: z flag to fix 'unknown content-type for package'

* tweak to run in branch (no gcp upload)

* Revert "tweak to run in branch (no gcp upload)"

This reverts commit 7e87e7b.

* module private -> public

* detect release / continuous mode in version

* run in branch mode

* check for aix

* Revert "check for aix"

This reverts commit c94da59.

* try static build of aix to solve apprun error

* try without aix wrapper

* try including bash

* try bumping canon min date

* build docker on non-main branch (tmp)

* actually build docker on non-main

* reduce parallelism on viam-sdk to solve oom

* par back to j8, larger box, add missing packages.write permission

* revert docker in branch changes from 24949e3 7ab5df3

* use latest appimage-builder to fix AppImageCrafters/appimage-builder#272

* build docker in branch

* add back --break-system-packages

* Revert "build docker in branch"

This reverts commit 3fb012a.

* target canon image with working appimage-builder

* revert changes to appimage recipe

* Revert "run in branch mode"

This reverts commit 4b13f7e.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants