[Lldb-commits] [PATCH] D68096: Add Linux signal support to ProcessMinidump
Joseph Tremoulet via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Sep 26 12:28:14 PDT 2019
JosephTremoulet added a comment.
I'm trying to fix an issue where opening a minidump created by breakpad in lldb just hangs, but if I use breakpad's minidump-2-core on that same dump then opening the core dump works fine. From debugging the two cases I can see that the critical logic that ProcessElfCore has which ProcessMinidump lacks is here <https://github.com/llvm/llvm-project/blob/f1a5a93157b4658c7961b57960e407001dae6965/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp#L227-L229>, and the code in this patch is my attempt to replicate that.
I'd love some help on how to create an appropriate test for this. From looking at existing tests, I gather it would make sense to add a test to lldb/lit/Minidump or packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new (aside: what's the difference? is one preferred?) that has a yaml-ized minidump, the test would try to open the dump and make sure it didn't hang. I'm running into issues when I try to create that test, and I've put details in a gist <https://gist.github.com/JosephTremoulet/2689c5ed21d7be5543cfcb70d548e0bc>. There's a program <https://gist.github.com/JosephTremoulet/2689c5ed21d7be5543cfcb70d548e0bc#file-test-cpp> there which launches another program <https://gist.github.com/JosephTremoulet/2689c5ed21d7be5543cfcb70d548e0bc#file-busyloop-cpp> and then uses breakpad to capture a minidump of the child process (another aside: it looks like the existing tests all dump their own process, I think that dumping another process is the reason I'm running into this but others haven't). If I load that minidump without the fixes in this patch, lldb hangs. If I load that minidump with the fixes in this patch, lldb reads it and can show an accurate backtrace, I've put a log <https://gist.github.com/JosephTremoulet/2689c5ed21d7be5543cfcb70d548e0bc#file-loading_dump-txt> of that in the gist. But if I then run that minidump through obj-2-yaml and yaml-2-obj, if I load the resulting minidump, while it doesn't hang, it can't show an accurate backtrace. I've also put up a log <https://gist.github.com/JosephTremoulet/2689c5ed21d7be5543cfcb70d548e0bc#file-loading_dump_after_yaml_roundtrip-txt> of that.
I'd imagine my next step would be to look into what information is getting dropped when I try to do the round-trip through obj-2-yaml and yaml-2-obj, then update those utilities to preserve more, so that I can come back and add this test with a yaml input... does that sound right, or have I gone off track somewhere?
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the lldb-commits