public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106951] New: Segmentation fault during compilation while using modules
@ 2022-09-15 13:27 huscar at gmail dot com
  2024-03-06 14:00 ` [Bug c++/106951] [modules] " ppalka at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: huscar at gmail dot com @ 2022-09-15 13:27 UTC (permalink / raw)
  To: gcc-bugs

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.

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

* [Bug c++/106951] [modules] Segmentation fault during compilation while using modules
  2022-09-15 13:27 [Bug c++/106951] New: Segmentation fault during compilation while using modules huscar at gmail dot com
@ 2024-03-06 14:00 ` ppalka at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-06 14:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Judging by the backtrace containing do_warn_unused_parameter this is probably a
dup of the recently fixed PR113850.

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

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 13:27 [Bug c++/106951] New: Segmentation fault during compilation while using modules huscar at gmail dot com
2024-03-06 14:00 ` [Bug c++/106951] [modules] " 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).