trilogy-libraries / trilogy

Trilogy is a client library for MySQL-compatible database servers, designed for performance, flexibility, and ease of embedding.
MIT License
700 stars 69 forks source link

Symbolize clang's sanitizer stacks #116

Closed javierhonduco closed 1 year ago

javierhonduco commented 1 year ago

llvm-symbolizer is needed to symbolize (convert the raw addresses to function names and line numbers) the offending stacks.

jhawthorn commented 1 year ago

Thanks for the PR! Could you clarify what problem you were seeing and what this helps? The Dockerfile is I think just for running tests/CI?

javierhonduco commented 1 year ago

Sorry I didn't add the extra context before. If a sanitizer encounters some issue, it will currently output an unsymbolized stack trace:

==214==WARNING: invalid path to external symbolizer!
==214==WARNING: Failed to use and restart external symbolizer!
    #0 0x559a1f2cb4b7  (/app/test/test+0x1614b7)
    #1 0x559a1f2c9df1  (/app/test/test+0x15fdf1)
    #2 0x559a1f2b09ce  (/app/test/test+0x1469ce)
    #3 0x559a1f2cd284  (/app/test/test+0x163284)
    #4 0x7ff53fec509a  (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #5 0x559a1f1df5a9  (/app/test/test+0x755a9)

After adding the llvm-symbolizer dependency:

==264==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5627376334b7 in greatest_memory_equal_cb (/app/test/test+0x1614b7)
    #1 0x562737631df1 in greatest_do_assert_equal_t (/app/test/test+0x15fdf1)
    #2 0x5627376189ce in build_auth_packet_test (/app/test/test+0x1469ce)
    #3 0x562737635284 in main (/app/test/test+0x163284)
    #4 0x7f04462a609a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #5 0x5627375475a9 in _start (/app/test/test+0x755a9)

Will add the above to the commit message