public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug macros/27754] Excessive CPU load and memory usage with -g3 debug info
Date: Tue, 11 May 2021 08:15:06 +0000	[thread overview]
Message-ID: <bug-27754-4717-SDDv7qryd0@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27754-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27754

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Tom Tromey from comment #9)
> (In reply to Richard Biener from comment #6)
> > The non-LTO .debug_macro has
> > 
> >  DW_MACRO_import - offset : 0x0
> >  DW_MACRO_end_file
> > 
> > as well, whatever that means.
> 
> The problem with LTO is that the output is pathological.
> For example I see this sequence:
> 
>  DW_MACRO_import - offset : 0x0
>  DW_MACRO_end_file
>  DW_MACRO_import - offset : 0x0
>  DW_MACRO_end_file
>  DW_MACRO_import - offset : 0x0
>  DW_MACRO_end_file
> 
> This says to import the macros from offset 0 three times in succession.
> While this is technically ok, it's also absurd.  Is this really
> intentional? This file imports the unit at offset 0x0 multiple times
> -- 108 in fact.

It does look odd.  It appears that it might be a bug with relocation
handling - the imports should be resolved from .rel[a].debug_macro.
I notice the imports at offset zero all appear at the "end" of
.debug_macro.  The first CU with offset zero imports is

  Offset:                      0x11f01
  Version:                     4
  Offset size:                 4
  Offset into .debug_line:     0xc814

Referred from

 <0><10d76>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <10d77>   DW_AT_producer    : (indirect string, offset: 0x5ea6c): GNU C++17 
10.3.0 -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -march=armv7-m -g3 -O3
-std=gnu+
+17 -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections
--param=max-i
nline-insns-single=500
    <10d7b>   DW_AT_language    : 4     (C++)
    <10d7c>   DW_AT_name        : (indirect string, offset: 0x5f012):
/home/rdie
z/rdiez/arduino/JtagDue/Project/BareMetalSupport/Miscellaneous.cpp
    <10d80>   DW_AT_comp_dir    : (indirect string, offset: 0x80ec4):
/home/rdie
z/rdiez/arduino/JtagDue/BuildOutput/JtagDue-obj-release
    <10d84>   DW_AT_stmt_list   : 0xc814
    <10d88>   DW_AT_GNU_macros  : 0x11f01

The exact same zero offset macro imports happen in the Debug non-LTO
firmware btw. (as said, .debug_macro is generate at compile, not at
link time).

That said, a smaller example to reproduce those repeated offset zero
imports would be nice to have.  Unfortunately "preprocessed source"
won't do it ...

It might be that GCC simply misses something here.

> We can probably work around it in gdb somehow.  My first thought is
> to have it simply skip multiple imports of the same unit.  This could
> in theory yield the wrong answer sometimes, though.
> 
> Looks vaguely related to bug#26303, in the "suspicious import" sense.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-05-11  8:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 16:03 [Bug gdb/27754] New: " rdiezmail-binutils at yahoo dot de
2021-04-19 16:04 ` [Bug gdb/27754] " rdiezmail-binutils at yahoo dot de
2021-04-19 17:02 ` dblaikie at gmail dot com
2021-04-19 17:07 ` psmith at gnu dot org
2021-04-23 18:38 ` tromey at sourceware dot org
2021-04-23 18:56 ` tromey at sourceware dot org
2021-04-23 20:31 ` rdiezmail-binutils at yahoo dot de
2021-04-23 20:52 ` dblaikie at gmail dot com
2021-05-06 11:13 ` rguenth at gcc dot gnu.org
2021-05-06 11:45 ` rdiezmail-binutils at yahoo dot de
2021-05-06 12:34 ` rdiezmail-binutils at yahoo dot de
2021-05-10 14:27 ` [Bug macros/27754] " tromey at sourceware dot org
2021-05-10 14:51 ` tromey at sourceware dot org
2021-05-10 20:30 ` tromey at sourceware dot org
2021-05-11  8:15 ` rguenth at gcc dot gnu.org [this message]
2021-05-11  8:19 ` jakub at redhat dot com
2021-05-12 20:37 ` simark at simark dot ca
2021-05-12 20:38 ` simark at simark dot ca
2021-05-13 17:20 ` tromey at sourceware dot org
2021-05-13 17:26 ` jakub at redhat dot com
2021-05-13 17:31 ` simark at simark dot ca
2021-12-21 21:25 ` rdiezmail-binutils at yahoo dot de
2021-12-21 21:26 ` rdiezmail-binutils at yahoo dot de
2021-12-22 20:27 ` ssbssa at sourceware dot org
2021-12-23  2:48 ` simark at simark dot ca
2021-12-23 16:36 ` ssbssa at sourceware dot org
2022-10-25 16:16 ` tromey at sourceware dot org
2022-10-25 16:16 ` tromey at sourceware dot org
2022-10-25 16:19 ` tromey at sourceware dot org
2022-10-25 16:43 ` rdiezmail-binutils at yahoo dot de
2022-10-25 16:58 ` rajpal.gusain at gmail dot com
2022-11-17 20:04 ` pedro at palves dot net
2022-11-18  2:24 ` tromey at sourceware dot 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-27754-4717-SDDv7qryd0@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.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).