From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 182493858C2F; Thu, 25 Aug 2022 09:20:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 182493858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661419213; bh=VlYnkfJLneFbt7ISy2wc0FxeLEum1z5fmodY/ttUCfc=; h=From:To:Subject:Date:From; b=cBe0HN8lzwNK34OfjzlrBoYev/ZSztKYBi7hjbthA7yS76mElhTjV7GSMDrbNtiH8 whIL6c8SchfQ01GGHxnADcuDb4Aj63N++uERAbZj+proT9+xzeRlDfP9zgDcStOr7I 3CzXD8PmGwYD0mAiIJXUyY9qVv/6u42wbqq1pAl8= From: "zhkefa at live dot cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/106739] New: runtime error coredump case on c++17/20 Date: Thu, 25 Aug 2022 09:20:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 10.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhkefa at live dot cn 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 cc target_milestone 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=3D106739 Bug ID: 106739 Summary: runtime error coredump case on c++17/20 Product: gcc Version: 10.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: zhkefa at live dot cn CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxi= n at gcc dot gnu.org Target Milestone: --- code file test.cc: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D class A { public: A(int i): i(i){} int get() {return i;} private: int i{0}; }; void func() { typedef int (A::*f)(); f fs[] =3D {&A::get}; A *a =3D new A{1}; for (int i =3D 0; i < 1; ++i) { (a->*fs[i])(); } delete a; } int main() { func(); return 0; } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D envirment: gcc10.4 g++ -fsanitize=3Daddress -fsanitize=3Dundefined -std=3Dc++17 test.cc ./a.out runtime error: index 4198816 out of bounds for type func[1] runtime error: load of address 0x7ffd97570f08 whith insufficient space for = an object of type 'long int' if compile with -std=3Dc++14 or -std=3Dc++11, everything ok.=