Closed
Description
A recent glibc update added a new strtol()
implementation to support the 0b
prefix from C23. This new symbol seems to be missing an interceptor:
tavianator@graphene $ cat foo.c
#include <assert.h>
#include <stdlib.h>
int main(void) {
char *end;
long l = strtol("42", &end, 0);
assert(l == 42);
assert(*end == '\0');
return 0;
}
tavianator@graphene $ clang -fsanitize=memory foo.c -o foo && ./foo
tavianator@graphene $ clang -std=c2x -fsanitize=memory foo.c -o foo && ./foo
==58541==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x55994bbe00da in main (/home/tavianator/code/bfs/foo+0xb50da) (BuildId: 43c18b79db0838f533698c3e83e9322a882086d9)
#1 0x7f1a12c27ccf (/usr/lib/libc.so.6+0x27ccf) (BuildId: 316d0d3666387f0e8fb98773f51aa1801027c5ab)
#2 0x7f1a12c27d89 in __libc_start_main (/usr/lib/libc.so.6+0x27d89) (BuildId: 316d0d3666387f0e8fb98773f51aa1801027c5ab)
#3 0x55994bb4d134 in _start (/home/tavianator/code/bfs/foo+0x22134) (BuildId: 43c18b79db0838f533698c3e83e9322a882086d9)
SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/tavianator/code/bfs/foo+0xb50da) (BuildId: 43c18b79db0838f533698c3e83e9322a882086d9) in main
Exiting
tavianator@graphene $ clang -D_GNU_SOURCE -fsanitize=memory foo.c -o foo && ./foo
==58556==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5643ee5720da in main (/home/tavianator/code/bfs/foo+0xb50da) (BuildId: 43c18b79db0838f533698c3e83e9322a882086d9)
#1 0x7f302fc27ccf (/usr/lib/libc.so.6+0x27ccf) (BuildId: 316d0d3666387f0e8fb98773f51aa1801027c5ab)
#2 0x7f302fc27d89 in __libc_start_main (/usr/lib/libc.so.6+0x27d89) (BuildId: 316d0d3666387f0e8fb98773f51aa1801027c5ab)
#3 0x5643ee4df134 in _start (/home/tavianator/code/bfs/foo+0x22134) (BuildId: 43c18b79db0838f533698c3e83e9322a882086d9)
SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/tavianator/code/bfs/foo+0xb50da) (BuildId: 43c18b79db0838f533698c3e83e9322a882086d9) in main
Exiting
tavianator@graphene $ nm -u foo | grep strtol
U __isoc23_strtol@GLIBC_2.38
tavianator@graphene $ clang --version
clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
tavianator@graphene $ /usr/lib/libc.so.6
GNU C Library (GNU libc) stable release version 2.38.
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 13.2.1 20230801.
libc ABIs: UNIQUE IFUNC ABSOLUTE
Minimum supported kernel: 4.4.0
For bug reporting instructions, please see:
<https://bugs.archlinux.org/>.
Metadata
Metadata
Assignees
Type
Projects
Status
Needs Triage