-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[LLDB][Minidump] Fix bug where we were using the wrong collection for thread stacks #110579
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
Conversation
@llvm/pr-subscribers-lldb Author: Jacob Lalonde (Jlalond) ChangesIn my prior two save core API's, I experimented on how to save stacks with the new API. I incorrectly left these in, as the existing I have removed the no-op collection, and moved to use the proper one. It's worth noting this was not caught by testing because we do not verify where the items are contained in the minidump. This would require a test being aware of how minidumps are structured, or adding a textual tool that we can then scan the output of. Full diff: https://github.com/llvm/llvm-project/pull/110579.diff 2 Files Affected:
diff --git a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
index 3f1e25f730a184..f6c16b6e3d96ae 100644
--- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
+++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
@@ -853,7 +853,7 @@ Status MinidumpFileBuilder::AddMemoryList() {
uint64_t total_size = GetCurrentDataEndOffset();
auto iterator = all_core_memory_vec.begin();
while (iterator != all_core_memory_vec.end()) {
- if (m_saved_stack_ranges.count(iterator->range.start()) > 0) {
+ if (m_thread_by_range_end.count(iterator->range.end()) > 0) {
// We don't save stacks twice.
ranges_32.push_back(*iterator);
total_size +=
diff --git a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h
index d5eac9015ac422..a4240f871c8a2f 100644
--- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h
+++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h
@@ -172,7 +172,6 @@ class MinidumpFileBuilder {
// to duplicate it in the exception data.
std::unordered_map<lldb::tid_t, llvm::minidump::LocationDescriptor>
m_tid_to_reg_ctx;
- std::unordered_set<lldb::addr_t> m_saved_stack_ranges;
lldb::FileUP m_core_file;
lldb_private::SaveCoreOptions m_save_core_options;
};
|
This is my main suspect for this failure in Green Dragon: https://green.lab.llvm.org/job/llvm.org/job/llvm-coverage/64/consoleFull Relevant test output:
|
That failure was caused by #110355 and has been reverted earlier today |
… thread stacks (llvm#110579) In my prior two save core API's, I experimented on how to save stacks with the new API. I incorrectly left these in, as the existing `m_thread_by_range_end` was the correct choice. I have removed the no-op collection, and moved to use the proper one. It's worth noting this was not caught by testing because we do not verify where the items are contained in the minidump. This would require a test being aware of how minidumps are structured, or adding a textual tool that we can then scan the output of.
In my prior two save core API's, I experimented on how to save stacks with the new API. I incorrectly left these in, as the existing
m_thread_by_range_end
was the correct choice.I have removed the no-op collection, and moved to use the proper one. It's worth noting this was not caught by testing because we do not verify where the items are contained in the minidump. This would require a test being aware of how minidumps are structured, or adding a textual tool that we can then scan the output of.