<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello lldb developers, I am running into a problem with lldb on Linux.  I am currently running llvm 6.0.0.<div class=""><br class=""></div><div class="">I have an executable that dynamically loads a large number of shared libraries at runtime.  These are explicitly loaded via dlopen (they are specified in a configuration file), and after loading a few (typically a dozen or so, but the number varies) lldb will halt during dlopen.  If I continue, it will load a few more then halt again, which makes debugging from startup impractical since there are so many libraries to be loaded (more than a hundred of them).</div><div class=""><br class=""></div><div class="">When I build and debug this same C++ on macOS, the debugger works fine.  I have verified that target.process.stop-on-sharedlibrary-events is false. I turned on dyld logging and I see lots of log messages about RendezvousBreakpoint being hit, but I don’t see anything that sheds light on why some libraries load without stopping but others don’t.</div><div class=""><br class=""></div><div class="">I have tried to recreate this in a trivial program that calls dlopen in a loop, but haven’t been able to reproduce.</div><div class=""><br class=""></div><div class="">Can your offer any suggestions for further debugging this?  More supporting evidence follows.</div><div class=""><br class=""></div><div class="">Here is the message when the debugger stops:</div><div class=""><br class=""></div><div class=""><div class="">Process 120004 stopped</div><div class="">* thread #1, name = ‘xxxxxxxx', stop reason = trace</div><div class="">    frame #0: 0x00002aaaacfca6a0 libc.so.6`__restore_rt</div><div class="">libc.so.6`__restore_rt:</div><div class="">->  0x2aaaacfca6a0 <+0>: movq   $0xf, %rax</div><div class="">    0x2aaaacfca6a7 <+7>: syscall </div><div class="">    0x2aaaacfca6a9 <+9>: nopl   (%rax)</div><div class=""><br class=""></div><div class="">libc.so.6`__libc_sigaction:</div><div class="">    0x2aaaacfca6b0 <+0>: subq   $0xd0, %rsp</div><div class=""><br class=""></div><div class="">I do not have the stop on shared library events setting enabled:</div><div class=""><br class=""></div><div class=""><div class="">(lldb) settings show target.process.stop-on-sharedlibrary-events</div><div class="">target.process.stop-on-sharedlibrary-events (boolean) = false</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">The backtrace goes back to dlopen:</div><div class=""><br class=""></div><div class=""><div class="">(lldb) bt</div><div class="">* thread #1, name = ‘xxxxx', stop reason = trace</div><div class="">  * frame #0: 0x00002aaaacfca6a0 libc.so.6`__restore_rt</div><div class="">    frame #1: 0x00002aaaaaab9eb0 ld-linux-x86-64.so.2</div><div class="">    frame #2: 0x00002aaaaaabdc53 ld-linux-x86-64.so.2`dl_open_worker + 499</div><div class="">    frame #3: 0x00002aaaaaab9286 ld-linux-x86-64.so.2`_dl_catch_error + 102</div><div class="">    frame #4: 0x00002aaaaaabd63a ld-linux-x86-64.so.2`_dl_open + 186</div><div class="">    frame #5: 0x00002aaaac39df66 libdl.so.2`dlopen_doit + 102</div><div class="">    frame #6: 0x00002aaaaaab9286 ld-linux-x86-64.so.2`_dl_catch_error + 102</div><div class="">    frame #7: 0x00002aaaac39e29c libdl.so.2`_dlerror_run + 124</div><div class="">    frame #8: 0x00002aaaac39dee1 libdl.so.2`__dlopen_check + 49</div></div><div class=""><br class=""></div><div class="">the dyld debug log has a lot of this:</div><div class=""><div class="">209 intern-state     DynamicLoaderPOSIXDYLD::RendezvousBreakpointHit pid 153501 stop_when_images_change=false</div><div class="">210 intern-state     DynamicLoaderPOSIXDYLD::RendezvousBreakpointHit called for pid 153501</div><div class="">211 intern-state     DYLDRendezvous::Resolve address size: 8, padding 4</div><div class="">212 intern-state     DYLDRendezvous::Resolve cursor = 0x2aaaaaccc160</div><div class="">213 intern-state     DynamicLoaderPOSIXDYLD::RendezvousBreakpointHit pid 153501 stop_when_images_change=false</div><div class="">214 intern-state     DynamicLoaderPOSIXDYLD::RendezvousBreakpointHit called for pid 153501</div><div class="">215 intern-state     DYLDRendezvous::Resolve address size: 8, padding 4</div><div class="">216 intern-state     DYLDRendezvous::Resolve cursor = 0x2aaaaaccc160</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">thanks,</div><div class="">--steve</div><div class=""><br class=""></div><div class=""><br class=""><div class="">
<div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 14px; font-family: "Apple Garamond"; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="color: rgb(237, 113, 158); font-family: "Lucida Grande";" class=""></span><span style="color: rgb(55, 69, 245); -webkit-text-stroke-color: rgb(55, 69, 245);" class=""><i class=""> </i></span><i class="">In the woods too, a man casts off his years, as the snake his slough, and at what period soever of life, is always a child.</i></div><div class=""><br class=""></div></div></div></div></div></div></div></div></div><br class="Apple-interchange-newline">
</div>
<br class=""></div></div></body></html>