From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC3BC3858D39; Mon, 19 Jun 2023 23:34:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC3BC3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687217651; bh=KHHRgcGzBPD2o1S+GBm+IaxqXn5cF9oLpJcUnplxAKA=; h=From:To:Subject:Date:From; b=mWl4VXNHHZzIlvbEoWLy8MAnQv7OR85h31LTxKoIbOE423mRi30xdHp/59Qhdk+vO YaN71/a9NR87sjYvG0cw99WZn2ST5J7igT6Z1MkG0yy8AEhMjAiT76GZLLX1VYP8Zh WYdK/HKHiCvTxSXOA8JyP14yJx7NbiuT3rdauF6Q= From: "glebfm at altlinux dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110315] New: [13 Regression] g++ crashes with a segmentation fault while compiling a large const std::vector of std::string since r13-6566-ge0324e2629e25a90 Date: Mon, 19 Jun 2023 23:34:10 +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: 13.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: glebfm at altlinux dot org 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=3D110315 Bug ID: 110315 Summary: [13 Regression] g++ crashes with a segmentation fault while compiling a large const std::vector of std::string since r13-6566-ge0324e2629e25a90 Product: gcc Version: 13.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: glebfm at altlinux dot org Target Milestone: --- Created attachment 55366 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55366&action=3Dedit preprocessed source $ ~/gcc-test/bin/g++ --version g++ (GCC) 13.1.1 20230619 Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ ~/gcc-test/bin/g++ -O -c test.ii g++: internal compiler error: Segmentation fault signal terminated program cc1plus Please submit a full bug report, with preprocessed source (by using -freport-bug). See for instructions. $ gdb -q --args /usr/src/gcc-test/libexec/gcc/x86_64-pc-linux-gnu/13.1.1/cc1plus -quiet -O test.cpp -o test.o Reading symbols from /usr/src/gcc-test/libexec/gcc/x86_64-pc-linux-gnu/13.1.1/cc1plus... (gdb) run Starting program: /usr/src/gcc-test/libexec/gcc/x86_64-pc-linux-gnu/13.1.1/cc1plus -quiet -O test.cpp -o test.o [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x0000000001aafe51 in fold_using_range::range_of_phi (this=3Dthis@entry=3D0x7ffffbfffcaf, r=3Dwarning: RTTI symbol not found for= class 'int_range<255u>' ..., phi=3Dphi@entry=3D0x7ffff2d4c000, src=3D...) at ../../gcc/gimple-range-fold.cc:733 733 { (gdb) bt #0 0x0000000001aafe51 in fold_using_range::range_of_phi (this=3Dthis@entry=3D0x7ffffbfffcaf, r=3Dwarning: RTTI symbol not found for= class 'int_range<255u>' ..., phi=3Dphi@entry=3D0x7ffff2d4c000, src=3D...) at ../../gcc/gimple-range-fold.cc:733 #1 0x0000000001ab2289 in fold_using_range::fold_stmt (this=3D0x7ffffbfffca= f, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., s=3D0x7ffff2d4c000, src=3D..., name=3D0x7ffff2d4b480) at ../../gcc/gimple-range-fold.cc:491 #2 0x0000000001aa5292 in gimple_ranger::fold_range_internal (name=3D0x7ffff2d4b480, s=3D0x7ffff2d4c000, r=3Dwarning: RTTI symbol not fo= und for class 'int_range<255u>' ..., this=3D0x29069a0) at ../../gcc/gimple-range.cc:257 #3 gimple_ranger::range_of_stmt (this=3D0x29069a0, r=3Dwarning: RTTI symbo= l not found for class 'int_range<255u>' ..., s=3D0x7ffff2d4c000, name=3D) at ../../gcc/gimple-range.= cc:318 #4 0x0000000001aa3fbb in gimple_ranger::range_on_entry (this=3Dthis@entry=3D0x29069a0, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., bb=3D0x7ffff34b0720, name=3Dname@entry=3D0x7ffff2d4b480) at ../../gcc/gimple-range.cc:153 #5 0x0000000001aa6cff in gimple_ranger::range_of_expr (this=3D0x29069a0, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., expr=3D0x7ffff2d4b480, stmt=3D) at ../../gcc/gimple-range.cc:130 #6 0x0000000001aa418a in gimple_ranger::range_on_exit (this=3D0x29069a0, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., bb=3D0x7ffff34b0720, name=3D0x7ffff2d4b480) at ../../gcc/gimple-range.= cc:187 #7 0x0000000001aa728a in gimple_ranger::range_on_edge (this=3D0x29069a0, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., e=3D0x7ffff325a720, name=3D0x7ffff2d4b480) at ../../gcc/gimple-range.c= c:233 #8 0x0000000001ab012f in fold_using_range::range_of_phi (this=3Dthis@entry=3D0x7ffffc0073af, r=3Dwarning: RTTI symbol not found for= class 'int_range<255u>' ..., phi=3Dphi@entry=3D0x7ffff2d4c100, src=3D...) at ../../gcc/value-range.= h:634 #9 0x0000000001ab2289 in fold_using_range::fold_stmt (this=3D0x7ffffc0073a= f, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., s=3D0x7ffff2d4c100, src=3D..., name=3D0x7ffff2d4b4c8) at ../../gcc/gimple-range-fold.cc:491 #10 0x0000000001aa5292 in gimple_ranger::fold_range_internal (name=3D0x7ffff2d4b4c8, s=3D0x7ffff2d4c100, r=3Dwarning: RTTI symbol not fo= und for class 'int_range<255u>' #11 gimple_ranger::range_of_stmt (this=3D0x29069a0, r=3Dwarning: RTTI symbo= l not found for class 'int_range<255u>' ..., s=3D0x7ffff2d4c100, name=3D) at ../../gcc/gimple-range.= cc:318 #12 0x0000000001aa3fbb in gimple_ranger::range_on_entry (this=3Dthis@entry=3D0x29069a0, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., bb=3D0x7ffff34b0900, name=3Dname@entry=3D0x7ffff2d4b4c8) at ../../gcc/gimple-range.cc:153 #13 0x0000000001aa6cff in gimple_ranger::range_of_expr (this=3D0x29069a0, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., expr=3D0x7ffff2d4b4c8, stmt=3D) at ../../gcc/gimple-range.cc:130 #14 0x0000000001aa418a in gimple_ranger::range_on_exit (this=3D0x29069a0, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., bb=3D0x7ffff34b0900, name=3D0x7ffff2d4b4c8) at ../../gcc/gimple-range.= cc:187 #15 0x0000000001aa728a in gimple_ranger::range_on_edge (this=3D0x29069a0, r=3Dwarning: RTTI symbol not found for class 'int_range<255u>' ..., e=3D0x7ffff325a840, name=3D0x7ffff2d4b4c8) at ../../gcc/gimple-range.c= c:233 [...] --Type for more, q to quit, c to continue without paging--c [...] #17640 0x0000000000de11bb in compile_file () at ../../gcc/toplev.cc:471 #17641 0x00000000006adb68 in do_compile (no_backend=3Dfalse) at ../../gcc/toplev.cc:2125 #17642 toplev::main (this=3Dthis@entry=3D0x7fffffffe296, argc=3D, argc@entry=3D6, argv=3D, argv@entry=3D0x7fffffffe3c8) at ../../gcc/toplev.cc:2277 #17643 0x00000000006af7cb in main (argc=3D6, argv=3D0x7fffffffe3c8) at ../../gcc/main.cc:39 The provided source code is a modified version of the original source code, which can be found at https://github.com/mbasaglia/glaxnimate/blob/master/src/gui/emoji/emoji_dat= a.[ch]pp. The only change made in this modified version is the substitution of QStri= ng with std::string. The compiler encounters a segmentation fault when proces= sing either version. The removal of approximately 400 emojis from the vector allows the source c= ode to be compiled successfully. I isolated the regression to commit e0324e2629e25a90c13c68b4eef1e47b091970c3 (r13-6566-ge0324e2629e25a90) using git bisect. I attempted to reproduce the issue with the trunk (r14-1922-g53953b6f31f18ac2), it appears that the issue does not occur there.=