MemorySanitizer blacklist in clang not working with third party library?

I cannot figure out how to get the blacklist in clang to work on a third party library. Specifically I am having trouble with libpq.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Uninitialized bytes in __interceptor_getaddrinfo at offset 9 inside [0x701000000110, 10)
==32548==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x7faf417cd527 in PQconnectPoll (/lib/x86_64-linux-gnu/libpq.so.5+0x11527)
#1 0x7faf417cea22 (/lib/x86_64-linux-gnu/libpq.so.5+0x12a22)
#2 0x7faf417d204b in PQconnectStart (/lib/x86_64-linux-gnu/libpq.so.5+0x1604b)
#3 0x7faf417d2082 in PQconnectdb (/lib/x86_64-linux-gnu/libpq.so.5+0x16082)
#4 0x4d3432 in main /src/core.c:340:10
#5 0x7faf4134e082 in __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:308:16
#6 0x41d7cd in _start (/bin/client+0x41d7cd)
Uninitialized value was created by a heap allocation
#0 0x4299ad in malloc (/bin/client+0x4299ad)
#1 0x7faf417cabe8 (/lib/x86_64-linux-gnu/libpq.so.5+0xebe8)
#2 0x7faf417d0675 (/lib/x86_64-linux-gnu/libpq.so.5+0x14675)
#3 0x7faf417d203f in PQconnectStart (/lib/x86_64-linux-gnu/libpq.so.5+0x1603f)
#4 0x7faf417d2082 in PQconnectdb (/lib/x86_64-linux-gnu/libpq.so.5+0x16082)
#5 0x4d3432 in main /src/core.c:340:10
#6 0x7faf4134e082 in __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:308:16
SUMMARY: MemorySanitizer: use-of-uninitialized-value (/lib/x86_64-linux-gnu/libpq.so.5+0x11527) in PQconnectPoll
Exiting
</code>
<code>Uninitialized bytes in __interceptor_getaddrinfo at offset 9 inside [0x701000000110, 10) ==32548==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x7faf417cd527 in PQconnectPoll (/lib/x86_64-linux-gnu/libpq.so.5+0x11527) #1 0x7faf417cea22 (/lib/x86_64-linux-gnu/libpq.so.5+0x12a22) #2 0x7faf417d204b in PQconnectStart (/lib/x86_64-linux-gnu/libpq.so.5+0x1604b) #3 0x7faf417d2082 in PQconnectdb (/lib/x86_64-linux-gnu/libpq.so.5+0x16082) #4 0x4d3432 in main /src/core.c:340:10 #5 0x7faf4134e082 in __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:308:16 #6 0x41d7cd in _start (/bin/client+0x41d7cd) Uninitialized value was created by a heap allocation #0 0x4299ad in malloc (/bin/client+0x4299ad) #1 0x7faf417cabe8 (/lib/x86_64-linux-gnu/libpq.so.5+0xebe8) #2 0x7faf417d0675 (/lib/x86_64-linux-gnu/libpq.so.5+0x14675) #3 0x7faf417d203f in PQconnectStart (/lib/x86_64-linux-gnu/libpq.so.5+0x1603f) #4 0x7faf417d2082 in PQconnectdb (/lib/x86_64-linux-gnu/libpq.so.5+0x16082) #5 0x4d3432 in main /src/core.c:340:10 #6 0x7faf4134e082 in __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:308:16 SUMMARY: MemorySanitizer: use-of-uninitialized-value (/lib/x86_64-linux-gnu/libpq.so.5+0x11527) in PQconnectPoll Exiting </code>
Uninitialized bytes in __interceptor_getaddrinfo at offset 9 inside [0x701000000110, 10)
==32548==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7faf417cd527 in PQconnectPoll (/lib/x86_64-linux-gnu/libpq.so.5+0x11527)
    #1 0x7faf417cea22  (/lib/x86_64-linux-gnu/libpq.so.5+0x12a22)
    #2 0x7faf417d204b in PQconnectStart (/lib/x86_64-linux-gnu/libpq.so.5+0x1604b)
    #3 0x7faf417d2082 in PQconnectdb (/lib/x86_64-linux-gnu/libpq.so.5+0x16082)
    #4 0x4d3432 in main /src/core.c:340:10
    #5 0x7faf4134e082 in __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:308:16
    #6 0x41d7cd in _start (/bin/client+0x41d7cd)

  Uninitialized value was created by a heap allocation
    #0 0x4299ad in malloc (/bin/client+0x4299ad)
    #1 0x7faf417cabe8  (/lib/x86_64-linux-gnu/libpq.so.5+0xebe8)
    #2 0x7faf417d0675  (/lib/x86_64-linux-gnu/libpq.so.5+0x14675)
    #3 0x7faf417d203f in PQconnectStart (/lib/x86_64-linux-gnu/libpq.so.5+0x1603f)
    #4 0x7faf417d2082 in PQconnectdb (/lib/x86_64-linux-gnu/libpq.so.5+0x16082)
    #5 0x4d3432 in main /src/core.c:340:10
    #6 0x7faf4134e082 in __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:308:16

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/lib/x86_64-linux-gnu/libpq.so.5+0x11527) in PQconnectPoll
Exiting

According to the output summary, there is an unitialized value in libpq in the PQconnectPoll. How do I ignore that?

My blacklist:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>fun:*PQconnectdb*
fun:*PQconnectPoll*
fun:*PQconnectStart*
src:*libpq*
</code>
<code>fun:*PQconnectdb* fun:*PQconnectPoll* fun:*PQconnectStart* src:*libpq* </code>
fun:*PQconnectdb*
fun:*PQconnectPoll*
fun:*PQconnectStart*
src:*libpq*

My compile flags:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>-g -O0 -Wall -pedantic -Werror -DDEBUG -Wno-missing-braces -fsanitize=memory -fno-omit-frame-pointer -fsanitize-memory-track-origins -fsanitize-blacklist=$(.CURDIR)/blist.txt
</code>
<code>-g -O0 -Wall -pedantic -Werror -DDEBUG -Wno-missing-braces -fsanitize=memory -fno-omit-frame-pointer -fsanitize-memory-track-origins -fsanitize-blacklist=$(.CURDIR)/blist.txt </code>
-g -O0 -Wall -pedantic -Werror -DDEBUG -Wno-missing-braces -fsanitize=memory -fno-omit-frame-pointer -fsanitize-memory-track-origins -fsanitize-blacklist=$(.CURDIR)/blist.txt

Those flags are being added to both compiling the individual objects and when linking them together.

If I remove -Werror and create an unitialized condition at the beginning of main I can see this error. If I then add fun:main to my blacklist it will properly skip. So the blacklist is working with my code, but not the third party library.

This said it could be because of mangled names, which is why I used the wild card. nm does not work on a library.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật