public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110805] New: g++ crash on modules with exported class providing string constant with obscure content
@ 2023-07-25 16:27 jo.hiller+gcc at gmail dot com
  2023-08-01 16:52 ` [Bug c++/110805] " jo.hiller+gcc at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jo.hiller+gcc at gmail dot com @ 2023-07-25 16:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110805
           Summary: g++ crash on modules with exported class providing
                    string constant with obscure content
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jo.hiller+gcc at gmail dot com
  Target Milestone: ---

Created attachment 55630
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55630&action=edit
output of -freport-bug

// Info
gcc-13 --version
gcc-13 (Homebrew GCC 13.1.0) 13.1.0
macOS 13.5, arm64, Apple M1 MAX

// Steps to reproduce
* use a C++20 module with exported class providing obscure string constant
* gcc 13.1 crash with "m.cc:3:8: internal compiler error: Segmentation fault:
11"

// m.cc
module;
#include <string>
export module m;
export class Constants {
 public:
  inline static const std::string CONST_CRASH_1 = "Bundle-Activator";
};

// build
gcc-13 -freport-bug -std=c++20 -xc++ -fmodules-ts -fmodule-only -Wall -Wextra
m.cc
# see attached output file ccRJ91Vu.out

// notes
* exported string constants outside exported class do work
* string constants with different types/values do work as well, see different
string value, very obscure
  static constexpr std::string_view CONST_OK_1 = "Bundle-Activator";
  inline static const std::string CONST_OK_2 = "bundleactivator";
  inline static const std::string CONST_OK_3 = "Bundle-Activato";
  inline static const std::string CONST_OK_4 = "undle-Activator";
  inline static const std::string CONST_OK_5 = "xxxXactivatorll";
* these string constants do fail as well
  inline static const std::string CONST_CRASH_2 = "xxxbundleXactivatorlll";
  inline static const std::string CONST_CRASH_3 = "xxxXactivatorlll";
  inline static const std::string CONST_CRASH_4 = "xxxXactivatorlll";
* it seems this pattern ".*.activator.*" triggeres special handling in gcc-13,
lower/upper case seems not to be relevant, but number of characters
before/after

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

* [Bug c++/110805] g++ crash on modules with exported class providing string constant with obscure content
  2023-07-25 16:27 [Bug c++/110805] New: g++ crash on modules with exported class providing string constant with obscure content jo.hiller+gcc at gmail dot com
@ 2023-08-01 16:52 ` jo.hiller+gcc at gmail dot com
  2023-08-01 17:33 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jo.hiller+gcc at gmail dot com @ 2023-08-01 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jochen Hiller <jo.hiller+gcc at gmail dot com> ---
Side-note: same code does compile and execute fine with clang 16.0.6

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

* [Bug c++/110805] g++ crash on modules with exported class providing string constant with obscure content
  2023-07-25 16:27 [Bug c++/110805] New: g++ crash on modules with exported class providing string constant with obscure content jo.hiller+gcc at gmail dot com
  2023-08-01 16:52 ` [Bug c++/110805] " jo.hiller+gcc at gmail dot com
@ 2023-08-01 17:33 ` pinskia at gcc dot gnu.org
  2023-08-01 17:38 ` jo.hiller+gcc at gmail dot com
  2024-03-06 20:24 ` ppalka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-01 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Gcc's module support is still experimental.

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

* [Bug c++/110805] g++ crash on modules with exported class providing string constant with obscure content
  2023-07-25 16:27 [Bug c++/110805] New: g++ crash on modules with exported class providing string constant with obscure content jo.hiller+gcc at gmail dot com
  2023-08-01 16:52 ` [Bug c++/110805] " jo.hiller+gcc at gmail dot com
  2023-08-01 17:33 ` pinskia at gcc dot gnu.org
@ 2023-08-01 17:38 ` jo.hiller+gcc at gmail dot com
  2024-03-06 20:24 ` ppalka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jo.hiller+gcc at gmail dot com @ 2023-08-01 17:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jochen Hiller <jo.hiller+gcc at gmail dot com> ---
> Gcc's module support is still experimental.

Sure. Nevertheless reporting bugs may help to come from experimental to stable.

I mainly do prototype development using C++ modules with Clang 16, but trying
regularly to get it working with Gcc as well. On my list is as well to check
MSVC state of implementation.

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

* [Bug c++/110805] g++ crash on modules with exported class providing string constant with obscure content
  2023-07-25 16:27 [Bug c++/110805] New: g++ crash on modules with exported class providing string constant with obscure content jo.hiller+gcc at gmail dot com
                   ` (2 preceding siblings ...)
  2023-08-01 17:38 ` jo.hiller+gcc at gmail dot com
@ 2024-03-06 20:24 ` ppalka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-06 20:24 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
                 CC|                            |ppalka at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
GCC trunk accepts the testcase and indeed this seems to be pretty much a dup of
the recently fixed PR112899.  If the string fits in the SSO buffer we can
statically initialize it, otherwise we need dynamic initialization which
crashed until r14-6979.

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

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

end of thread, other threads:[~2024-03-06 20:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25 16:27 [Bug c++/110805] New: g++ crash on modules with exported class providing string constant with obscure content jo.hiller+gcc at gmail dot com
2023-08-01 16:52 ` [Bug c++/110805] " jo.hiller+gcc at gmail dot com
2023-08-01 17:33 ` pinskia at gcc dot gnu.org
2023-08-01 17:38 ` jo.hiller+gcc at gmail dot com
2024-03-06 20:24 ` ppalka 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).