<div dir="ltr">I was able to boil down a repro that has nothing to do with my project, woo hoo!<div>Put a break at the print statement and run. When it hits the break point LLDBFrontend crashes.</div><div>The do/catch seems to be necessary to trigger the crash</div><div><br></div><div>Swift 4.0 release</div><div>Ubuntu 16.04</div><div><br></div><div>Ed<br><div><br></div><div>----------------------------</div><div><div>import Foundation</div><div><br></div><div>public class SomeClass { }</div><div><br></div><div>public struct SomeStruct {</div><div> public weak var someClass: SomeClass?</div><div>}</div><div><br></div><div>do {</div><div> let data = SomeStruct()</div><div><br></div><div> print("break here")</div><div>} catch {</div><div> print(String(describing: error))</div><div>}</div></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 13, 2017 at 10:21 AM, Edward Connell via swift-users <span dir="ltr"><<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><div dir="ltr"><span style="font-size:12.8px">Hi Michael,</span><div style="font-size:12.8px">Thanks, I created and attached a log for you with "types" and "expressions" enabled</div><div style="font-size:12.8px">I set a breakpoint right before calling the function that triggers the crash, enabled logging, then continued. I was trying to reduce the amount of log output to sift through.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">This was run with the Swift 4.0 release version</div><div style="font-size:12.8px">Let me know if you want me to try anything else.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks, Ed</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div></div></span><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Oct 12, 2017 at 11:13 AM, Michael Gottesman <span dir="ltr"><<a href="mailto:mgottesman@apple.com" target="_blank">mgottesman@apple.com</a>></span> wrote:<br></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I just added a section to ./docs/DebuggingTheCompiler.rs<wbr>t on how to get enable logging from LLDB.<div><br></div><div>Can you enable the logging there and add file an SR?</div><div><br></div><div>Michael</div><div><br><div><div><blockquote type="cite"><div>On Oct 7, 2017, at 11:27 AM, Edward Connell <<a href="mailto:ewconnell@gmail.com" target="_blank">ewconnell@gmail.com</a>> wrote:</div><br class="m_-2179302737174038848m_-6406537339308252266Apple-interchange-newline"><div><div dir="ltr">Hi Michael,<div>No I am not evaluating an expression or anything. This all worked fine in past builds.</div><div><br></div><div>I simply set a breakpoint in a function and after stopping while gathering values for the debugger view, it crashes.</div><div><br></div><div>It doesn't crash in all functions, but it does crash when trying to stop in many different functions.</div><div>An example function signature where it crashes is (DataView is a concrete struct):<br></div><div><br></div><div><div>public func setupForward(mode: EvaluationMode, inData: DataView, labels: DataView?,</div><div><span style="white-space:pre-wrap">        </span> outData: inout DataView, backData: inout DataView?) throws { ... }</div></div><div><br></div><div>Before calling the function, all of the parameters have valid values that I can examine. But as soon as I step into this function, LLDB crashes with that message. It behaves the same way with other functions that have different signatures.</div><div><br></div><div>I tried to create a very simple repro case using this signature, but it didn't crash. My project is on GitHub and this can be easily reproduced. The only pain is installing my project on your test machine.</div><div><br></div><div>Ubuntu 16.04</div><div>Swift 4.0 release</div><div>NVidia gpu</div><div>Netlib <a href="https://github.com/ewconnell/Netlib/wiki#installation" target="_blank">https://github.com/ewco<wbr>nnell/Netlib/wiki#installation</a></div><div>CLion IDE with Swift plugin</div><div><br></div><div>1) do a debug build</div><div>2) set a breakpoint at CudaSoftmax.swift:44 or any line in the function</div><div>3) run</div><div>4) when it stops LLDBFrontend crashes</div><div><br></div><div><div><i>LLDBFrontend: /home/buildnode/jenkins/worksp<wbr>ace/oss-swift-4.0-package-<wbr>linux-ubuntu-16_04/swift/lib/<wbr>SILOptimizer/Mandatory/AccessE<wbr>nforcementSelection.cpp:613: (anonymous namespace)::SourceAccess (anonymous namespace)::AccessEnforcementS<wbr>election::getSourceAccess(<wbr>swift::SILValue): Assertion `isa<AllocStackInst>(address) || isa<SILUndef>(address)' failed.</i></div><div><i>Stack dump:</i></div><div><i>0.<span style="white-space:pre-wrap">        </span>While running pass #10 SILModuleTransform ""Access Enforcement Selection"".</i></div></div><div><br></div><div><br></div><div>Using the LLDB CLI I am able to stop there. If I try "fr var -O" with </div><div><ul><li>mode, inData, and labels, it prints their values no problem</li><li>outData and backData gives me a segmentation violation<br></li></ul><div>The visible difference is the "inout"</div></div><div><br></div><div>Not sure what the problem is. It worked fine in the past.</div><div><br></div><div>If you can think of an experiment I can try to create a simple repro case, please let me know.</div><div><br></div><div>Thanks, Ed</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 6, 2017 at 4:34 PM, Michael Gottesman <span dir="ltr"><<a href="mailto:mgottesman@apple.com" target="_blank">mgottesman@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">It looks like this is failing during guaranteed optimization. Are you running an expression in the debugger and we are crashing there?<div><br></div><div>Michael</div><div><br><div><blockquote type="cite"><div><div class="m_-2179302737174038848m_-6406537339308252266h5"><div>On Oct 6, 2017, at 11:53 AM, Edward Connell via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:</div><br class="m_-2179302737174038848m_-6406537339308252266m_1753879203729931118Apple-interchange-newline"></div></div><div><div><div class="m_-2179302737174038848m_-6406537339308252266h5"><div dir="ltr">While trying to debug a Netlib function, LLDB is crashing<div><br></div><div><div>I'm not sure what this assert means.</div></div><div><br></div><div><div><i>LLDBFrontend: /home/buildnode/jenkins/worksp<wbr>ace/oss-swift-4.0-package-linu<wbr>x-ubuntu-16_04/swift/lib/SILOp<wbr>timizer/Mandatory/AccessEnforc<wbr>ementSelection.cpp:613: (anonymous namespace)::SourceAccess (anonymous namespace)::AccessEnforcementS<wbr>election::getSourceAccess(swif<wbr>t::SILValue): Assertion `isa<AllocStackInst>(address) || isa<SILUndef>(address)' failed.</i></div><div><i>Stack dump:</i></div><div><i>0.<span style="white-space:pre-wrap">        </span>While running pass #10 SILModuleTransform ""Access Enforcement Selection"".</i></div></div><div><br></div><div>It fails every time and the same way in several functions, but not all functions.<br></div><div>I tried to create a simple repro with the same function signature, but I can't get the simple case to fail.</div><div>A debug build isn't doing whole-module-optimization, so that's not it</div><div><br></div><div>Ideas anyone?</div><div><br></div><div>Who owns the LLDBFrontend?</div><div><br></div><div>Thanks, Ed</div></div></div></div>
______________________________<wbr>_________________<br>swift-users mailing list<br><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-users</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></blockquote></div></div></div><br></div>
<br>______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
<br></blockquote></div><br></div>