[issue40998] Compiler warnings in ubsan builds
Christian Heimes
report at bugs.python.org
Wed Nov 18 07:31:36 EST 2020
Christian Heimes <lists at cheimes.de> added the comment:
I see more warnings and a new leak detection on latest master:
gcc -pthread -c -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -DPy_BUILD_CORE -o Objects/codeobject.o Objects/codeobject.c
In function ‘emit_pair’,
inlined from ‘emit_delta’ at Objects/codeobject.c:423:14,
inlined from ‘code_getlnotab’ at Objects/codeobject.c:462:18:
Objects/codeobject.c:414:15: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
414 | *lnotab++ = b;
| ~~~~~~~~~~^~~
In function ‘emit_pair’,
inlined from ‘emit_delta’ at Objects/codeobject.c:436:14,
inlined from ‘code_getlnotab’ at Objects/codeobject.c:462:18:
Objects/codeobject.c:414:15: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
414 | *lnotab++ = b;
| ~~~~~~~~~~^~~
In function ‘emit_pair’,
inlined from ‘emit_delta’ at Objects/codeobject.c:429:14,
inlined from ‘code_getlnotab’ at Objects/codeobject.c:462:18:
Objects/codeobject.c:414:15: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
414 | *lnotab++ = b;
| ~~~~~~~~~~^~~
gcc -pthread -c -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -DPy_BUILD_CORE -o Python/compile.o Python/compile.c
In function ‘assemble_emit_linetable_pair’,
inlined from ‘assemble_line_range’ at Python/compile.c:5614:18:
Python/compile.c:5586:15: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
5586 | *lnotab++ = ldelta;
| ~~~~~~~~~~^~~~~~~~
In function ‘assemble_emit_linetable_pair’,
inlined from ‘assemble_line_range’ at Python/compile.c:5608:18:
Python/compile.c:5586:15: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
5586 | *lnotab++ = ldelta;
| ~~~~~~~~~~^~~~~~~~
In function ‘assemble_emit_linetable_pair’,
inlined from ‘assemble’ at Python/compile.c:6011:10:
Python/compile.c:5586:15: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
5586 | *lnotab++ = ldelta;
| ~~~~~~~~~~^~~~~~~~
==669952==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 57 byte(s) in 1 object(s) allocated from:
#0 0x7fa6397cc667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
#1 0x777579 in PyUnicode_New Objects/unicodeobject.c:1459
#2 0x86aa4e in unicode_decode_utf8 Objects/unicodeobject.c:5129
#3 0x8b6050 in PyUnicode_DecodeUTF8Stateful Objects/unicodeobject.c:5259
#4 0x8b6050 in PyUnicode_FromString Objects/unicodeobject.c:2311
#5 0x8b6050 in PyUnicode_InternFromString Objects/unicodeobject.c:15788
#6 0x8f1e0b in create_filter Python/_warnings.c:67
#7 0x8f1e0b in init_filters Python/_warnings.c:95
#8 0x8f1e0b in _PyWarnings_InitState Python/_warnings.c:123
#9 0xa52178 in pycore_init_types Python/pylifecycle.c:704
#10 0xa52178 in pycore_interp_init Python/pylifecycle.c:760
#11 0xa5eab1 in pyinit_config Python/pylifecycle.c:807
#12 0xa5eab1 in pyinit_core Python/pylifecycle.c:970
#13 0xa60037 in Py_InitializeFromConfig Python/pylifecycle.c:1155
#14 0x47a842 in pymain_init Modules/main.c:66
#15 0x4802a2 in pymain_main Modules/main.c:698
#16 0x4802a2 in Py_BytesMain Modules/main.c:731
#17 0x7fa638a5b041 in __libc_start_main (/lib64/libc.so.6+0x27041)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40998>
_______________________________________
More information about the Python-bugs-list
mailing list