CypherpunkArmory / UserLAnd

Main UserLAnd Repository
Other
3.58k stars 393 forks source link

Debugging not possible using gdb or strace #1078

Open nadav74 opened 5 years ago

nadav74 commented 5 years ago

Describe the bug

Installing strace & gdb on Ubuntu 18.04: the debugging tools are not working: results with errno=EFAULT and error 182.

Steps to reproduce the behavior:

  1. On the terminal: $ sudo apt install strace gdb $ strace strace execve("/usr/bin/strace", ["strace"], 0xsome_address / ... /) = -1 EFAULT (Bad address) exit(182) $

Expected result: on my Linux PC this outputs a few full screens

  1. Compile a small "hello world" program. On the terminal, try to debug it with gdb: $ gdb ./main ... (gdb) break main Breakpoint 1 at 0xaddress: file main.c, line 5. (gdb) r Starting program: ... During startup program exited with code 182. (gdb)

Expected result: program should stop at line 5.

Screenshots

Screenshot_20191022-234729

Device Information

Device: Samsung Galaxy Tab S2 Android Version: 7.0 UserLAnd Version: 2.6.3 Whether the device is rooted: No Whether the device is running LineageOS: No, stock ROM

and: Device: Samsung Galaxy S10+ Android Version: Android Q OneUI 2 beta (but would probably also happen on Pie) UserLAnd Version: 2.6.3 Whether the device is rooted: No Whether the device is running LineageOS: No

Also mentioned in #525. Also mentioned here.

nsajko commented 4 years ago

The same happens to me on UserLAnd's Archlinux, and it is quite a pain because it prevents me from debugging a more important UserLAnd-related failure.

For what it is worth, this is what the execve manual page says about EFAULT:

pathname or one of the pointers in the vectors argv or envp points outside your accessible address space.

garloff commented 3 years ago

I unfortunately experience the same issue. ptrace seems to not work with USerLand on Android 11 here (also testing with arch Linux). So strace, gdb, valgrind all fail with error 182.

ghost commented 1 year ago

I unfortunately experience the same issue. ptrace seems to not work with USerLand on Android 11 here (also testing with arch Linux). So strace, gdb, valgrind all fail with error 182.

Well so much for debugging bare metal programs while I don't have my laptop. This seems to affect Android 11+

fuerue commented 1 year ago

Why am I cc on these emails could these emails being sent to me possibly be the issue your having with your application?

On Sat, Jul 29, 2023, 5:33 PM ToyOS-project @.***> wrote:

I unfortunately experience the same issue. ptrace seems to not work with USerLand on Android 11 here (also testing with arch Linux). So strace, gdb, valgrind all fail with error 182.

Well so much for debugging bare metal programs while I don't have my laptop. This seems to affect Android 11+

— Reply to this email directly, view it on GitHub https://github.com/CypherpunkArmory/UserLAnd/issues/1078#issuecomment-1656909916, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXVNZNJ3CIE74GQOGHQBGQDXSV6ULANCNFSM4JDYOPDQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>