public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "huscar at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/106951] New: Segmentation fault during compilation while using modules
Date: Thu, 15 Sep 2022 13:27:42 +0000	[thread overview]
Message-ID: <bug-106951-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 106951
           Summary: Segmentation fault during compilation while using
                    modules
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: huscar at gmail dot com
  Target Milestone: ---

Created attachment 53579
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53579&action=edit
Zipper preprocessor source

Got a segmentation fault during compilation when porting a project over to
modules.

encountered on 12.2.0 (from docker gcc:12.2.0) and 11.2.0 (from apt)


command used:
g++ -c src/creatures.cpp -Ilibs/game-engine/include -std=c++20 -Wall -Wextra
-Werror -fmodules-ts -o src/creatures.o -freport-bug


compiler output:
In module imported at libs/game-engine/src/engine.cpp:17:1,
of module GameEngine.Main, imported at src/creatures.cpp:10:
GameEngine.Components.Transform: note: unable to represent further imported
source locations

In module imported at libs/game-engine/src/engine.cpp:21:1:
Segmentation fault
0x1b9fe76 internal_error(char const*, ...)
        ???:0
0x1bab157 pp_format(pretty_printer*, text_info*)
        ???:0
0x1bac520 pp_verbatim(pretty_printer*, char const*, ...)
        ???:0
0x1b9eca1 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ???:0
0x1b9f782 warning_at(unsigned int, int, char const*, ...)
        ???:0
0x9a6c07 do_warn_unused_parameter(tree_node*)
        ???:0
0x7cd12f finish_function(bool)
        ???:0
0x8c11c9 instantiate_decl(tree_node*, bool, bool)
        ???:0
0x8d5cab instantiate_pending_templates(int)
        ???:0
0x7db2df c_parse_final_cleanups()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).


I've attached the preprocessor source attached.

Segfault goes away after removing the line:
import GameEngine.Main;

The other import declaration in the same source file do not cause segmentation
faults, nor does that same import (GameEngine.Main) from a different source
file.

             reply	other threads:[~2022-09-15 13:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 13:27 huscar at gmail dot com [this message]
2024-03-06 14:00 ` [Bug c++/106951] [modules] " ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106951-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).