Skip to content

I am not getting any backtrace with ASAN  #1111

Closed
@sarora5

Description

@sarora5

I am using wrap.sh script method to enable ASAN on my Android App, however I am not seeing any backtrace for a crash.

My Wrap.sh Script :

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

Compiler flags:

_ASAN_COMPILER_FLAGS = [
"-g",
"-O1",
"-fno-omit-frame-pointer",
"-fsanitize=address",
"-fsanitize-address-use-after-scope",
"-Wno-unknown-sanitizers",

Pixel 2 device
App is 32 bit.
It works perfectly on x86_64 emulator, Problem is only with real Devices.
NDK : 15
Clang 7
Tried ASAN lib from pixel device and NDK 18 too

06-21 13:26:16.508 18780 18780 I wrap.sh : ==18783==T47: stack [0x9eafd000,0x9ec02970) size 0x105970; local=0x9ec028e8
06-21 13:26:16.509 18780 18780 I wrap.sh : ==18783==T47 TSDDtor
06-21 13:26:16.509 18780 18780 I wrap.sh : ==18783==T47 exited
06-21 13:26:16.509 18780 18780 I wrap.sh : ==18783==T48: stack [0xa1363000,0xa1468970) size 0x105970; local=0xa14688e8
06-21 13:26:16.509 18783 18821 I [32:SchedSingleThreadExec]LiteJobSchedulerDetailAnalytics: schedule execution on JobSchedulerCompat with delay interval 0-1 ms for conditions 0, isForced: false
06-21 13:26:16.510 18783 18827 D [37:Foreground task #]MLiteTypingManagerClient: initialize
06-21 13:26:16.512 18783 18822 E SQLiteLog: (1) no such table: library_metadata in "SELECT value FROM library_metadata WHERE key = ?"
06-21 13:26:16.522 18780 18780 I wrap.sh : ==18783==T49: stack [0xa125d000,0xa1362970) size 0x105970; local=0xa13628e8
06-21 13:26:16.523 18780 18780 I wrap.sh : ==18783==T49 TSDDtor
06-21 13:26:16.523 18780 18780 I wrap.sh : ==18783==T49 exited
06-21 13:26:16.535 18783 18783 D [2:main]AppStateLoggerCore: Activity com.xxxx.coreui.view.MainActivity changed state to Created
06-21 13:26:16.541 18783 18783 D [2:main]Login: We are currently logged in - Fast finish
06-21 13:26:16.541 18780 18780 I wrap.sh : ==18783==T50: stack [0xa125d000,0xa1362970) size 0x105970; local=0xa13628e8
06-21 13:26:16.543 18780 18780 I wrap.sh : ==18783==T51: stack [0x9eafd000,0x9ec02970) size 0x105970; local=0x9ec028e8
06-21 13:26:16.544 18780 18780 I wrap.sh : ==18783==T52: stack [0x9cef4000,0x9cff9970) size 0x105970; local=0x9cff98e8
102.058ms
06-21 13:26:16.649 18780 18780 I wrap.sh : ==18783==T53: stack [0xb2c02000,0xb2cff970) size 0xfd970; local=0xb2cff8e8
06-21 13:26:16.649 18780 18780 I wrap.sh : ==18783==T54: stack [0x9cdee000,0x9cef3970) size 0x105970; local=0x9cef38e8
06-21 13:26:16.650 18780 18780 I wrap.sh : ==18783==T55: stack [0x9cce8000,0x9cded970) size 0x105970; local=0x9cded8e8
06-21 13:26:16.651 18783 18852 I [58:MqttConnectionHandler]MqttnanoClient: mqtt-connect-attempt
06-21 13:26:16.652 18783 18827 D [37:Foreground task #]MqttnanoClient: network-connected-event/mqtt-connect-attempt-in-100-ms
06-21 13:26:16.653 18783 18827 D [37:Foreground task #]MqttnanoClient: pub-sub-service/app-foreground-state/background
06-21 13:26:16.657 18780 18780 I wrap.sh : AddressSanitizer:DEADLYSIGNAL
06-21 13:26:16.657 18780 18780 I wrap.sh : =================================================================
06-21 13:26:16.657 18780 18780 I wrap.sh : ==18783==ERROR: AddressSanitizer: SEGV on unknown address 0x00000010 (pc 0xb32b10d8 bp 0x00000002 sp 0x9f6f6188 T29)
06-21 13:26:16.657 18780 18780 I wrap.sh : ==18783==The signal is caused by a READ memory access.
06-21 13:26:16.657 18780 18780 I wrap.sh : ==18783==Hint: address points to the zero page.
06-21 13:26:16.657 18783 18852 D [58:MqttConnectionHandler]MqttConnection: Connecting to 'mqtt-latest.xxx.com:443' SSL ? true
06-21 13:26:16.676 18783 18822 W appstatelogger: The status has been written to the FD

Activity

eugenis

eugenis commented on Jun 21, 2019

@eugenis
Contributor
sarora5

sarora5 commented on Jul 16, 2019

@sarora5
Author

It improved after this option. Thanks for help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @eugenis@sarora5

        Issue actions

          I am not getting any backtrace with ASAN · Issue #1111 · google/sanitizers