Re: Clang Address Sanitizer (Postgres14) Detected Memory Leaks

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Clang Address Sanitizer (Postgres14) Detected Memory Leaks
Date: 2020-08-27 23:50:26
Message-ID: CAEudQAqt=8xrCwRiUpoD=8Uf6QYS0AkAjaaO1Fcro8htx3jERg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

More reports.
Memory Sanitizer:

running bootstrap script ... ==40179==WARNING: MemorySanitizer:
use-of-uninitialized-value
#0 0x538cfc1 in pg_comp_crc32c_sb8
/usr/src/postgres/src/port/pg_crc32c_sb8.c:80:4
#1 0x533a0c0 in pg_comp_crc32c_choose
/usr/src/postgres/src/port/pg_crc32c_sse42_choose.c:61:9
#2 0xebbdae in BootStrapXLOG
/usr/src/postgres/src/backend/access/transam/xlog.c:5293:2
#3 0xfc5867 in AuxiliaryProcessMain
/usr/src/postgres/src/backend/bootstrap/bootstrap.c:437:4
#4 0x26a12c3 in main /usr/src/postgres/src/backend/main/main.c:201:3
#5 0x7f035d0e90b2 in __libc_start_main
/build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:308:16
#6 0x495afd in _start
(/usr/src/postgres/tmp_install/usr/local/pgsql/bin/postgres+0x495afd)

Uninitialized value was stored to memory at
#0 0x538cbaa in pg_comp_crc32c_sb8
/usr/src/postgres/src/port/pg_crc32c_sb8.c:72:15
#1 0x533a0c0 in pg_comp_crc32c_choose
/usr/src/postgres/src/port/pg_crc32c_sse42_choose.c:61:9
#2 0xebbdae in BootStrapXLOG
/usr/src/postgres/src/backend/access/transam/xlog.c:5293:2
#3 0xfc5867 in AuxiliaryProcessMain
/usr/src/postgres/src/backend/bootstrap/bootstrap.c:437:4
#4 0x26a12c3 in main /usr/src/postgres/src/backend/main/main.c:201:3
#5 0x7f035d0e90b2 in __libc_start_main
/build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:308:16

Uninitialized value was stored to memory at
#0 0x538c836 in pg_comp_crc32c_sb8
/usr/src/postgres/src/port/pg_crc32c_sb8.c:57:11
#1 0x533a0c0 in pg_comp_crc32c_choose
/usr/src/postgres/src/port/pg_crc32c_sse42_choose.c:61:9
#2 0xebbdae in BootStrapXLOG
/usr/src/postgres/src/backend/access/transam/xlog.c:5293:2
#3 0xfc5867 in AuxiliaryProcessMain
/usr/src/postgres/src/backend/bootstrap/bootstrap.c:437:4
#4 0x26a12c3 in main /usr/src/postgres/src/backend/main/main.c:201:3
#5 0x7f035d0e90b2 in __libc_start_main
/build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:308:16

Uninitialized value was stored to memory at
#0 0x49b666 in __msan_memcpy
(/usr/src/postgres/tmp_install/usr/local/pgsql/bin/postgres+0x49b666)
#1 0xebbb70 in BootStrapXLOG
/usr/src/postgres/src/backend/access/transam/xlog.c:5288:2
#2 0xfc5867 in AuxiliaryProcessMain
/usr/src/postgres/src/backend/bootstrap/bootstrap.c:437:4
#3 0x26a12c3 in main /usr/src/postgres/src/backend/main/main.c:201:3
#4 0x7f035d0e90b2 in __libc_start_main
/build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:308:16

Uninitialized value was created by an allocation of 'checkPoint' in the
stack frame of function 'BootStrapXLOG'
#0 0xeb9f50 in BootStrapXLOG
/usr/src/postgres/src/backend/access/transam/xlog.c:5194

This line solve the alert:
(xlog.c) 5193:
memset(&checkPoint, 0, sizeof(checkPoint));

I'm starting to doubt this tool.

regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-08-27 23:53:23 Re: list of extended statistics on psql
Previous Message Peter Geoghegan 2020-08-27 23:47:11 Re: XMAX_LOCK_ONLY and XMAX_COMMITTED (fk/multixact code)