From: bugzilla-daemon@freedesktop.org Subject: [Bug 95329] Metro 2033 Redux benchmark fails to start Date: Tue, 17 May 2016 12:03:13 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0371475299==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 0338C6E6C0 for ; Tue, 17 May 2016 12:03:13 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0371475299== Content-Type: multipart/alternative; boundary="14634865920.93E39aBF3.1495"; charset="UTF-8" --14634865920.93E39aBF3.1495 Date: Tue, 17 May 2016 12:03:12 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D95329 Jan Ziak <0xe2.0x9a.0x9b@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |NOTOURBUG --- Comment #3 from Jan Ziak <0xe2.0x9a.0x9b@gmail.com> --- The cause of the issue is in metro.bin, not in Mesa. Found via running "valgrind benchmark.sh". The following code fixes the issue: $ cat posix_memalign.c #include #include #include #include int posix_memalign(void **memptr, size_t alignment, size_t size) { if(alignment < 32) { alignment =3D 32; // Optional. Might boost memcpy(). } size *=3D 2; // Required void *p =3D memalign(alignment, size); if(!p && size) { return ENOMEM; } bzero(p, size); // Optional *memptr =3D p; return 0; } $ gcc -m32 -shared -fPIC -O2 -g -Wall -Werror -std=3Dc99 -o posix_memalign3= 2.so posix_memalign.c $ gcc -m64 -shared -fPIC -O2 -g -Wall -Werror -std=3Dc99 -o posix_memalign6= 4.so posix_memalign.c $ export LD_PRELOAD=3D"$PWD/posix_memalign32.so:$PWD/posix_memalign64.so:$LD_PRELOAD" $ .../Metro 2033 Redux/benchmark.sh --=20 You are receiving this mail because: You are the assignee for the bug.= --14634865920.93E39aBF3.1495 Date: Tue, 17 May 2016 12:03:12 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated Jan Ziak changed bug 95329<= /a>
What Removed Added
Status NEW RESOLVED
Resolution --- NOTOURBUG

Comment= # 3 on bug 95329<= /a> from Jan Ziak
The cause of the issue is in metro.bin, not in Mesa. Found via=
 running
"valgrind benchmark.sh".

The following code fixes the issue:

$ cat posix_memalign.c
#include <errno.h>
#include <malloc.h>
#include <stdlib.h>
#include <strings.h>

int posix_memalign(void **memptr, size_t alignment, size_t size) {
        if(alignment < 32) {
                alignment =3D 32;  // Optional. Might boost memcpy().
        }
        size *=3D 2;       // Required
        void *p =3D memalign(alignment, size);
        if(!p && size) {
                return ENOMEM;
        }
        bzero(p, size);  // Optional
        *memptr =3D p;
        return 0;
}

$ gcc -m32 -shared -fPIC -O2 -g -Wall -Werror -std=3Dc99 -o posix_memalign3=
2.so
posix_memalign.c
$ gcc -m64 -shared -fPIC -O2 -g -Wall -Werror -std=3Dc99 -o posix_memalign6=
4.so
posix_memalign.c
$ export
LD_PRELOAD=3D"$PWD/posix_memalign32.so:$PWD/posix_memalign64.so:$LD_PR=
ELOAD"
$ .../Metro 2033 Redux/benchmark.sh


You are receiving this mail because:
  • You are the assignee for the bug.
= --14634865920.93E39aBF3.1495-- --===============0371475299== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0371475299==--