Bug#1101322: g++-10: g++ randomly segfaults on clang code on Debian 11
Package: g++-10
Version: 10.2.1-6
Severity: normal
X-Debbugs-Cc: yoann.congal@smile.fr
Dear Maintainer,
* What led up to the situation?
I was trying to build clang for the Yocto project and it failed
randomly (See [0] for the bug reported on the Yocto project)
The file triggering the crash is:
clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp
* What exactly did you do (or not do) that was effective (or
ineffective)?
I reduced the reproducer to:
--- bug.cpp ---
class a {
template <typename b> a(b);
};
template <typename c> typename c ::j d();
class e;
struct {
a h;
} i {
d<e>
}
--------
Compiled with:
g++ -std=c++17 -o /dev/null -c bug.cpp
* What was the outcome of this action?
This gives randomly 2 outputs (around 50% of the times)
---- output 1 ----
bug.cpp:10:1: error: cannot resolve overloaded function ‘d’ based on conversion to type ‘a’
10 | }
| ^
------------------
(No segfault)
---- output 2 ----
bug.cpp: In substitution of ‘template<class b> a::a(b) [with b = <missing>]’:
bug.cpp:10:1: required from here
bug.cpp:10:1: internal compiler error: Segmentation fault
10 | }
| ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
------------------
(segfault)
* What outcome did you expect instead?
No segfault.
[0]: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15803
-- System Information:
Debian Release: 11.11
APT prefers oldstable-updates
APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-31-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
Versions of packages g++-10 depends on:
ii gcc-10 10.2.1-6
ii gcc-10-base 10.2.1-6
ii libc6 2.31-13+deb11u11
ii libgmp10 2:6.2.1+dfsg-1+deb11u1
ii libisl23 0.23-1
ii libmpc3 1.2.0-1
ii libmpfr6 4.1.0-3
ii libstdc++-10-dev 10.2.1-6
ii libzstd1 1.4.8+dfsg-2.1
ii zlib1g 1:1.2.11.dfsg-2+deb11u2
g++-10 recommends no packages.
Versions of packages g++-10 suggests:
pn g++-10-multilib <none>
pn gcc-10-doc <none>
-- no debconf information
Reply to: