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

Fix a bunch of DWARF errors #89488

Merged
merged 4 commits into from
Jul 31, 2023
Merged

Conversation

MichalStrehovsky
Copy link
Member

I ran dwarfdump --verify on the object file we produce and noticed that a bunch of these overlapping ranges looks suspicious. Sure enough there is a trap that we fell into.

error: DIEs have overlapping address ranges:
0x0005a8e6: DW_TAG_catch_block [38]   (0x0005a85b)
              DW_AT_low_pc [DW_FORM_addr]       (0x0000000000065981 "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x0000000000000102)

0x0005a8d5: DW_TAG_try_block [37]   (0x0005a85b)
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000658bb "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x00000000000000d2)

error: DIE address ranges are not contained in its parent's ranges:
0x0005a85b: DW_TAG_subprogram [10] * (0x0000000b)
              DW_AT_specification [DW_FORM_ref4]        (cu + 0x2faae => {0x0002faae} "S_P_TypeLoader_System_Collections_Generic_LowLevelDictionary_2<System___Canon__System___Canon>__ExpandBuckets")
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000658a0 "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x0000000000000102)
              DW_AT_frame_base [DW_FORM_exprloc]        (DW_OP_reg6)
              DW_AT_object_pointer [DW_FORM_ref4]       (cu + 0x5a876 => {0x0005a876})

0x0005a8e6:   DW_TAG_catch_block [38]   (0x0005a85b)
                DW_AT_low_pc [DW_FORM_addr]     (0x0000000000065981 "__managedcode")
                DW_AT_high_pc [DW_FORM_data8]   (0x0000000000000102)

The only remaining errors that I see look like this:

error: DIEs have overlapping address ranges:
0x000367a4: DW_TAG_try_block [37]   (0x000366e5)
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000132f6 "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x000000000000016a)

0x00036782: DW_TAG_try_block [37]   (0x000366e5)
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000133ed "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x0000000000000069)

error: DIEs have overlapping address ranges:
...

We probably need to do something around CORINFO_EH_CLAUSE_SAMETRY.

Then we'll need to fix up our testing to look at object files because the final executable has a bunch of dwarf errors on things generated by clang - we should look at the object file instead.

Cc @dotnet/ilc-contrib

I ran `dwarfdump --verify` on the object file we produce and noticed that a bunch of these overlapping ranges looks suspicious. Sure enough there is a trap that we fell into.

```
error: DIEs have overlapping address ranges:
0x0005a8e6: DW_TAG_catch_block [38]   (0x0005a85b)
              DW_AT_low_pc [DW_FORM_addr]       (0x0000000000065981 "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x0000000000000102)

0x0005a8d5: DW_TAG_try_block [37]   (0x0005a85b)
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000658bb "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x00000000000000d2)

error: DIE address ranges are not contained in its parent's ranges:
0x0005a85b: DW_TAG_subprogram [10] * (0x0000000b)
              DW_AT_specification [DW_FORM_ref4]        (cu + 0x2faae => {0x0002faae} "S_P_TypeLoader_System_Collections_Generic_LowLevelDictionary_2<System___Canon__System___Canon>__ExpandBuckets")
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000658a0 "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x0000000000000102)
              DW_AT_frame_base [DW_FORM_exprloc]        (DW_OP_reg6)
              DW_AT_object_pointer [DW_FORM_ref4]       (cu + 0x5a876 => {0x0005a876})

0x0005a8e6:   DW_TAG_catch_block [38]   (0x0005a85b)
                DW_AT_low_pc [DW_FORM_addr]     (0x0000000000065981 "__managedcode")
                DW_AT_high_pc [DW_FORM_data8]   (0x0000000000000102)
```
@ghost
Copy link

ghost commented Jul 26, 2023

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

Issue Details

I ran dwarfdump --verify on the object file we produce and noticed that a bunch of these overlapping ranges looks suspicious. Sure enough there is a trap that we fell into.

error: DIEs have overlapping address ranges:
0x0005a8e6: DW_TAG_catch_block [38]   (0x0005a85b)
              DW_AT_low_pc [DW_FORM_addr]       (0x0000000000065981 "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x0000000000000102)

0x0005a8d5: DW_TAG_try_block [37]   (0x0005a85b)
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000658bb "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x00000000000000d2)

error: DIE address ranges are not contained in its parent's ranges:
0x0005a85b: DW_TAG_subprogram [10] * (0x0000000b)
              DW_AT_specification [DW_FORM_ref4]        (cu + 0x2faae => {0x0002faae} "S_P_TypeLoader_System_Collections_Generic_LowLevelDictionary_2<System___Canon__System___Canon>__ExpandBuckets")
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000658a0 "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x0000000000000102)
              DW_AT_frame_base [DW_FORM_exprloc]        (DW_OP_reg6)
              DW_AT_object_pointer [DW_FORM_ref4]       (cu + 0x5a876 => {0x0005a876})

0x0005a8e6:   DW_TAG_catch_block [38]   (0x0005a85b)
                DW_AT_low_pc [DW_FORM_addr]     (0x0000000000065981 "__managedcode")
                DW_AT_high_pc [DW_FORM_data8]   (0x0000000000000102)

The only remaining errors that I see look like this:

error: DIEs have overlapping address ranges:
0x000367a4: DW_TAG_try_block [37]   (0x000366e5)
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000132f6 "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x000000000000016a)

0x00036782: DW_TAG_try_block [37]   (0x000366e5)
              DW_AT_low_pc [DW_FORM_addr]       (0x00000000000133ed "__managedcode")
              DW_AT_high_pc [DW_FORM_data8]     (0x0000000000000069)

error: DIEs have overlapping address ranges:
...

We probably need to do something around CORINFO_EH_CLAUSE_SAMETRY.

Then we'll need to fix up our testing to look at object files because the final executable has a bunch of dwarf errors on things generated by clang - we should look at the object file instead.

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@MichalStrehovsky MichalStrehovsky marked this pull request as ready for review July 26, 2023 03:57
@MichalStrehovsky MichalStrehovsky merged commit 2422429 into dotnet:main Jul 31, 2023
@MichalStrehovsky MichalStrehovsky deleted the trylength branch July 31, 2023 08:02
@ghost ghost locked as resolved and limited conversation to collaborators Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants