Your message dated Wed, 07 Nov 2018 18:53:22 +0000
with message-id <[email protected]>
and subject line Bug#909234: fixed in llvm-toolchain-7 1:7.0.1~+rc2-1
has caused the Debian Bug report #909234,
regarding clang-7: clang::ast_matchers::MatchFinder::MatchFinder is miscompiled
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
909234: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909234
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: clang-7
Version: 1:7-1
Severity: normal
Dear Maintainer,
Using a clang plugin that creates a MatchFinder crashes. One way to
reproduce is to get the Firefox source code from
https://hg.mozilla.org/mozilla-central, create a .mozconfig file with
the following contents:
ac_add_options --enable-clang-plugin
ac_add_options CC=clang-7
ac_add_options LLVM_CONFIG=llvm-config-7
and run ./mach build
This results in the compiler crashing when it uses the plugin.
The constructor C++ code is:
MatchFinder::MatchFinder(MatchFinderOptions Options)
: Options(std::move(Options)), ParsingDone(nullptr) {}
where MatchFinderOptions is defined as:
struct MatchFinderOptions {
struct Profiling {
Profiling(llvm::StringMap<llvm::TimeRecord> &Records)
: Records(Records) {}
/// Per bucket timing information.
llvm::StringMap<llvm::TimeRecord> &Records;
};
/// Enables per-check timers.
///
/// It prints a report after match.
llvm::Optional<Profiling> CheckProfiling;
};
I won't go on detailing how Optional is defined, but the point is
MatchFinderOptions, and thus the Optional is passed by value.
But the function as it appears in the clang-7 executable looks like:
lea 0xb0(%rdi),%rax
movq $0x0,(%rdi)
mov %rax,0x90(%rdi)
mov %rax,0x98(%rdi)
movzbl 0x8(%rsi),%eax
movq $0x0,0x8(%rdi)
movq $0x0,0x10(%rdi)
movq $0x0,0x18(%rdi)
movq $0x0,0x20(%rdi)
(...)
mov %al,0x138(%rdi)
test %al,%al
je <_ZN5clang12ast_matchers11MatchFinderC2ENS1_18MatchFinderOptionsE+215>
mov (%rsi),%rax
mov %rax,0x130(%rdi)
movq $0x0,0x140(%rdi)
retq
The crashing instruction is the movzbl, which tries to dereference %rsi
as a pointer, and its value is 0. What's happening here, essentially, is
that it's compiled with the assumption that %rsi is a pointer to the
MatchFinderOptions. That's clearly not what's supposed to happen given
the C++ code.
As bootstrapped by clang-7 itself, the same function is compiled as
lea 0xb0(%rdi),%rax
xorps %xmm0,%xmm0
movups %xmm0,0x80(%rdi)
(...)
movups %xmm0,(%rdi)
mov %rax,0x90(%rdi)
mov %rax,0x98(%rdi)
movq $0x10,0xa0(%rdi)
movl $0x0,0xa8(%rdi)
mov %rsi,0x130(%rdi)
mov %dl,0x138(%rdi)
movq $0x0,0x140(%rdi)
retq
which is compiled with the assumption that %rsi and %rdx (really %rdl)
represent the value of the MatchFinderOptions.
Interestingly, there's already a #ifdef in Optional.h in llvm to disable
some code for GCC because it miscompiles it. It looks like things got
worse.
It feels like the clang package should be bootstrapped in 2 stages...
I'd file a GCC upstream bug for the miscompilation, but as the package
wasn't built on buildds, buildd.debian.org doesn't contain logs that
could tell me what specific version was used.
Mike
-- System Information:
Debian Release: buster/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (1,
'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.17.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8),
LANGUAGE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages clang-7 depends on:
ii binutils 2.31.1-4
ii libc6 2.27-5
ii libc6-dev 2.27-5
ii libclang-common-7-dev 1:7-1
ii libclang1-7 1:7-1
ii libgcc-8-dev 8.2.0-3
ii libgcc1 1:8.2.0-3
ii libllvm7 1:7-1
ii libobjc-8-dev 8.2.0-3
ii libstdc++-8-dev 8.2.0-3
ii libstdc++6 8.2.0-3
Versions of packages clang-7 recommends:
ii libomp-dev 6.0.1-1
ii llvm-7-dev 1:7-1
ii python 2.7.15-3
Versions of packages clang-7 suggests:
pn clang-7-doc <none>
-- no debconf information
--- End Message ---
--- Begin Message ---
Source: llvm-toolchain-7
Source-Version: 1:7.0.1~+rc2-1
We believe that the bug you reported is fixed in the latest version of
llvm-toolchain-7, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Sylvestre Ledru <[email protected]> (supplier of updated llvm-toolchain-7
package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Wed, 07 Nov 2018 15:17:41 +0100
Source: llvm-toolchain-7
Binary: clang-7 clang-tools-7 clang-format-7 clang-tidy-7 clang-7-doc
libclang1-7 libclang-7-dev libclang-common-7-dev libfuzzer-7-dev python-clang-7
clang-7-examples libllvm7 llvm-7 llvm-7-runtime llvm-7-dev llvm-7-tools
libllvm-7-ocaml-dev llvm-7-doc llvm-7-examples lld-7 liblld-7 liblld-7-dev
lldb-7 liblldb-7 python-lldb-7 liblldb-7-dev libomp-7-dev libomp5-7
libomp-7-doc libc++1-7 libc++-7-dev libc++abi1-7 libc++abi-7-dev
Architecture: source
Version: 1:7.0.1~+rc2-1
Distribution: unstable
Urgency: medium
Maintainer: LLVM Packaging Team <[email protected]>
Changed-By: Sylvestre Ledru <[email protected]>
Description:
clang-7 - C, C++ and Objective-C compiler
clang-7-doc - C, C++ and Objective-C compiler - Documentation
clang-7-examples - Clang examples
clang-format-7 - Tool to format C/C++/Obj-C code
clang-tidy-7 - clang-based C++ linter tool
clang-tools-7 - clang-based tools for C/C++ developments
libc++-7-dev - LLVM C++ Standard library (development files)
libc++1-7 - LLVM C++ Standard library
libc++abi-7-dev - LLVM low level support for a standard C++ library
(development fi
libc++abi1-7 - LLVM low level support for a standard C++ library
libclang-7-dev - clang library - Development package
libclang-common-7-dev - clang library - Common development package
libclang1-7 - C interface to the clang library
libfuzzer-7-dev - Library for coverage-guided fuzz testing
liblld-7 - LLVM-based linker, library
liblld-7-dev - LLVM-based linker, header files
liblldb-7 - Next generation, high-performance debugger, library
liblldb-7-dev - Next generation, high-performance debugger, header files
libllvm-7-ocaml-dev - Modular compiler and toolchain technologies, OCaml
bindings
libllvm7 - Modular compiler and toolchain technologies, runtime library
libomp-7-dev - LLVM OpenMP runtime - dev package
libomp-7-doc - LLVM OpenMP runtime - Documentation
libomp5-7 - LLVM OpenMP runtime
lld-7 - LLVM-based linker
lldb-7 - Next generation, high-performance debugger
llvm-7 - Modular compiler and toolchain technologies
llvm-7-dev - Modular compiler and toolchain technologies, libraries and header
llvm-7-doc - Modular compiler and toolchain technologies, documentation
llvm-7-examples - Modular compiler and toolchain technologies, examples
llvm-7-runtime - Modular compiler and toolchain technologies, IR interpreter
llvm-7-tools - Modular compiler and toolchain technologies, tools
python-clang-7 - Clang Python Bindings
python-lldb-7 - Next generation, high-performance debugger, python lib
Closes: 743133 842142 909234 912641
Changes:
llvm-toolchain-7 (1:7.0.1~+rc2-1) unstable; urgency=medium
.
* Upload of 7.0.1 rc2 into unstable
* New testing release
* Enable the stage2 bootstrap:
- stage1 = build clang with gcc
- stage2 = clang building itself
(Closes: #909234)
* Bring back the Disable NEON generation on armhf patch which was gone
Should fix the FTBFS on armhf
(Closes: #842142)
* Update the clang manpage to remove osx specific options
and to add -arch (Closes: #743133)
* Bring back usr/lib/@DEB_HOST_MULTIARCH@/{libiomp5.so, libomp5.so}
symlink for gcc (Closes: #912641)
Checksums-Sha1:
cb0cc00ac7426a54957b3147450ca7050b62fe3c 8413 llvm-toolchain-7_7.0.1~+rc2-1.dsc
24f4b15d4a834973eb464525144502f93238f466 87824
llvm-toolchain-7_7.0.1~+rc2-1.debian.tar.xz
59a92342a75443e9144d25c6bb0ccfde4731b23a 19458
llvm-toolchain-7_7.0.1~+rc2-1_amd64.buildinfo
Checksums-Sha256:
9e488eb296ac7c29e431793ac3d2c35f0c3263ece0474afcbd844560222f982c 8413
llvm-toolchain-7_7.0.1~+rc2-1.dsc
6db5f27c7aaf7f531f293f343c136b52650f4256bea0e5ad3ab23c715e817099 87824
llvm-toolchain-7_7.0.1~+rc2-1.debian.tar.xz
0c0f723d289f2da2aee06b5300bb2716798c596e0f2afd575652d6ffc8ebbc39 19458
llvm-toolchain-7_7.0.1~+rc2-1_amd64.buildinfo
Files:
26ebb16e19877c54ab4a8be0a2c2c8e9 8413 devel optional
llvm-toolchain-7_7.0.1~+rc2-1.dsc
a2c05e244a566a1a091a6d0c8f7ce326 87824 devel optional
llvm-toolchain-7_7.0.1~+rc2-1.debian.tar.xz
39f3f7ffd3f0ba78b0cec14a38c4d1f1 19458 devel optional
llvm-toolchain-7_7.0.1~+rc2-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEtg21mU05vsTRqVzPfmUo2nUvG+EFAlvjKB4ACgkQfmUo2nUv
G+GOqw//d56awN2NcsF/KgWqS4kVYt5Fdw/Ez+/30SI+BhAstC2ZUbg1zt0kpiBM
S1a9EvwKLTD52G+qLK19oKrDQGR/mHQpK5FPTIBcrMeBJhGSmzzCvhKjOkZAHlSi
LAAy9VMZSl5aDwr3oS5Lp3uKFTm2VHhj3kjrtXjLr9FGi+ECswbf5BFhChZfxLlI
YTVn5epuAd0dsgdFjB2VsrBYbFZxipWI3pDMP7lzVtUjSiqXKFCPw/efDs6AWH+L
oNtYzKAx5E1cU6gAHAv3M8hIESsDX4I/iA8AXzXu8DKik3m79J9y629VcW421fui
vaJy6AWpPbXXehRQmKRkuhTLs2Kfm1KE+GLVU8nmXgO2UQMN709exq2jSHa2fPmj
jifU1KQvTAx3piDflqtqkee/B7UdxnaLI58LXcL3tWRUEdzZL6vvvU9WUUImlCie
yC1120mPxbzzz9YhBAg+BCaMys7Tc70Ese3NE1bIVDLOPb/c93uBz/hV74uyrkoQ
JEJAiO2e3DKfoGj8yb+75VCtf2DU5b9K+QSxbwqFb3sl7YuueCMsVYyqLwcmENuk
yNB+g7HwGteYEFXVGSHlk2W+XBNPtFDCkqBj1KcYv5zYWPf5NwR3FvJZJRbxt3P0
iwsfaUG5/rQ7IDFOqzS+I6pW0hAmfu11qPiQRAboFciSqN3uGHM=
=WCTg
-----END PGP SIGNATURE-----
--- End Message ---