[New-bugs-announce] [issue46887] ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i'

STINNER Victor report at bugs.python.org
Tue Mar 1 04:38:30 EST 2022


New submission from STINNER Victor <vstinner at python.org>:

"./Programs/_freeze_module zipimport" fails with MSAN:
---
$ make SHELL="bash -x"
(...)
+ ./Programs/_freeze_module zipimport ./Lib/zipimport.py Python/frozen_modules/zipimport.h
==110524==WARNING: MemorySanitizer: use-of-uninitialized-value
==110523==WARNING: MemorySanitizer: use-of-uninitialized-value
==110526==WARNING: MemorySanitizer: use-of-uninitialized-value
==110525==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x4b8cfc in read_text /home/vstinner/python/main/Programs/_freeze_module.c:109:9
    #1 0x4b8cfc in main /home/vstinner/python/main/Programs/_freeze_module.c:224:24
    #2 0x7fe8acb8555f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #3 0x7fe8acb8560b in __libc_start_main at GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b)
    #4 0x435f44 in _start (/home/vstinner/python/main/Programs/_freeze_module+0x435f44)

  Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main'
    #0 0x4b72e0 in main /home/vstinner/python/main/Programs/_freeze_module.c:205

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/vstinner/python/main/Programs/_freeze_module.c:109:9 in read_text
Exiting
make: *** [Makefile:1184: Python/frozen_modules/importlib._bootstrap_external.h] Error 1
make: *** Waiting for unfinished jobs....
    #0 0x4b8cfc in read_text /home/vstinner/python/main/Programs/_freeze_module.c:109:9
    #1 0x4b8cfc in main /home/vstinner/python/main/Programs/_freeze_module.c:224:24
    #2 0x7f64ecd1355f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #3 0x7f64ecd1360b in __libc_start_main at GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b)
    #4 0x435f44 in _start (/home/vstinner/python/main/Programs/_freeze_module+0x435f44)

  Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main'
    #0 0x4b72e0 in main /home/vstinner/python/main/Programs/_freeze_module.c:205

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/vstinner/python/main/Programs/_freeze_module.c:109:9 in read_text
Exiting
make: *** [Makefile:1176: Python/frozen_modules/getpath.h] Error 1
    #0 0x4b8cfc in read_text /home/vstinner/python/main/Programs/_freeze_module.c:109:9
    #1 0x4b8cfc in main /home/vstinner/python/main/Programs/_freeze_module.c:224:24
    #2 0x7fb2a178d55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #3 0x7fb2a178d60b in __libc_start_main at GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b)
    #4 0x435f44 in _start (/home/vstinner/python/main/Programs/_freeze_module+0x435f44)

    #0 0x4b8cfc in read_text /home/vstinner/python/main/Programs/_freeze_module.c:109:9
    #1 0x4b8cfc in main /home/vstinner/python/main/Programs/_freeze_module.c:224:24
    #2 0x7f4d471ca55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #3 0x7f4d471ca60b in __libc_start_main at GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b)
    #4 0x435f44 in _start (/home/vstinner/python/main/Programs/_freeze_module+0x435f44)

  Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main'
  Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main'
    #0 0x4b72e0 in main /home/vstinner/python/main/Programs/_freeze_module.c:205

    #0 0x4b72e0 in main /home/vstinner/python/main/Programs/_freeze_module.c:205

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/vstinner/python/main/Programs/_freeze_module.c:109:9 in read_text
SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/vstinner/python/main/Programs/_freeze_module.c:109:9 in read_text
Exiting
Exiting
make: *** [Makefile:1181: Python/frozen_modules/importlib._bootstrap.h] Error 1
make: *** [Makefile:1187: Python/frozen_modules/zipimport.h] Error 1
---

Build Python with clang MSAN:
---
./configure --with-pydebug --with-memory-sanitizer CC=clang LD=clang
make
---

----------
components: Build
messages: 414249
nosy: vstinner
priority: normal
severity: normal
status: open
title: ./Programs/_freeze_module fails with MSAN: Uninitialized value was created by an allocation of 'stat.i'
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46887>
_______________________________________


More information about the New-bugs-announce mailing list