-
Notifications
You must be signed in to change notification settings - Fork 10
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
Getting segfault when trying to use libapprun_hooks #7
Comments
I got a 404 when trying to download the file you reference above. Regarding your code, You still need AppRun to resolve the right ld-linux, notice that you must specify the path to the system ld-linux, and the path to the bundle ld-linux. You can inspect an AppImage packaged with appimage-builder for details. |
How is it doing that? I was suspecting that it was done by |
Tried doing so but noticed variables that I don't quite understand the meaning of yet, hence #6... ;-) |
I left some answers on #6, I'll also improve the README |
Closing it, please reopen if the problem persist. |
Here is a zipped AppDir that also segfaults for me. Possibly I am doing something wrong? https://transfersh.com/13S9o9/test.appdir.zip (available for 14 days) It was made with By the way, I get the same(?) segfault if I replace the binary
|
This comment has been minimized.
This comment has been minimized.
Hold on, I just noticed that not all of the libc-related files have been put into the correct subdirectory. I am on it in go-appimage... (Also, when I am trying to bundle Another thing I noticed: it makes a difference which one you do:
(With a mouspad AppDir I am experimenting with this even makes the difference between running the app and doing nothing at all) Apparently one needs to use
Attached is a new test AppDir in which I am using a bash https://transfersh.com/kiFQu/test-2.appdir.zip I made this using When I run this on an older system, e.g., on Ubuntu 16.04, I am getting:
So it seems like the bundled libc is not used even though it is newer than the one on the target system. I must be missing something? Ah, right, I need to add
(or so I'd assume). But as soon as I do that (in the Segmentation fault
Why is it not loading zlib from
? Actually, it seems like quite many files are tried to be loaded from the system rather than from the AppImage, which is clearly entirely wrong:
|
Once instance in which the |
As per #11 (comment), the bash |
If the system glib version is greater than the bundled one the you set if the bundled glib version is greater then set I guess that I should add this to the documentation too. Notice that you will have to bundle grep, cut and other command you use in your bash script. There will be race conditions with those commands and they dependencies. That's why I created a statically linked binary for the AppRun. |
I see. Do you understand why this AppDir fails with the statically linked binary for the AppRun? |
Hi @azubieta and @probonopd , please see my solution to this problem at: |
Wdyt @azubieta? I still think we should find a solution that removes the need to copy ld-linux to /tmp... kinda like what https://github.com/probonopd/libhookexecv does for WINE. |
Prefix ld-linux on each execve call has a nasty side effect, it makes |
On QEMU User ARM32, missing this NULL check would cause a segmentation fault. ``` (gdb) bt #0 0xfe586c20 in strchr () from /squashfs-root//opt/libc/lib/arm-linux-gnueabihf/libc.so.6 AppImageCrafters#1 0xfe79677e in find_hooked_symbol () at /home/user/Documents/mcpi/AppRun/src/common/hook_debug.c:58 AppImageCrafters#2 0xfe79543c in redirect_path_full (pathname=0xfe796a84 "/proc/self/exe", check_parent=0, only_if_absolute=0) at /home/user/Documents/mcpi/AppRun/src/hooks/redirect_path.c:90 AppImageCrafters#3 0xfe795642 in apprun_redirect_path (pathname=0xfe796a84 "/proc/self/exe") at /home/user/Documents/mcpi/AppRun/src/hooks/redirect_path.c:159 AppImageCrafters#4 0xfe7952a8 in realpath (name=0xfe796a84 "/proc/self/exe", resolved=0xfefd3814 "") at /home/user/Documents/mcpi/AppRun/src/hooks/hooks.c:490 AppImageCrafters#5 0xfe793fe4 in apprun_main_hook (argc=1, argv=0xfefd49c4, envp=0xfefd49cc) at /home/user/Documents/mcpi/AppRun/src/hooks/main_hook.c:24 AppImageCrafters#6 0xfe543a20 in __libc_start_main () from /squashfs-root//opt/libc/lib/arm-linux-gnueabihf/libc.so.6 AppImageCrafters#7 0xfe794100 in __libc_start_main (main=0xfefd76e1 <main>, argc=1, argv=0xfefd49c4, init=0xfefdc341 <__libc_csu_init>, fini=0xfefdc381 <__libc_csu_fini>, rtld_fini=0xfe7b6075, stack_end=0xfefd49c4) at /home/user/Documents/mcpi/AppRun/src/hooks/main_hook.c:60 AppImageCrafters#8 0xfefd7e24 in _start () ```
On QEMU User ARM32, missing this NULL check would cause a segmentation fault. ``` (gdb) bt #0 0xfe586c20 in strchr () from /squashfs-root//opt/libc/lib/arm-linux-gnueabihf/libc.so.6 #1 0xfe79677e in find_hooked_symbol () at /home/user/Documents/mcpi/AppRun/src/common/hook_debug.c:58 #2 0xfe79543c in redirect_path_full (pathname=0xfe796a84 "/proc/self/exe", check_parent=0, only_if_absolute=0) at /home/user/Documents/mcpi/AppRun/src/hooks/redirect_path.c:90 #3 0xfe795642 in apprun_redirect_path (pathname=0xfe796a84 "/proc/self/exe") at /home/user/Documents/mcpi/AppRun/src/hooks/redirect_path.c:159 #4 0xfe7952a8 in realpath (name=0xfe796a84 "/proc/self/exe", resolved=0xfefd3814 "") at /home/user/Documents/mcpi/AppRun/src/hooks/hooks.c:490 #5 0xfe793fe4 in apprun_main_hook (argc=1, argv=0xfefd49c4, envp=0xfefd49cc) at /home/user/Documents/mcpi/AppRun/src/hooks/main_hook.c:24 #6 0xfe543a20 in __libc_start_main () from /squashfs-root//opt/libc/lib/arm-linux-gnueabihf/libc.so.6 #7 0xfe794100 in __libc_start_main (main=0xfefd76e1 <main>, argc=1, argv=0xfefd49c4, init=0xfefdc341 <__libc_csu_init>, fini=0xfefdc381 <__libc_csu_fini>, rtld_fini=0xfe7b6075, stack_end=0xfefd49c4) at /home/user/Documents/mcpi/AppRun/src/hooks/main_hook.c:60 #8 0xfefd7e24 in _start () ```
In an effort to solve probonopd/go-appimage#49, I was trying to use
libapprun_hooks.so
with an existing AppImage.To reproduce:
Result:
What am I doing wrong?
The text was updated successfully, but these errors were encountered: