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

Assertion due to unprocessed type info #26

Closed
oleid opened this issue Apr 12, 2024 · 2 comments
Closed

Assertion due to unprocessed type info #26

oleid opened this issue Apr 12, 2024 · 2 comments

Comments

@oleid
Copy link

oleid commented Apr 12, 2024

I just tried HEAD to check out the lastest changes and noticed I hit a recently introduced assert in typereader.rs.
Aparrently, there are still wip_items left. A quick hack

diff --git a/src/dwarf/typereader.rs b/src/dwarf/typereader.rs
index 3adfcf0..3f86923 100644
--- a/src/dwarf/typereader.rs
+++ b/src/dwarf/typereader.rs
@@ -45,6 +45,11 @@ impl<'elffile> DebugDataReader<'elffile> {
                         }
                         typereader_data.wip_items.clear();
                     }
+                    if !typereader_data.wip_items.is_empty()
+                    {
+                        println!("WARNING: Unprocessed type info, ignoring:\n{:?}", typereader_data.wip_items);
+                        typereader_data.wip_items.clear();
+                    }
                     assert_eq!(typereader_data.wip_items.len(), 0);
                 }
             }

yields:

WARNING: Unprocessed type info, ignoring:
[WipItemInfo { offset: 124267, name: Some("CAN_CONFIG"), tag: DwTag(22) }, WipItemInfo { offset: 124199, name: None, tag: DwTag(19) }, WipItemInfo { offset: 124340, name: None, tag: DwTag(15) }]
WARNING: Unprocessed type info, ignoring:
[WipItemInfo { offset: 124283, name: Some("CAN_MB_CONFIG"), tag: DwTag(22) }, WipItemInfo { offset: 124069, name: None, tag: DwTag(19) }, WipItemInfo { offset: 124340, name: None, tag: DwTag(15) }]
WARNING: Unprocessed type info, ignoring:
[WipItemInfo { offset: 498045, name: None, tag: DwTag(1) }, WipItemInfo { offset: 492863, name: Some("lwip_socket_multicast_pair"), tag: DwTag(19) }, WipItemInfo { offset: 497538, name: None, tag: DwTag(15) }, WipItemInfo { offset: 495412, name: Some("lwip_sock"), tag: DwTag(19) }, WipItemInfo { offset: 497550, name: None, tag: DwTag(15) }, WipItemInfo { offset: 493009, name: Some("netconn"), tag: DwTag(19) }]

I'm not really sure what's the issue here or if the items are required for something.

@DanielT
Copy link
Owner

DanielT commented Apr 12, 2024

Yes, I've made some fairly large changes to the typereader. It tries to extract much more info than it used to, in order to be able to support creating / updating of INSTANCEs and TYPEDEF_STRUCTUREs.

Reading types is a recursive procedure, since all member types are needed in order to fully specify a structure type, but those types might not be known yet. What you see here is that reading some types failed several recursion levels deep, and the information about the entire chain was lost.

Honestly, I had hoped that I had finally managed to make type reading robust enough that no information would be lost.
That's why this assertion exists.
Since that was clearly too ambitious, I will improve the error output for this case instead.

@oleid
Copy link
Author

oleid commented Apr 16, 2024

No more issue since #29, so this can be closed

@oleid oleid closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants