From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0FBAA3884512; Thu, 15 Sep 2022 13:27:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FBAA3884512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663248463; bh=yGKIiz7RQHYfUZCAwinFkOfB/khfGvnvulh7ERIRx+A=; h=From:To:Subject:Date:From; b=ONxsDkGl5NMs8qRiDjI0/qKM4x/DFRViCcYB5bWOjs2VJjTcjPgxm25sBv77ELnsz YhQFcGS3aNipsSGB4Z+Msf2Ehw04UO87BbNILZstLXnISGoE6DjQp2PH9U4pSCMVeo nn7VhgLHLQLz4zZerCldVR41ztCfl+I/8fJvGhvE= From: "huscar at gmail dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: huscar at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106951 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=3D53579&action=3Dedit 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=3Dc++20 -Wall -Wex= tra -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 segmentat= ion faults, nor does that same import (GameEngine.Main) from a different source file.=