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

Asan: Parse symbol from address. #3297

Closed
winlinvip opened this issue Dec 9, 2022 · 0 comments · Fixed by #3324
Closed

Asan: Parse symbol from address. #3297

winlinvip opened this issue Dec 9, 2022 · 0 comments · Fixed by #3324
Assignees
Labels
EnglishNative This issue is conveyed exclusively in English.
Milestone

Comments

@winlinvip
Copy link
Member

winlinvip commented Dec 9, 2022

When asan error with log, there are some addresses in log (see #3241):

==14647== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60040001a919 at pc 0x6795e2 bp 0x7fdacfc34cf0 sp 0x7fdacfc34ce0
READ of size 1 at 0x60040001a919 thread T1 (srs-hybrid-2)
    #0 0x6795e1 (/usr/local/srs/trunk/objs/srs+0x6795e1)
    #1 0x67e275 (/usr/local/srs/trunk/objs/srs+0x67e275)
    #2 0x67de8a (/usr/local/srs/trunk/objs/srs+0x67de8a)
    #3 0x67d49e (/usr/local/srs/trunk/objs/srs+0x67d49e)
    #4 0x67b21c (/usr/local/srs/trunk/objs/srs+0x67b21c)
    #5 0x67a665 (/usr/local/srs/trunk/objs/srs+0x67a665)
    #6 0x7b3175 (/usr/local/srs/trunk/objs/srs+0x7b3175)
    #7 0x81faf6 (/usr/local/srs/trunk/objs/srs+0x81faf6)
    #8 0x82f7a2 (/usr/local/srs/trunk/objs/srs+0x82f7a2)
    #9 0x82eda2 (/usr/local/srs/trunk/objs/srs+0x82eda2)
    #10 0x810dc4 (/usr/local/srs/trunk/objs/srs+0x810dc4)
    #11 0x810a23 (/usr/local/srs/trunk/objs/srs+0x810a23)
    #12 0x95693c (/usr/local/srs/trunk/objs/srs+0x95693c)
    #13 0x954e4b (/usr/local/srs/trunk/objs/srs+0x954e4b)
    #14 0x9549a8 (/usr/local/srs/trunk/objs/srs+0x9549a8)
    #15 0x863955 (/usr/local/srs/trunk/objs/srs+0x863955)
    #16 0x863a0f (/usr/local/srs/trunk/objs/srs+0x863a0f)
    #17 0xa80868 (/usr/local/srs/trunk/objs/srs+0xa80868)
    #18 0xa81157 (/usr/local/srs/trunk/objs/srs+0xa81157)
    #19 0x8f6181 (/usr/local/srs/trunk/objs/srs+0x8f6181)
    #20 0x8f4aa3 (/usr/local/srs/trunk/objs/srs+0x8f4aa3)
    #21 0x60040000a0af (+0xa0af)

Which can be parsed to symbols, similar to:

void SrsCplxError::srs_assert(bool expression)
{
#if defined(SRS_BACKTRACE) && defined(__linux)
    if (!expression) {
        void* addresses[64];
        int nn_addresses = backtrace(addresses, sizeof(addresses) / sizeof(void*));
        char** symbols = backtrace_symbols(addresses, nn_addresses);

For example:

addresses[0] = 0x6795e1
addresses[1] = 0x67e275
......

We can parse the addresses from log of asan, then parse to symbols, then we don't need the binary to reply the issue.

@winlinvip winlinvip added this to the 5.0 milestone Dec 9, 2022
@winlinvip winlinvip linked a pull request Dec 18, 2022 that will close this issue
@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EnglishNative This issue is conveyed exclusively in English.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants