public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tnfchris at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/107675] [13 Regression] GCC-13 is significantly slower to startup on C++ programs
Date: Mon, 14 Nov 2022 14:28:17 +0000	[thread overview]
Message-ID: <bug-107675-4-J1dIskqD2R@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107675-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> Does the binary and libstdc++.so have PT_GNU_EH_FRAME header including
> binary search table (readelf -Wl | grep GNU_EH_FRAME)?
> During startup I think there just shouldn't be any exceptions thrown or
> backtraces computed, so I'd think the FDEs should just be registered and
> nothing else.

Yes both do:

> ~/libstdcpp-test$ readelf -Wl ~/libstdcpp-test/gcc-trunk/lib64/libstdc++.so.6 | grep GNU_EH_FRAME
  GNU_EH_FRAME   0x1c5658 0x00000000001c5658 0x00000000001c5658 0x008e8c
0x008e8c R   0x4

> ~/libstdcpp-test$ readelf -Wl gcc-13-s.exe | grep GNU_EH_FRAME
  GNU_EH_FRAME   0x000724 0x0000000000400724 0x0000000000400724 0x000044
0x000044 R   0x4

also the difference seems more pronounced when statically linked.

(In reply to Florian Weimer from comment #3)
> Would you please put a breakpoint on fde_single_encoding_compare and report

for GCC-13 the trace is:

Reading symbols from ./gcc-13.exe...
(gdb) b fde_single_encoding_compare
Breakpoint 1 at 0x451630: file
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c, line 425.
(gdb) r
Starting program: ~/libstdcpp-test/gcc-13.exe

Breakpoint 1, fde_single_encoding_compare (ob=0x48cfe8 <object>, x=0x46d098,
y=0x46d084) at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c:425
425     /opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c: No such
file or directory.
(gdb) bt
#0  fde_single_encoding_compare (ob=0x48cfe8 <object>, x=0x46d098, y=0x46d084)
at /opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c:425
#1  0x0000000000451b8c in fde_split (erratic=<optimized out>, linear=<optimized
out>, fde_compare=<optimized out>, ob=<optimized out>) at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c:660
#2  end_fde_sort (count=793, accu=0xfffffffff200, ob=0x48cfe8 <object>) at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c:662
#3  init_object (ob=ob@entry=0x48cfe8 <object>) at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c:888
#4  0x00000000004520a8 in __register_frame_info_bases (dbase=0x0, tbase=0x0,
ob=0x48cfe8 <object>, begin=<optimized out>) at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c:130
#5  __register_frame_info_bases (dbase=0x0, tbase=0x0, ob=0x48cfe8 <object>,
begin=<optimized out>) at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c:111
#6  __register_frame_info (begin=<optimized out>, ob=0x48cfe8 <object>) at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c:150
#7  0x0000000000400798 in frame_dummy () at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-btree.h:361
#8  0x0000000000400f90 in __libc_csu_init () at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-btree.h:361
#9  0x0000000000400a78 in __libc_start_main () at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-btree.h:361
#10 0x0000000000400688 in _start () at
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-btree.h:361

In GCC-12 it looks like this isn't called at all:

Reading symbols from ./gcc-12.exe...
(gdb) b fde_single_encoding_compare
Breakpoint 1 at 0x4503c0: file
/opt/buildAgent/work/5c94c4ced6ebfcd0/libgcc/unwind-dw2-fde.c, line 380.
(gdb) r
Starting program: ~/libstdcpp-test/gcc-12.exe
Hello world
[Inferior 1 (process 1580999) exited normally]

> the backtrace? Which target are you testing?

Testing aarch64-none-linux-gnu

  parent reply	other threads:[~2022-11-14 14:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 13:03 [Bug libstdc++/107675] New: " tnfchris at gcc dot gnu.org
2022-11-14 13:09 ` [Bug libstdc++/107675] " tnfchris at gcc dot gnu.org
2022-11-14 13:20 ` jakub at gcc dot gnu.org
2022-11-14 13:27 ` fw at gcc dot gnu.org
2022-11-14 14:28 ` tnfchris at gcc dot gnu.org [this message]
2022-11-14 17:54 ` pinskia at gcc dot gnu.org
2022-11-14 17:55 ` pinskia at gcc dot gnu.org
2022-11-17 11:04 ` tnfchris at gcc dot gnu.org
2022-11-17 11:15 ` fw at gcc dot gnu.org
2022-11-17 11:24 ` tnfchris at gcc dot gnu.org
2022-11-20 23:57 ` tnfchris at gcc dot gnu.org
2022-11-20 23:58 ` [Bug libgcc/107675] " tnfchris at gcc dot gnu.org
2022-11-22  9:35 ` tnfchris at gcc dot gnu.org
2022-12-09 19:56 ` [Bug libgcc/107675] [13 Regression] GCC-13 is significantly slower to startup on C++ statically linked programs m.cencora at gmail dot com
2022-12-09 22:46 ` tneumann at users dot sourceforge.net
2022-12-16 23:55 ` tneumann at users dot sourceforge.net
2022-12-20 15:38 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107675-4-J1dIskqD2R@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).