From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlZm1-0001im-8t for qemu-devel@nongnu.org; Mon, 12 Oct 2015 05:52:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlZlx-00055K-8X for qemu-devel@nongnu.org; Mon, 12 Oct 2015 05:52:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlZlx-00055G-3T for qemu-devel@nongnu.org; Mon, 12 Oct 2015 05:52:01 -0400 References: <561B6DA5.4040101@redhat.com> From: Paolo Bonzini Message-ID: <561B82BB.3000609@redhat.com> Date: Mon, 12 Oct 2015 11:51:55 +0200 MIME-Version: 1.0 In-Reply-To: <561B6DA5.4040101@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] i386: SSE 4 implementation does not match bare metal List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Florian Weimer , qemu-devel@nongnu.org Cc: Eduardo Habkost , Richard Henderson On 12/10/2015 10:21, Florian Weimer wrote: > We received a bug report that the SSE-4.2-based strstr in glibc 2.17 was > misbehaving and returned NULL for certain inputs, even though the search > pattern is clearly present in the subject string. I'm attaching a test > case. You can run it as "./tst-strstr 3" to directly go to one failing > case. > > I'm not sure how to debug this further, except by running the program > under GDB, single-step through it, dump registers, and compare the > results with a bare-metal implement after each instruction executed. Headscratching and reading the Intel SDM is usually the best way if you can reduce it to a single instruction (and in this case pcmpXstrX was obviously the most likely culprit). > Downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=1270703 > There is also an attachment with a pre-compiled binary. Patch sent, thanks for the report. Paolo