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

gdb fails to load debug symbols for NAOT-ed executable in release mode #78210

Closed
WhiteBlackGoose opened this issue Nov 11, 2022 · 6 comments
Closed

Comments

@WhiteBlackGoose
Copy link
Contributor

WhiteBlackGoose commented Nov 11, 2022

Description

Error:

Reading symbols from ./Repro...
Dwarf Error: Could not find abbrev number 297120 in CU at offset 0x0 [in module /home/goose/trash/bgbug/Repro/publish-output-release/Repro]
(No debugging symbols found in ./Repro)

It read successfully when using debug mode.

Reproduction Steps

1. Create an empty console project

dotnet new console -n Repro && cd Repro

2. Create a build script (for convenience)

#!/bin/bash
dotnet publish \
-r linux-x64 \
-c $1 \
-o ./publish-output-$1 \
-p:SelfContained=true \
-p:PublishAot=true

3. Build for debug and release

./build debug && ./build release

4. Run gdb for both

For release

$ gdb ./publish-output-release/Repro
Reading symbols from ./publish-output-release/Repro...
Dwarf Error: Could not find abbrev number 297120 in CU at offset 0x0 [in module /home/goose/trash/bgbug/Repro/publish-output-release/Repro]
(No debugging symbols found in ./publish-output-release/Repro)
(gdb) 

For debug

$ gdb ./publish-output-debug/Repro
Reading symbols from ./publish-output-debug/Repro...
(gdb) 

Expected behavior

The symbols are there since I didn't strip them out, so I expect them to have been read.

Actual behavior

Fails with error

Dwarf Error: Could not find abbrev number 297120 in CU at offset 0x0 [in module /home/goose/trash/bgbug/Repro/publish-output-release/Repro]

Regression?

No response

Known Workarounds

No response

Configuration

  1. .NET 7.0.100
  2. linux-x64 (uname -v: 1 SMP Debian 5.10.140-1 (2022-09-02))
  3. amd64 (x86 64)
  4. I don't know if it's specific to my configuration

Other information

$ gdb --version
GNU gdb (Debian 12.1-4) 12.1
$ gcc --version
gcc (Debian 12.2.0-9) 12.2.0
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 11, 2022
@ghost
Copy link

ghost commented Nov 11, 2022

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Error:

Reading symbols from ./Repro...
Dwarf Error: Could not find abbrev number 297120 in CU at offset 0x0 [in module /home/goose/trash/bgbug/Repro/publish-output-release/Repro]
(No debugging symbols found in ./Repro)

It read successfully when using debug mode.

Reproduction Steps

1. Create an empty console project

dotnet new console -n Repro && cd Repro

2. Create a build script (for convenience)

#!/bin/bash
dotnet publish \
-r linux-x64 \
-c $1 \
-o ./publish-output-$1 \
-p:SelfContained=true \
-p:PublishAot=true

3. Build for debug and release

./build debug && ./build release

4. Run gdb for both

For release

$ gdb ./publish-output-release/Repro
Reading symbols from ./publish-output-release/Repro...
Dwarf Error: Could not find abbrev number 297120 in CU at offset 0x0 [in module /home/goose/trash/bgbug/Repro/publish-output-release/Repro]
(No debugging symbols found in ./publish-output-release/Repro)
(gdb) 

For debug

$ gdb ./publish-output-debug/Repro
Reading symbols from ./publish-output-debug/Repro...
(gdb) 

Expected behavior

The symbols are there since I didn't strip them out, so I expect them to have been read.

Actual behavior

Fails with error

Dwarf Error: Could not find abbrev number 297120 in CU at offset 0x0 [in module /home/goose/trash/bgbug/Repro/publish-output-release/Repro]

Regression?

No response

Known Workarounds

No response

Configuration

  1. .NET 7.0.100
  2. linux-x64 (uname -v: 1 SMP Debian 5.10.140-1 (2022-09-02))
  3. amd64 (x86 64)
  4. I don't know if it's specific to my configuration

Other information

$ gdb --version | head -n 1 | ci
GNU gdb (Debian 12.1-4) 12.1
$ gcc --version
gcc (Debian 12.2.0-9) 12.2.0
Author: WhiteBlackGoose
Assignees: -
Labels:

area-Diagnostics-coreclr

Milestone: -

@kant2002
Copy link
Contributor

can you post infromation about project settings related to globalization, and is this issue reproduces on hello world for you, or on specific code only?

@WhiteBlackGoose
Copy link
Contributor Author

To clarify for others: it is being reproduced on a minimal project (see first step: dotnet new console).
I target net7.0

@ghost
Copy link

ghost commented Nov 11, 2022

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Error:

Reading symbols from ./Repro...
Dwarf Error: Could not find abbrev number 297120 in CU at offset 0x0 [in module /home/goose/trash/bgbug/Repro/publish-output-release/Repro]
(No debugging symbols found in ./Repro)

It read successfully when using debug mode.

Reproduction Steps

1. Create an empty console project

dotnet new console -n Repro && cd Repro

2. Create a build script (for convenience)

#!/bin/bash
dotnet publish \
-r linux-x64 \
-c $1 \
-o ./publish-output-$1 \
-p:SelfContained=true \
-p:PublishAot=true

3. Build for debug and release

./build debug && ./build release

4. Run gdb for both

For release

$ gdb ./publish-output-release/Repro
Reading symbols from ./publish-output-release/Repro...
Dwarf Error: Could not find abbrev number 297120 in CU at offset 0x0 [in module /home/goose/trash/bgbug/Repro/publish-output-release/Repro]
(No debugging symbols found in ./publish-output-release/Repro)
(gdb) 

For debug

$ gdb ./publish-output-debug/Repro
Reading symbols from ./publish-output-debug/Repro...
(gdb) 

Expected behavior

The symbols are there since I didn't strip them out, so I expect them to have been read.

Actual behavior

Fails with error

Dwarf Error: Could not find abbrev number 297120 in CU at offset 0x0 [in module /home/goose/trash/bgbug/Repro/publish-output-release/Repro]

Regression?

No response

Known Workarounds

No response

Configuration

  1. .NET 7.0.100
  2. linux-x64 (uname -v: 1 SMP Debian 5.10.140-1 (2022-09-02))
  3. amd64 (x86 64)
  4. I don't know if it's specific to my configuration

Other information

$ gdb --version
GNU gdb (Debian 12.1-4) 12.1
$ gcc --version
gcc (Debian 12.2.0-9) 12.2.0
Author: WhiteBlackGoose
Assignees: -
Labels:

area-Diagnostics-coreclr, untriaged, area-NativeAOT-coreclr

Milestone: -

@agocke
Copy link
Member

agocke commented Nov 11, 2022

Dup of #77407. I'm looking into it but haven't gotten very far. Something about the DWARF info is definitely busted. I'm closing this one in favor of the first.

@agocke agocke closed this as completed Nov 11, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Nov 11, 2022
@WhiteBlackGoose
Copy link
Contributor Author

If something I can test on my side, let me know

@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2022
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

4 participants