<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">That doesn't look symbolicated. If it were symbolicated, and the build used -g, you would have a file and line number for the main+345 frame.</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On May 2, 2017, at 2:31 PM, Nick Snyder via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">In practice, I would need the stack trace first to figure out how to reproduce the issue, so lldb doesn't really help.<div class=""><br class=""></div><div class="">How would I go about symbolicating this further on macOS (Xcode or otherwise)?</div><div class=""><br class=""></div><div class="">From reading the docs it seems like the crash report I get is already completely symbolicated:</div><div class=""><a href="https://developer.apple.com/library/content/technotes/tn2151/_index.html#//apple_ref/doc/uid/DTS40008184-CH1-SYMBOLICATION-_DETERMINING_WHETHER_A_CRASH_REPORT_IS_SYMBOLICATED" class="">https://developer.apple.com/library/content/technotes/tn2151/_index.html#//apple_ref/doc/uid/DTS40008184-CH1-SYMBOLICATION-_DETERMINING_WHETHER_A_CRASH_REPORT_IS_SYMBOLICATED</a><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, May 2, 2017 at 1:21 AM, Alex Blewitt <span dir="ltr" class="">&lt;<a href="mailto:alblue@apple.com" target="_blank" class="">alblue@apple.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">If you can reproduce it, and run it under lldb, it will print the source line for you:<div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(169,169,169);background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">$ lldb .build/debug/main</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">(lldb) target create ".build/debug/main"</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">ruCurrent executable set to '.build/debug/main' (x86_64).</span></div><div style="margin:0px;line-height:normal" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">(lldb) </span><span style="font-variant-ligatures: no-common-ligatures;" class="">run</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Process 19013 launched: '/private/tmp/main/.build/<wbr class="">debug/main' (x86_64)</span></div><span class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Hello, world!</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">fatal error: unexpectedly found nil while unwrapping an Optional value</span></div></span><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">2017-05-02 09:17:11.351608+0100 asdf[19013:54205130] fatal error: unexpectedly found nil while unwrapping an Optional value</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Current stack trace:</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">0&nbsp; &nbsp; libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00000001002c1160 swift_reportError + 125</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">1&nbsp; &nbsp; libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00000001002ddac0 _swift_stdlib_reportFatalError + 60</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">2&nbsp; &nbsp; libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00000001000ce260 specialized specialized StaticString.withUTF8Buffer&lt;A&gt; ((UnsafeBufferPointer&lt;UInt8&gt;) -&gt; A) -&gt; A + 342</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">3&nbsp; &nbsp; libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0000000100249120 partial apply for (_fatalErrorMessage(<wbr class="">StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -&gt; Never).(closure #2) + 109</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">4&nbsp; &nbsp; libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00000001000ce260 specialized specialized StaticString.withUTF8Buffer&lt;A&gt; ((UnsafeBufferPointer&lt;UInt8&gt;) -&gt; A) -&gt; A + 342</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">5&nbsp; &nbsp; libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00000001001fbd00 specialized _fatalErrorMessage(<wbr class="">StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -&gt; Never + 96</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">6&nbsp; &nbsp; main&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0000000100001340 say(message : String?) -&gt; () + 248</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">7&nbsp; &nbsp; main&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00000001000011e0 main + 328</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">8&nbsp; &nbsp; libdyld.dylib&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00007fffb444d234 start + 1</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">Process 19013 stopped</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; frame #0: 0x00000001001fbd60 libswiftCore.dylib`function signature specialization &lt;preserving fragile attribute, Arg[2] = Dead, Arg[3] = Dead&gt; of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, file : Swift.StaticString, line : Swift.UInt, flags : Swift.UInt32) -&gt; Swift.Never + 96</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">libswiftCore.dylib`function signature specialization &lt;preserving fragile attribute, Arg[2] = Dead, Arg[3] = Dead&gt; of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, file : Swift.StaticString, line : Swift.UInt, flags : Swift.UInt32) -&gt; Swift.Never:</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">-&gt;&nbsp; 0x1001fbd60 &lt;+96&gt;: ud2 &nbsp; &nbsp;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; 0x1001fbd62 &lt;+98&gt;: nopw &nbsp; %cs:(%rax,%rax)</span></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">libswiftCore.dylib`protocol witness table accessor for &lt;A&gt; Swift.AnySequence&lt;A&gt; : Swift.Sequence in Swift:</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; 0x1001fbd70 &lt;+0&gt;:&nbsp; pushq&nbsp; %rbp</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; 0x1001fbd71 &lt;+1&gt;:&nbsp; movq &nbsp; %rsp, %rbp</span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(169,169,169);background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">(lldb) </span><span style="font-variant-ligatures: no-common-ligatures;" class="">bt</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; * frame #0: 0x00000001001fbd60 libswiftCore.dylib`function signature specialization &lt;preserving fragile attribute, Arg[2] = Dead, Arg[3] = Dead&gt; of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, file : Swift.StaticString, line : Swift.UInt, flags : Swift.UInt32) -&gt; Swift.Never + 96</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><b class="">&nbsp; &nbsp; frame #1: 0x0000000100001438 main`say(message=nil) -&gt; () at main.swift:5</b></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><b class="">&nbsp; &nbsp; frame #2: 0x0000000100001328 main`main at main.swift:8</b></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; frame #3: 0x00007fffb444d235 libdyld.dylib`start + 1</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">&nbsp; &nbsp; frame #4: 0x00007fffb444d235 libdyld.dylib`start + 1</span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class="">There is a symbolication tool available for Linux in the ~/swift/utils/symbolicate-<wbr class="">linux-fatal, and Xcode can do the same symbolication for you as well.</span></div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div class="">Alex</div><div class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On 28 Apr 2017, at 22:28, Nick Snyder via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="m_-218677909403448038Apple-interchange-newline"></div></div><div class=""><div class=""><div class="h5"><div dir="ltr" class="">I have a simple main.swift that looks like this:<div class=""><br class=""></div><div class="">```</div><div class=""><div class="">print("Hello, world!")</div><div class="">let x: String? = nil</div><div class=""><br class=""></div><div class="">func say(message: String?) {</div><div class="">&nbsp; &nbsp; print(x!) // intentional crash</div><div class="">}</div><div class=""><br class=""></div><div class="">say(message: x)</div></div><div class="">```</div><div class=""><br class=""></div><div class="">Running this results in the crash</div><div class=""><br class=""></div><div class="">```</div><div class=""><div class="">$ swift build &amp;&amp; ./.build/debug/hello</div><div class="">Hello, world!</div><div class="">fatal error: unexpectedly found nil while unwrapping an Optional value</div><div class="">Current stack trace:</div><div class="">0 &nbsp; &nbsp;libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0000000110120130 swift_reportError + 129</div><div class="">1 &nbsp; &nbsp;libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x000000011013cb50 _swift_stdlib_reportFatalError + 60</div><div class="">2 &nbsp; &nbsp;libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x000000010ff2d250 specialized specialized StaticString.withUTF8Buffer&lt;A&gt; ((UnsafeBufferPointer&lt;UInt8&gt;) -&gt; A) -&gt; A + 342</div><div class="">3 &nbsp; &nbsp;libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00000001100a7e90 partial apply for (_fatalErrorMessage(<wbr class="">StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -&gt; Never).(closure #2) + 109</div><div class="">4 &nbsp; &nbsp;libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x000000010ff2d250 specialized specialized StaticString.withUTF8Buffer&lt;A&gt; ((UnsafeBufferPointer&lt;UInt8&gt;) -&gt; A) -&gt; A + 342</div><div class="">5 &nbsp; &nbsp;libswiftCore.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x000000011005a9a0 specialized _fatalErrorMessage(<wbr class="">StaticString, StaticString, file : StaticString, line : UInt, flags : UInt32) -&gt; Never + 96</div><div class="">6 &nbsp; &nbsp;hello &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010fee6200 main + 345</div><div class="">7 &nbsp; &nbsp;libdyld.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x00007fffe0375234 start + 1</div><div class="">Illegal instruction: 4</div></div><div class="">```</div><div class=""><br class=""></div><div class="">From the crash, how do I map back line 6 to an actual line in main.swift?</div></div></div></div><span class="">
______________________________<wbr class="">_________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a><br class=""></span><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>