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

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).