public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/29343] New: [gdb/symtab] per_cu->length set without initial_length_size
Date: Sat, 09 Jul 2022 08:24:33 +0000	[thread overview]
Message-ID: <bug-29343-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 29343
           Summary: [gdb/symtab] per_cu->length set without
                    initial_length_size
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

I ran into a race condition for per_cu->length, and while investigating this I
noticed this particular requirement about length:
...
  /* The start offset and length of this compilation unit.                      
     NOTE: Unlike comp_unit_head.length, this length includes                   
     initial_length_size.                                                       
     If the DIE refers to a DWO file, this is always of the original die,       
     not the DWO file.  */
  sect_offset sect_off {};
  unsigned int length = 0;
...

Grepping through the sources shows 3 spots were this requirement is not met:
...
$ grep "cu->length = " gdb/dwarf2/read.c
  the_cu->length = length;
          this_cu->length = cu->header.get_length ();
            this_cu->length = cu->header.get_length ();
  this_cu->length = m_new_cu->header.get_length ();
      this_cu->length = cu_header.length + cu_header.initial_length_size;
...

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

             reply	other threads:[~2022-07-09  8:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09  8:24 vries at gcc dot gnu.org [this message]
2022-07-09  8:24 ` [Bug symtab/29343] " vries at gcc dot gnu.org
2022-07-09  8:34 ` vries at gcc dot gnu.org
2022-07-09  9:17 ` vries at gcc dot gnu.org
2022-07-11  9:40 ` vries at gcc dot gnu.org
2022-07-13  7:41 ` vries at gcc dot gnu.org
2022-07-13  7:42 ` [Bug symtab/29343] [gdb/symtab] c++-ify comp_unit_head vries at gcc dot gnu.org
2022-12-24 22:45 ` tromey at sourceware dot org
2022-12-25  8:25 ` vries at gcc dot gnu.org
2022-12-26 20:59 ` cvs-commit at gcc dot gnu.org
2022-12-26 21:03 ` tromey at sourceware dot org
2022-12-30 12:55 ` cvs-commit 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-29343-4717@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).