Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIFuzz CI: segfault during Python build #116899

Closed
vstinner opened this issue Mar 16, 2024 · 1 comment
Closed

CIFuzz CI: segfault during Python build #116899

vstinner opened this issue Mar 16, 2024 · 1 comment

Comments

@vstinner
Copy link
Member

./Programs/_freeze_module importlib._bootstrap_external ./Lib/importlib/_bootstrap_external.py Python/frozen_modules/importlib._bootstrap_external.h
Segmentation fault (core dumped)
make: *** [Makefile:1660: Python/frozen_modules/importlib._bootstrap_external.h] Error 139

When I tried to reproduce in an Ubuntu 22.04 container, I get the errors:

root@ubuntu-dev:/cpython# make -j4 SHELL="bash -x"
(...)
./Programs/_freeze_module getpath ./Modules/getpath.py Python/frozen_modules/getpath.h
==11165==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55d06e6084c0 in read_text /cpython/Programs/_freeze_module.c:109:9
    #1 0x55d06e6084c0 in main /cpython/Programs/_freeze_module.c:225:24
    #2 0x7f1097f42d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: c289da5071a3399de893d2af81d6a30c62646e1e)
    #3 0x7f1097f42e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: c289da5071a3399de893d2af81d6a30c62646e1e)
    #4 0x55d06e580f34 in _start (/cpython/Programs/_freeze_module+0x85f34) (BuildId: f91c6a29210dc0cd457ac4d39f134316a9608c08)

  Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main'
    #0 0x55d06e606f60 in main /cpython/Programs/_freeze_module.c:206

SUMMARY: MemorySanitizer: use-of-uninitialized-value /cpython/Programs/_freeze_module.c:109:9 in read_text
==11165==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55d06e6084cd in read_text /cpython/Programs/_freeze_module.c:116:21
    #1 0x55d06e6084cd in main /cpython/Programs/_freeze_module.c:225:24
    #2 0x7f1097f42d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: c289da5071a3399de893d2af81d6a30c62646e1e)
    #3 0x7f1097f42e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: c289da5071a3399de893d2af81d6a30c62646e1e)
    #4 0x55d06e580f34 in _start (/cpython/Programs/_freeze_module+0x85f34) (BuildId: f91c6a29210dc0cd457ac4d39f134316a9608c08)

  Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main'
    #0 0x55d06e606f60 in main /cpython/Programs/_freeze_module.c:206

SUMMARY: MemorySanitizer: use-of-uninitialized-value /cpython/Programs/_freeze_module.c:116:21 in read_text
MemorySanitizer: 2 warnings reported.
make: *** [Makefile:1640: Python/frozen_modules/getpath.h] Error 1
make: *** Waiting for unfinished jobs....

I can reproduce the issue by running _freeze_module manually:

# ./Programs/_freeze_module zipimport ./Lib/zipimport.py Python/frozen_modules/zipimport.h
==11199==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5622e273f4c0 in read_text /cpython/Programs/_freeze_module.c:109:9
    #1 0x5622e273f4c0 in main /cpython/Programs/_freeze_module.c:225:24
    #2 0x7fa50d770d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: c289da5071a3399de893d2af81d6a30c62646e1e)
    #3 0x7fa50d770e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: c289da5071a3399de893d2af81d6a30c62646e1e)
    #4 0x5622e26b7f34 in _start (/cpython/Programs/_freeze_module+0x85f34) (BuildId: f91c6a29210dc0cd457ac4d39f134316a9608c08)

  Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main'
    #0 0x5622e273df60 in main /cpython/Programs/_freeze_module.c:206

SUMMARY: MemorySanitizer: use-of-uninitialized-value /cpython/Programs/_freeze_module.c:109:9 in read_text
==11199==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5622e273f4cd in read_text /cpython/Programs/_freeze_module.c:116:21
    #1 0x5622e273f4cd in main /cpython/Programs/_freeze_module.c:225:24
    #2 0x7fa50d770d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: c289da5071a3399de893d2af81d6a30c62646e1e)
    #3 0x7fa50d770e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: c289da5071a3399de893d2af81d6a30c62646e1e)
    #4 0x5622e26b7f34 in _start (/cpython/Programs/_freeze_module+0x85f34) (BuildId: f91c6a29210dc0cd457ac4d39f134316a9608c08)

  Uninitialized value was created by an allocation of 'stat.i' in the stack frame of function 'main'
    #0 0x5622e273df60 in main /cpython/Programs/_freeze_module.c:206

SUMMARY: MemorySanitizer: use-of-uninitialized-value /cpython/Programs/_freeze_module.c:116:21 in read_text
MemorySanitizer: 2 warnings reported.
@vstinner
Copy link
Member Author

Closed as a duplicate of issue #116886.

@terryjreedy terryjreedy closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants