Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug/pe: reading debug_info section of PE files that use the DWARF5 form DW_FORM_line_strp causes error #49590

Closed
aarzilli opened this issue Nov 15, 2021 · 8 comments

Comments

@aarzilli
Copy link
Contributor

Trying to read debug_info sections in PE files that use the form DW_FORM_line_strp will return the error decoding dwarf section line_str at offset 0x0: underflow.

@gopherbot
Copy link

Change https://golang.org/cl/363894 mentions this issue: debug/dwarf: better error message when reading absent debug_line_str

@gopherbot
Copy link

Change https://golang.org/cl/363895 mentions this issue: debug/pe,debug/macho: add support for DWARF5 sections

@LomikXP
Copy link

LomikXP commented Nov 15, 2021

We need fix in 1.16 too!

gopherbot pushed a commit that referenced this issue Nov 15, 2021
When a DW_FORM_line_strp is used without a debug_line_str section a
good error message (about the missing section) is generated but
immediately overwritten by the underflow error generated by trying to
read the non-existent section.

Updates #49590

Change-Id: I1c431392123a86c78c95ef1f185ebd6f17f2476a
Reviewed-on: https://go-review.googlesource.com/c/go/+/363894
Run-TryBot: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Trust: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
@bearsh
Copy link

bearsh commented Jan 20, 2022

any change to get this backported? AFAIK otherwise debugging does not work if the application needs gcc to build and gcc is >=11

@ianlancetaylor
Copy link
Contributor

@gopherbot Please open backport issues.

This change is reportedly required on Windows systems using current versions of GCC.

@gopherbot
Copy link

Backport issue(s) opened: #50721 (for 1.16), #50722 (for 1.17).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@gopherbot
Copy link

Change https://golang.org/cl/379914 mentions this issue: [release-branch.go1.17] debug/pe,debug/macho: add support for DWARF5 sections

@gopherbot
Copy link

Change https://golang.org/cl/379915 mentions this issue: [release-branch.go1.16] debug/pe,debug/macho: add support for DWARF5 sections

gopherbot pushed a commit that referenced this issue Feb 3, 2022
…sections

Adds the same logic used in debug/elf to load DWARF5 sections.

For #49590
Fixes #50721

Change-Id: Iee05b9927a6f521842b330eab8942ade3fc2bd86
Reviewed-on: https://go-review.googlesource.com/c/go/+/363895
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Than McIntosh <thanm@google.com>
(cherry picked from commit 6c36c33)
Reviewed-on: https://go-review.googlesource.com/c/go/+/379915
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
gopherbot pushed a commit that referenced this issue Feb 3, 2022
…sections

Adds the same logic used in debug/elf to load DWARF5 sections.

For #49590
Fixes #50722

Change-Id: Iee05b9927a6f521842b330eab8942ade3fc2bd86
Reviewed-on: https://go-review.googlesource.com/c/go/+/363895
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Than McIntosh <thanm@google.com>
(cherry picked from commit 6c36c33)
Reviewed-on: https://go-review.googlesource.com/c/go/+/379914
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
@golang golang locked and limited conversation to collaborators Jan 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants