Skip to content

feat(test): Add DWARF_VERIFY flag on DWARF tests#13754

Merged
RazvanN7 merged 2 commits intodlang:masterfrom
ljmf00:add-dwarf-verify-test
Mar 8, 2022
Merged

feat(test): Add DWARF_VERIFY flag on DWARF tests#13754
RazvanN7 merged 2 commits intodlang:masterfrom
ljmf00:add-dwarf-verify-test

Conversation

@ljmf00
Copy link
Member

@ljmf00 ljmf00 commented Mar 4, 2022

The other tests are disabled because of inconsistency with DWARF4/5 and .debug_aranges section.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ljmf00!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#13754"

@ljmf00
Copy link
Member Author

ljmf00 commented Mar 4, 2022

This still requires some changes on .debug_line about DW_AT_stmt_list bounds to succeed.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
@ljmf00 ljmf00 force-pushed the add-dwarf-verify-test branch from d2f891c to ed2fa9b Compare March 5, 2022 03:28
@ljmf00 ljmf00 marked this pull request as ready for review March 6, 2022 21:32
@ljmf00
Copy link
Member Author

ljmf00 commented Mar 6, 2022

Why global variables are shared in FreeBSD? CI fails:

[RUN] 'llvm-dwarfdump' '--verify' 'test_results/dshell/dwarf/fix21154'
Verifying test_results/dshell/dwarf/fix21154:	file format ELF64-x86-64
Verifying .debug_abbrev...
Verifying .debug_info Unit Header Chain...
error: DIE has DW_AT_type with incompatible tag DW_TAG_shared_type
0x00000097: DW_TAG_variable
              DW_AT_name	("fix21154.i")
              DW_AT_type	(0x00000092 "shared int")
              DW_AT_external	(0x01)
              DW_AT_location	(DW_OP_addr 0x600d90)
Verifying .debug_info references...
Verifying .debug_types Unit Header Chain...
Errors detected.

@ljmf00 ljmf00 force-pushed the add-dwarf-verify-test branch 11 times, most recently from 570692d to 75a7868 Compare March 7, 2022 15:00
@ljmf00
Copy link
Member Author

ljmf00 commented Mar 7, 2022

Why global variables are shared in FreeBSD? CI fails:

[RUN] 'llvm-dwarfdump' '--verify' 'test_results/dshell/dwarf/fix21154'
Verifying test_results/dshell/dwarf/fix21154:	file format ELF64-x86-64
Verifying .debug_abbrev...
Verifying .debug_info Unit Header Chain...
error: DIE has DW_AT_type with incompatible tag DW_TAG_shared_type
0x00000097: DW_TAG_variable
              DW_AT_name	("fix21154.i")
              DW_AT_type	(0x00000092 "shared int")
              DW_AT_external	(0x01)
              DW_AT_location	(DW_OP_addr 0x600d90)
Verifying .debug_info references...
Verifying .debug_types Unit Header Chain...
Errors detected.

Fixed. FreeBSD 11 uses an older version of llvm. Updated to LLVM 12.0. I still can't understand why global variables are always shared.

@ljmf00 ljmf00 force-pushed the add-dwarf-verify-test branch 2 times, most recently from 74a133f to aa7ad8e Compare March 7, 2022 21:00
DWARF readers and debuggers tend to ignore errors and try to proceed as much as
possible. objdump dumping the tags, doesn't necessarily mean that the DWARF
abbreviations are correct -- e.g. the reader could halt in the end, with the
last abbreviation, in which the output test can't verify. Introducing a DWARF
verifier is a good way to check conformancy with the standard.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
@ljmf00 ljmf00 force-pushed the add-dwarf-verify-test branch from aa7ad8e to ece7ea7 Compare March 7, 2022 23:40
@RazvanN7
Copy link
Contributor

RazvanN7 commented Mar 8, 2022

The other tests are disabled because of inconsistency with DWARF4/5 and .debug_aranges section.

Are those going to be re-enabled at some point?

@ljmf00
Copy link
Member Author

ljmf00 commented Mar 8, 2022

The other tests are disabled because of inconsistency with DWARF4/5 and .debug_aranges section.

Are those going to be re-enabled at some point?

Yes.

@RazvanN7 RazvanN7 merged commit 1bec274 into dlang:master Mar 8, 2022
@ljmf00
Copy link
Member Author

ljmf00 commented Mar 8, 2022

Why global variables are shared in FreeBSD? CI fails:

[RUN] 'llvm-dwarfdump' '--verify' 'test_results/dshell/dwarf/fix21154'
Verifying test_results/dshell/dwarf/fix21154:	file format ELF64-x86-64
Verifying .debug_abbrev...
Verifying .debug_info Unit Header Chain...
error: DIE has DW_AT_type with incompatible tag DW_TAG_shared_type
0x00000097: DW_TAG_variable
              DW_AT_name	("fix21154.i")
              DW_AT_type	(0x00000092 "shared int")
              DW_AT_external	(0x01)
              DW_AT_location	(DW_OP_addr 0x600d90)
Verifying .debug_info references...
Verifying .debug_types Unit Header Chain...
Errors detected.

Fixed. FreeBSD 11 uses an older version of llvm. Updated to LLVM 12.0. I still can't understand why global variables are always shared.

@RazvanN7 Perhaps this is something that could have some attention, or is it an ABI requirement?

@RazvanN7
Copy link
Contributor

RazvanN7 commented Mar 8, 2022

I have no clue.

@ljmf00
Copy link
Member Author

ljmf00 commented Mar 8, 2022

I have no clue.

Who can we tag to clarify this? Is there any FreeBSD maintainer? I doubt the global variables are shared otherwise, some code wouldn't work as expected. Can be a DWARF issue, but I can't relate any FreeBSD specific code that does this, so I'm a bit confused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants