public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "zoran.zaric at amd dot com" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug symtab/26813] New: DW_FORM_rnglistx and DW_FORM_loclistx not fully supported Date: Thu, 29 Oct 2020 17:30:03 +0000 [thread overview] Message-ID: <bug-26813-4717@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=26813 Bug ID: 26813 Summary: DW_FORM_rnglistx and DW_FORM_loclistx not fully supported Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: zoran.zaric at amd dot com Target Milestone: --- Created attachment 12929 --> https://sourceware.org/bugzilla/attachment.cgi?id=12929&action=edit Test application and gdb patch Gdb seems to be reporting an internal error when attributes of either DW_FORM_rnglistx or DW_FORM_loclistx form are found in DWARF. Both of these forms are part of the newest DWARF 5 standard, which support was only recently added to the gdb. Original problem was found on a application written in HIP language and compile using a Clang based compiler (version 11 or newer). Considering that HIP language and runtime is not everybody's cup of tea, I tried to find a C++ application that can reproduce an issue. I was lucky, and it seems that my old application, written to solving some logical problem from years ago, exposes the same bug. The bug will only show up if a compiler used is Clang 11 (or newer) and it doesn't seem to show up under gcc. To reproduce the issue, one just need to build the application using a simple make command. After that it needs to be run under the debugger without any arguments: $ tar -xf MagicPurse.tar.xz $ make $ gdb ./MagicPurse The reason I've have not tried to reduce the application is because it exposes multiple levels of bugs, and it seems useful to have the whole thing to make sure that we don't miss any unknown issues. I have debugged the reason behind the internal error and found that both of these forms are not properly processed when read. The attached archive also contains a small patch (dwarf-5-fix-WIP.patch) that deals with that problem. After applying the patch, another issue comes up where the DW_FORM_rnglistx form is not resolved properly. The problem seems to be in read_rnglist_index function. These new forms can have multiple headers inside of .debug_rnglist where the read_rnglist_index function only ever reads the first one. This results in an error message: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array ... My patch is based on 006811bc02fe28060a8557b1f17a129440c975d4 commit and it makes sense to me, but I am not that familiar with the mechanism behind reading the dwarf sections. -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2020-10-29 17:30 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-29 17:30 zoran.zaric at amd dot com [this message] 2020-10-29 17:33 ` [Bug symtab/26813] " zoran.zaric at amd dot com 2020-10-29 18:08 ` simark at simark dot ca 2020-10-30 14:22 ` tromey at sourceware dot org 2020-10-30 15:03 ` zoran.zaric at amd dot com 2020-10-30 18:21 ` simark at simark dot ca 2020-10-30 18:22 ` simark at simark dot ca 2020-10-30 19:03 ` simark at simark dot ca 2020-10-30 21:19 ` simark at simark dot ca 2020-11-02 15:57 ` simark at simark dot ca 2021-01-20 9:26 ` mliska at suse dot cz 2021-02-02 15:42 ` cvs-commit at gcc dot gnu.org 2021-02-02 15:43 ` cvs-commit at gcc dot gnu.org 2021-02-02 15:43 ` cvs-commit at gcc dot gnu.org 2021-02-02 15:43 ` cvs-commit at gcc dot gnu.org 2021-02-02 15:43 ` simark at simark dot ca 2021-02-03 19:17 ` cvs-commit at gcc dot gnu.org 2021-02-03 19:17 ` cvs-commit at gcc dot gnu.org 2021-02-03 19:17 ` cvs-commit at gcc dot gnu.org 2022-05-15 12:13 ` jeanmichael.celerier at gmail dot com 2022-05-15 14:33 ` tromey at sourceware dot org 2022-05-15 14:55 ` jeanmichael.celerier at gmail dot com 2022-05-15 15:09 ` tromey at sourceware dot org 2022-05-16 1:12 ` simark at simark dot ca
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-26813-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: linkBe 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).