Re: Clang Address Sanitizer (Postgres14) Detected Memory Leaks - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Clang Address Sanitizer (Postgres14) Detected Memory Leaks
Date
Msg-id CAEudQAqt=8xrCwRiUpoD=8Uf6QYS0AkAjaaO1Fcro8htx3jERg@mail.gmail.com
Whole thread Raw
In response to Re: Clang Address Sanitizer (Postgres14) Detected Memory Leaks  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Clang Address Sanitizer (Postgres14) Detected Memory Leaks
List 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

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: XMAX_LOCK_ONLY and XMAX_COMMITTED (fk/multixact code)
Next
From: Alvaro Herrera
Date:
Subject: Re: list of extended statistics on psql