From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0769D3853809; Fri, 16 Sep 2022 09:42:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0769D3853809 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663321323; bh=EiNWG8CGQbMnqo6Md4lzlPfXBE0t9MXQOiNnUSomJpw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EzH6v8w+aDIq3HHGFAElrD6NXUn4APwol87UdVtnr+2ncWJES/AhEUTD2k/ItObzv 8XMvIX4UfhOOTjhYKZnOjToeSIX3CW11MMMYtcDMusUwiQ47s44FNdtxq0GbmpVEGW 7QyMpwuDry7cWYU7xsmkzA6sAX7kJ3Gsbf1qNFuw= From: "egor.pugin at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99243] [modules] ICE in set_filename, at cp/module.cc:19143 Date: Fri, 16 Sep 2022 09:41:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: egor.pugin at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: nathan at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D99243 --- Comment #5 from Egor Pugin --- Possible naive fix is to change in module.cc (void module_state::set_filena= me (const Cody::Packet &packet)): - error_at (loc, "unknown Compiled Module Interface: %s", packet.GetString ().c_str ()); + fatal_error (loc, "unknown Compiled Module Interface: %s", packet.GetString ().c_str ()); If we do not fail here, tons of ICEs come later because other code does not expect such mismatches. (There can be communication error, so we do not get same number of packets sent about querying modules, or another error.) For example, the following function static void name_pending_imports (cpp_reader *reader) iterates over responses and does not check for r_iter =3D=3D response.end() module->set_filename (*r_iter); ++r_iter;=