This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/25006] New: erand48 implementation triggers GCC's undefined sanitizer


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]