public inbox for
 help / color / mirror / Atom feed
From: Yichao Yu <>
Subject: Suspected bug in DW_OP_addr handling
Date: Fri, 6 May 2022 23:54:19 -0400	[thread overview]
Message-ID: <> (raw)

I noticed that gdb unwind failed with read of invalid memory address
when I used `DW_OP_addr` in my unwind info. Upon checking, it seems
that the handling of this operation in the dwarf interpreter is very

The interpreter for the op code has a comment[1] sayijng,

> Some versions of GCC emit DW_OP_addr before
> DW_OP_GNU_push_tls_address. In this case the value is an
> index, not an address.

However, the code appears to check for exactly the opposite condition
`op_ptr >= op_end || *op_ptr != DW_OP_GNU_push_tls_address` to decide
whether the result should be used as index. This was added 12 years
ago in commit ac56253ddece [2].

Am I missing something or is this a long-standing bug?



             reply	other threads:[~2022-05-07  3:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-07  3:54 Yichao Yu [this message]
2022-05-08 17:25 ` Simon Marchi
2022-05-09 14:03   ` Yichao Yu

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:

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

  git send-email \ \ \ \

* 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).