<!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=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p style="color: #777777;">
<a href="https://gitlab.com/wizeman">Ricardo M. Correia</a>
commented:
</p>
<div style="">
<p dir="auto">Ok, I believe I figured out what's going on. I ran the tests in a slightly different (non-sandboxed) environment and they passed, but they still didn't pass in the sandboxed environment.</p>
<p dir="auto">I noticed that <code>test-ciphers-api.sh</code> was failing with <code>SIGILL</code> in the sandboxed environment, but only on the 4th run of the <code>aes128-cbc</code> test.</p>
<p dir="auto">However, in the non-sandboxed environment, <code>aes128-cbc</code> only ran twice, because <code>test-ciphers-api.sh</code> exited early with the <code>non-x86 CPU detected</code> message.</p>
<p dir="auto">So the problem was that <code>test-ciphers-api.sh</code> was not detecting that this was not a x86 CPU in the sandboxed environment.
The root cause of the problem is in this code, inside <code>tests/scripts/common.sh</code>:</p>
<pre class="code highlight js-syntax-highlight shell" lang="shell" v-pre="true"><code><span id="LC1" class="line" lang="shell">exit_if_non_x86<span class="o">()</span></span>
<span id="LC2" class="line" lang="shell"><span class="o">{</span></span>
<span id="LC3" class="line" lang="shell">which lscpu <span class="o">></span>/dev/null 2>&1</span>
<span id="LC4" class="line" lang="shell"><span class="k">if </span><span class="nb">test</span> <span class="nv">$?</span> <span class="o">=</span> 0<span class="p">;</span><span class="k">then</span></span>
<span id="LC5" class="line" lang="shell">        <span class="si">$(</span>which lscpu<span class="si">)</span>|grep Architecture|grep x86</span>
<span id="LC6" class="line" lang="shell">        <span class="k">if </span><span class="nb">test</span> <span class="nv">$?</span> <span class="o">!=</span> 0<span class="p">;</span><span class="k">then</span></span>
<span id="LC7" class="line" lang="shell"><span class="k">                </span><span class="nb">echo</span> <span class="s2">"non-x86 CPU detected"</span></span>
<span id="LC8" class="line" lang="shell">                <span class="nb">exit </span>0</span>
<span id="LC9" class="line" lang="shell">        <span class="k">fi</span></span>
<span id="LC10" class="line" lang="shell"><span class="k">fi</span></span>
<span id="LC11" class="line" lang="shell"><span class="o">}</span></span></code></pre>
<p dir="auto">The way this is implemented, a non-x86 CPU will never be detected if <code>lscpu</code> is not available, i.e. if
<code>utillinux</code> is not installed and included in the <code>PATH</code> variable.</p>
<p dir="auto">My suggestion is that this code is reworked to use the <code>uname -m</code> command, which is more likely to be available as it's part of <code>coreutils</code>, or that <code>utillinux</code> is added as a required dependency in <code>README.md</code> and/or wherever else the dependencies are documented.</p>
<p dir="auto">Either way, I'm going to add <code>utillinux</code> as a dependency of GnuTLS in NixOS, to fix this issue in the meantime.</p>
<p dir="auto">Thanks!</p>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/issues/764#note_227613524">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/5c2e4d35c624a966242cdc69f5fb4532/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/764#note_227613524"}}</script>


</p>
</div>
</body>
</html>