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

Debugging not possible using gdb or strace #1078

Open
nadav74 opened this issue Oct 22, 2019 · 4 comments
Open

Debugging not possible using gdb or strace #1078

nadav74 opened this issue Oct 22, 2019 · 4 comments

Comments

@nadav74
Copy link

nadav74 commented Oct 22, 2019

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
Copy link

nsajko commented Jan 19, 2020

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
Copy link

garloff commented Feb 27, 2021

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
Copy link

ghost commented Jul 29, 2023

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
Copy link

fuerue commented Jul 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants