public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109850] New: ICE compiling ccache 4.8
@ 2023-05-13 22:32 psmith at gnu dot org
  2023-05-13 22:34 ` [Bug c++/109850] " psmith at gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: psmith at gnu dot org @ 2023-05-13 22:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109850

            Bug ID: 109850
           Summary: ICE compiling ccache 4.8
           Product: gcc
           Version: 12.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: psmith at gnu dot org
  Target Milestone: ---

I've started working with GCC 12.3.0 I've built myself and I've gotten an ICE
trying to compile ccache 4.8.  The preprocessor output is attached.  I'm
building using a sysroot from a Rocky Linux 8.4 x86_64 system with glibc 2.28. 
I'm using my own binutils 2.40.

I was able to reduce the command line to just: g++ -o LocalStorage.o -c
LocalStorage.i

I attached the .i file.

Output from my build:

$ /data/src/tooldir/bin/x86_64-tools-linux-gnu-g++ -o LocalStorage.o -c
LocalStorage.i
/data/src/ccache/ccache-4.8/src/storage/local/LocalStorage.cpp: In
instantiation of 'storage::local::LocalStorage::recompress(std::optional<signed
char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const
auto:39&, const auto:40&)> [with auto:39 = unsigned char; auto:40 =
std::function<void(double)>]':
/data/src/build/x86_64-linux/cc/unknown/x86_64-unknown-linux-gnu/include/c++/12.3.0/type_traits:2559:26:
  required by substitution of 'template<class _Fn, class ... _Args> static
std::__result_of_success<decltype (declval<_Fn>()((declval<_Args>)()...)),
std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn =
storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t,
const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const
auto:40&)>&; _Args = {unsigned char, const std::function<void(double)>&}]'
/data/src/build/x86_64-linux/cc/unknown/x86_64-unknown-linux-gnu/include/c++/12.3.0/type_traits:2570:55:
  required from 'struct std::__result_of_impl<false, false,
storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t,
const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const
auto:40&)>&, unsigned char, const std::function<void(double)>&>'
/data/src/build/x86_64-linux/cc/unknown/x86_64-unknown-linux-gnu/include/c++/12.3.0/bits/std_function.h:348:9:
  recursively required by substitution of 'template<class _Result, class _Ret>
struct std::__is_invocable_impl<_Result, _Ret, true, std::__void_t<typename
_CTp::type> > [with _Result =
std::__invoke_result<storage::local::LocalStorage::recompress(std::optional<signed
char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const
auto:39&, const auto:40&)>&, unsigned char, const
std::function<void(double)>&>; _Ret = void]'
/data/src/build/x86_64-linux/cc/unknown/x86_64-unknown-linux-gnu/include/c++/12.3.0/bits/std_function.h:348:9:
  required from 'struct std::function<void(unsigned char, const
std::function<void(double)>&)>::_Callable<storage::local::LocalStorage::recompress(std::optional<signed
char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const
auto:39&, const auto:40&)>,
storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t,
const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const
auto:40&)>,
std::__invoke_result<storage::local::LocalStorage::recompress(std::optional<signed
char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const
auto:39&, const auto:40&)>&, unsigned char, const std::function<void(double)>&>
>'
/data/src/build/x86_64-linux/cc/unknown/x86_64-unknown-linux-gnu/include/c++/12.3.0/bits/std_function.h:353:8:
  required by substitution of 'template<class _Res, class ... _ArgTypes>
template<class _Cond, class _Tp> using _Requires =
std::__enable_if_t<_Cond::value, _Tp> [with _Cond = std::function<void(unsigned
char, const
std::function<void(double)>&)>::_Callable<storage::local::LocalStorage::recompress(std::optional<signed
char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const
auto:39&, const auto:40&)>,
storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t,
const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const
auto:40&)>,
std::__invoke_result<storage::local::LocalStorage::recompress(std::optional<signed
char>, uint32_t, const storage::local::ProgressReceiver&)::<lambda(const
auto:39&, const auto:40&)>&, unsigned char, const std::function<void(double)>&>
>; _Tp = void; _Res = void; _ArgTypes = {unsigned char, const
std::function<void(double)>&}]'
/data/src/build/x86_64-linux/cc/unknown/x86_64-unknown-linux-gnu/include/c++/12.3.0/bits/std_function.h:434:9:
  required by substitution of 'template<class _Functor, class _Constraints>
std::function<void(unsigned char, const
std::function<void(double)>&)>::function(_Functor&&) [with _Functor =
storage::local::LocalStorage::recompress(std::optional<signed char>, uint32_t,
const storage::local::ProgressReceiver&)::<lambda(const auto:39&, const
auto:40&)>; _Constraints = <missing>]'
/data/src/ccache/ccache-4.8/src/storage/local/LocalStorage.cpp:701:24:  
required from here
/data/src/ccache/ccache-4.8/src/storage/local/LocalStorage.cpp:710:44: internal
compiler error: Segmentation fault
  710 |             LOG("Failed to acquire content lock for {}/{}", l1_index,
l2_index);
      |                                            ^~~~~~~
0x7f1399b2c08f ???
       
/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f1399b0d082 __libc_start_main
        ../csu/libc-start.c:308


I tried to use -freport-bug but it said "The bug is not reproducible, so it is
likely a hardware or OS problem."  But I don't think it's a hardware or OS
problem.  It could be related to how I compiled GCC maybe?  The crash is
completely repeatable on my system.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/109850] ICE compiling ccache 4.8
  2023-05-13 22:32 [Bug c++/109850] New: ICE compiling ccache 4.8 psmith at gnu dot org
@ 2023-05-13 22:34 ` psmith at gnu dot org
  2023-05-13 22:47 ` psmith at gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: psmith at gnu dot org @ 2023-05-13 22:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109850

Paul Smith <psmith at gnu dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |psmith at gnu dot org

--- Comment #1 from Paul Smith <psmith at gnu dot org> ---
Created attachment 55080
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55080&action=edit
LocalStorage.i compressed

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/109850] ICE compiling ccache 4.8
  2023-05-13 22:32 [Bug c++/109850] New: ICE compiling ccache 4.8 psmith at gnu dot org
  2023-05-13 22:34 ` [Bug c++/109850] " psmith at gnu dot org
@ 2023-05-13 22:47 ` psmith at gnu dot org
  2023-05-13 22:51 ` pinskia at gcc dot gnu.org
  2023-05-13 22:53 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: psmith at gnu dot org @ 2023-05-13 22:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109850

--- Comment #2 from Paul Smith <psmith at gnu dot org> ---
I don't know if this is of any use but I ran under valgrind and get this
result:

==3019683== Command:
/data/src/build/x86_64-linux/cc/unknown/bin/../libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus
-fpreprocessed LocalStorage.i -quiet -dumpbase LocalStorage.i -dumpbase-ext .i
-m64 -mtune=generic -march=x86-64 -o /tmp/ccaQvBYi.s
==3019683== 
==3019683== Invalid read of size 4
==3019683==    at 0x7B5503: ??? (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x1390609: walk_tree_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*)) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x1390A11: walk_tree_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*)) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x148A6C3: ??? (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x1390609: walk_tree_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*)) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x13906DD: walk_tree_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*)) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x1390730: walk_tree_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*)) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x139096F: walk_tree_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false,
default_hash_traits<tree_node*> >*)) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x1484986: check_for_bare_parameter_packs(tree_node*,
unsigned int) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x157004A: finish_expr_stmt(tree_node*) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x1689186: tsubst_expr(tree_node*, tree_node*, int,
tree_node*, bool) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==    by 0x1689087: tsubst_expr(tree_node*, tree_node*, int,
tree_node*, bool) (in
/data/src/build/x86_64-linux/cc/unknown/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/cc1plus)
==3019683==  Address 0x5c is not stack'd, malloc'd or (recently) free'd
==3019683==

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/109850] ICE compiling ccache 4.8
  2023-05-13 22:32 [Bug c++/109850] New: ICE compiling ccache 4.8 psmith at gnu dot org
  2023-05-13 22:34 ` [Bug c++/109850] " psmith at gnu dot org
  2023-05-13 22:47 ` psmith at gnu dot org
@ 2023-05-13 22:51 ` pinskia at gcc dot gnu.org
  2023-05-13 22:53 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-13 22:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109850

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 109241.

*** This bug has been marked as a duplicate of bug 109241 ***

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/109850] ICE compiling ccache 4.8
  2023-05-13 22:32 [Bug c++/109850] New: ICE compiling ccache 4.8 psmith at gnu dot org
                   ` (2 preceding siblings ...)
  2023-05-13 22:51 ` pinskia at gcc dot gnu.org
@ 2023-05-13 22:53 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-13 22:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109850

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
And yes it is a dup:
void
LocalStorage::recompress ....
{
....
    [&](const auto& l1_index, const auto& l1_progress_receiver) {
....
        [&](const auto& l2_index, const auto& l2_progress_receiver) {
          ....[] { struct ... FMT_COMPILE_STRING

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-13 22:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-13 22:32 [Bug c++/109850] New: ICE compiling ccache 4.8 psmith at gnu dot org
2023-05-13 22:34 ` [Bug c++/109850] " psmith at gnu dot org
2023-05-13 22:47 ` psmith at gnu dot org
2023-05-13 22:51 ` pinskia at gcc dot gnu.org
2023-05-13 22:53 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).