Bug#945310: clang-9: Sanitizer suppressions file can not be parsed

Marco F maic23 at live.de
Fri Nov 22 19:40:25 GMT 2019


Package: clang-9
Version: 1:9.0.0-3+b1
Severity: normal
Tags: upstream

Dear Maintainer,

clang-9 can not parse the sanitizer suppressions that it generated
itself.

To reproduce:

$ export UBSAN_OPTIONS="suppressions=./supp:report_error_type=1"
$  cat ./supp
implicit-signed-integer-truncation-or-sign-change:foo.cpp
$  cat ./foo.cpp
int f() { return (unsigned long){0} - 1; }
int main() { f(); }
$ clang++-9 -g -fsanitize=address,integer -o ./foo.exe ./foo.cpp && ./foo.exe
./foo.cpp:1:37: warning: implicit conversion from 'unsigned long' to 'int' changes value from 18446744073709551615 to -1 [-Wconstant-conversion]
int f() { return (unsigned long){0} - 1; }
          ~~~~~~ ~~~~~~~~~~~~~~~~~~~^~~
1 warning generated.
AddressSanitizer: failed to parse suppressions

To verify the suppression name has no typo, clear the file and run the
command again:

$  echo "" > ./supp
$ clang++-9 -g -fsanitize=address,integer -o ./foo.exe ./foo.cpp && ./foo.exe
./foo.cpp:1:37: warning: implicit conversion from 'unsigned long' to 'int' changes value from 18446744073709551615 to -1 [-Wconstant-conversion]
int f() { return (unsigned long){0} - 1; }
          ~~~~~~ ~~~~~~~~~~~~~~~~~~~^~~
1 warning generated.
foo.cpp:1:37: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: unsigned-integer-overflow foo.cpp:1:37 in
foo.cpp:1:18: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551615 (64-bit, unsigned) to type 'int' changed the value to -1 (32-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: implicit-signed-integer-truncation-or-sign-change foo.cpp:1:18 in

Note that everything can be properly suppressed when using `unsigned`
instead of `unsigned long`.

Thanks,
Marco

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages clang-9 depends on:
ii  binutils               2.33.1-4
ii  libc6                  2.29-3
ii  libc6-dev              2.29-3
ii  libclang-common-9-dev  1:9.0.0-3+b1
ii  libclang-cpp9          1:9.0.0-3+b1
ii  libgcc-8-dev           8.3.0-24
ii  libgcc1                1:9.2.1-19
ii  libllvm9               1:9.0.0-3+b1
ii  libobjc-8-dev          8.3.0-24
ii  libstdc++-8-dev        8.3.0-24
ii  libstdc++6             9.2.1-19

Versions of packages clang-9 recommends:
ii  libomp-9-dev  1:9.0.0-3+b1
ii  llvm-9-dev    1:9.0.0-3+b1
ii  python3       3.7.5-3

Versions of packages clang-9 suggests:
pn  clang-9-doc  <none>

-- no debconf information

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-llvm-team/attachments/20191122/a8f3a72d/attachment.html>


More information about the Pkg-llvm-team mailing list