<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><blockquote type="cite" class=""><div class="">On May 9, 2017, at 3:07 PM, Pushkar N Kulkarni via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><div class=""><font face="Verdana,Arial,Helvetica,sans-serif" size="2" class=""><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">In the process of debugging a bunch of consistent failures in TestFoundation/TestNSURLSession, I came across a weird problem symptom in <a target="_blank" href="https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSURLSession/NSURLSessionTask.swift#L329" title="https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSURLSession/NSURLSessionTask.swift#L329" class="">this line of code</a>.</div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><span style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;" class=""><font color="#24292e" class="">internalState </font></span><span class="pl-k" style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;"><font color="#a71d5d" class="">=</font></span><span style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;" class=""><font color="#24292e" class=""> .</font></span><span class="pl-c1" style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;"><font color="#0086b3" class="">transferInProgress</font></span><span style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;" class=""><font color="#24292e" class="">(transferState)</font></span><br class=""></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><span style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;" class=""><font color="#24292e" class=""><br class=""></font></span></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">I had a suspicion that the above modification is not taking effect, since, only based on this change the didSet observer for the `internalState` property triggers data transfers using libcurl. So, I simply printed the property before and after the assignment.&nbsp;</div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" class="">print("before =&gt; \(internalState)")</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" class=""><span style="white-space: pre;" class=""><font color="#24292e" class="">internalState </font></span><span class="pl-k" style="box-sizing: border-box; white-space: pre;"><font color="#a71d5d" class="">=</font></span><span style="white-space: pre;" class=""><font color="#24292e" class=""> .</font></span><span class="pl-c1" style="box-sizing: border-box; white-space: pre;"><font color="#0086b3" class="">transferInProgress</font></span><span style="white-space: pre;" class=""><font color="#24292e" class="">(transferState)</font></span><br class=""></font></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" class="">print("after =&gt; \(internalState)")</font></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" class=""><br class=""></font></span></div></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">Surprisingly, I don't see any change in the property value:</div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000ff" class="">before =&gt; transferReady(Foundation.URLSessionTask._TransferState(... &lt;redacted&gt; ...))<br class=""></font></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000ff" class="">after &nbsp;=&gt; transferReady(Foundation.URLSessionTask._TransferState(... &lt;redacted&gt; ...))</font></span></div></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></div><div class=""><font face="Verdana, Arial, Helvetica, sans-serif" style="font-size: small;" class="">When I switched back to the "</font><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" size="2" class="">swift-DEVELOPMENT-SNAPSHOT-2017-04-24-a"</font><span style="font-size: 14px; font-family: Menlo;" class="">&nbsp;</span><font face="Verdana, Arial, Helvetica, sans-serif" style="font-size: small;" class="">tag on all the repos (except swift-corelibs-foundation), I do not see this problem. I see:</font></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000ff" class="">before =&gt; transferReady(Foundation.URLSessionTask._TransferState(... &lt;redacted&gt; ...))</font></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000ff" class="">after &nbsp;=&gt; transferInProgress(Foundation.URLSessionTask._TransferState(... &lt;redacted&gt; ...))</font></span></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">To put it in simple terms, the modification doesn't seem to be taking effect with the current HEAD.&nbsp;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">I haven't been able to isolate this problem in an independent test case. However, anybody who wants to reproduce it can simply run TestFoundation after enabling the URLSession tests (which have been disabled for now) in TestFoundation/main.swift.&nbsp;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">I did compare the `-emit-ir` outputs from the passing and failing levels. There seems to be a clear difference in the way we store the new value of this property. But given my limited exposure to debugging Swift compiler issues, I wasn't able to progress further. &nbsp;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">&nbsp;</span><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><font face="Verdana, Arial, Helvetica, sans-serif" size="2" class="">Can someone help us here please? Thanks.&nbsp;</font></div></div></font></div></blockquote><div><br class=""></div></div>That sounds like a serious bug; please file it in JIRA.<div class=""><br class=""></div><div class="">John.</div></body></html>