Skip to content

[BUG] wrap.sh prevents debugger from attaching #933

@polishcode

Description

@polishcode

NDK latest version (19.2.5345600)
gradle/externalNativeBuild/ndkBuild
host OS: Windows 10
compiler: clang
abi checked: arm*, x86*
stl c++_shared
NDK API level 26
device API level: 26-28 (emulator, Nexus 5X)
ASAN used with build + wrap.sh bundled

When wrap.sh is bundled with the apk, the AS debugger (native)/adb does not see any debuggable processes on the device. Therefore no debugging session can be started.

When wrap.sh is not bundled with the apk (just libclang_rt.asan-*.so), debugging session starts with no problem.

I use standard contents (generated by ndk-build) for wrap.sh:

#!/system/bin/sh
HERE="$(cd "$(dirname "$0")" && pwd)"
export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1
export LD_PRELOAD=$HERE/libclang_rt.asan-i686-android.so
$@

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions