<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>
<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<div style="">
<p dir="auto">Reproducible here with Debian's 3.6.6-2.</p>
<p dir="auto">In the timeout case, we receive 1 byte less than in the success case. That makes gnutls-cli calling another select() which times out. The error message is wrong in this case. It should be 'timeout...'.</p>
<p dir="auto">strace Failure:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 3</span>
<span id="LC2" class="line" lang="plaintext">connect(3, {sa_family=AF_INET6, sin6_port=htons(5222), inet_pton(AF_INET6, "2a02:1b8:10:31::229", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 ENETUNREACH (Das Netzwerk ist nicht erreichbar)</span>
<span id="LC3" class="line" lang="plaintext">close(3) = 0</span>
<span id="LC4" class="line" lang="plaintext">socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 3</span>
<span id="LC5" class="line" lang="plaintext">write(1, "Connecting to '146.255.57.229:52"..., 39Connecting to '146.255.57.229:5222'...</span>
<span id="LC6" class="line" lang="plaintext">) = 39</span>
<span id="LC7" class="line" lang="plaintext">connect(3, {sa_family=AF_INET, sin_port=htons(5222), sin_addr=inet_addr("146.255.57.229")}, 16) = 0</span>
<span id="LC8" class="line" lang="plaintext">sendto(3, "<stream:stream xmlns:stream='htt"..., 119, 0, NULL, 0) = 119</span>
<span id="LC9" class="line" lang="plaintext">select(4, [3], NULL, NULL, {tv_sec=10, tv_usec=0}) = 1 (in [3], left {tv_sec=9, tv_usec=977090})</span>
<span id="LC10" class="line" lang="plaintext">recvfrom(3, "<?xml version='1.0'?><stream:str"..., 1023, 0, NULL, NULL) = 180</span>
<span id="LC11" class="line" lang="plaintext">sendto(3, "<starttls xmlns='urn:ietf:params"..., 51, 0, NULL, 0) = 51</span>
<span id="LC12" class="line" lang="plaintext">select(4, [3], NULL, NULL, {tv_sec=10, tv_usec=0}) = 1 (in [3], left {tv_sec=9, tv_usec=999997})</span>
<span id="LC13" class="line" lang="plaintext">recvfrom(3, "<stream:features><starttls xmlns"..., 1023, 0, NULL, NULL) = 107</span>
<span id="LC14" class="line" lang="plaintext">select(4, [3], NULL, NULL, {tv_sec=10, tv_usec=0}) = 1 (in [3], left {tv_sec=9, tv_usec=977607})</span>
<span id="LC15" class="line" lang="plaintext">recvfrom(3, "<proceed xmlns='urn:ietf:params:"..., 916, 0, NULL, NULL) = 50</span>
<span id="LC16" class="line" lang="plaintext">select(4, [3], NULL, NULL, {tv_sec=10, tv_usec=0}) = 0 (Timeout)</span>
<span id="LC17" class="line" lang="plaintext">write(2, "error receiving <proceed: Networ"..., 49error receiving <proceed: Network is unreachable) = 49</span></code></pre>
<p dir="auto">strace Success:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 3</span>
<span id="LC2" class="line" lang="plaintext">write(1, "Connecting to '146.255.57.229:52"..., 39Connecting to '146.255.57.229:5222'...</span>
<span id="LC3" class="line" lang="plaintext">) = 39</span>
<span id="LC4" class="line" lang="plaintext">connect(3, {sa_family=AF_INET, sin_port=htons(5222), sin_addr=inet_addr("146.255.57.229")}, 16) = 0</span>
<span id="LC5" class="line" lang="plaintext">sendto(3, "<stream:stream xmlns:stream='htt"..., 119, 0, NULL, 0) = 119</span>
<span id="LC6" class="line" lang="plaintext">select(4, [3], NULL, NULL, {tv_sec=10, tv_usec=0}) = 1 (in [3], left {tv_sec=9, tv_usec=977095})</span>
<span id="LC7" class="line" lang="plaintext">recvfrom(3, "<?xml version='1.0'?><stream:str"..., 1023, 0, NULL, NULL) = 288</span>
<span id="LC8" class="line" lang="plaintext">sendto(3, "<starttls xmlns='urn:ietf:params"..., 51, 0, NULL, 0) = 51</span>
<span id="LC9" class="line" lang="plaintext">select(4, [3], NULL, NULL, {tv_sec=10, tv_usec=0}) = 1 (in [3], left {tv_sec=9, tv_usec=977916})</span>
<span id="LC10" class="line" lang="plaintext">recvfrom(3, "<proceed xmlns='urn:ietf:params:"..., 1023, 0, NULL, NULL) = 50</span>
<span id="LC11" class="line" lang="plaintext">getrandom("\x5b\x9a\xfe\x4b\x89\xeb\x18\x88\xb0\x36\xed\x43\xf3\xe1\x62\xf1\xfd\x0c\xec\xa5\x4a\x4d\x85\x43\x5e\xea\x52\xf4\x69\xe9\xf4\xd3"..., 64, 0) = 64</span>
<span id="LC12" class="line" lang="plaintext">sendto(3, "\26\3\1\1b\1\0\1^\3\39\263/\r\204\7\350E\241>\246\356\232\322\214\220\235\315\210\253\222"..., 359, 0, NULL, 0) = 359</span>
<span id="LC13" class="line" lang="plaintext">...</span></code></pre>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777777;">
—
<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/issues/697#note_138561854">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/sent_notifications/160abdfa78dc24e6554cc2c84ef62de5/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/issues/697#note_138561854"}}</script>
</p>
</div>
</body>
</html>