This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/25006] New: erand48 implementation triggers GCC's undefined sanitizer
- From: "matthieu.schaller at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 17 Sep 2019 21:28:55 +0000
- Subject: [Bug libc/25006] New: erand48 implementation triggers GCC's undefined sanitizer
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=25006
Bug ID: 25006
Summary: erand48 implementation triggers GCC's undefined
sanitizer
Product: glibc
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: matthieu.schaller at gmail dot com
CC: drepper.fsp at gmail dot com
Target Milestone: ---
When running the current glibc's implementation of erand48 compiled with GCC's
undefined behaviour sanitizer (-fsanitize=undefined), the sanitizer complains
with messages of the kind
```
runtime error: left shift of 2053 by 20 places cannot be represented in type
'int'
```
where 2053 will be different at each call. This corresponds to the line of the
implementation assigning temp.ieee.mantissa1 with a bit shift of 20 on a short
int (line 40 of erand48_r.c). This will lead as expected to an overflow on x86
and other similar platforms.
Shouldn't this message be silenced somehow to not swamp users' code with false
positives?
--
You are receiving this mail because:
You are on the CC list for the bug.