[Bug 95329] Metro 2033 Redux benchmark fails to start

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue May 17 12:03:13 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=95329

Jan Ziak <0xe2.0x9a.0x9b at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |NOTOURBUG

--- Comment #3 from Jan Ziak <0xe2.0x9a.0x9b at 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 <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 = 32;  // Optional. Might boost memcpy().
        }
        size *= 2;       // Required
        void *p = memalign(alignment, size);
        if(!p && size) {
                return ENOMEM;
        }
        bzero(p, size);  // Optional
        *memptr = p;
        return 0;
}

$ gcc -m32 -shared -fPIC -O2 -g -Wall -Werror -std=c99 -o posix_memalign32.so
posix_memalign.c
$ gcc -m64 -shared -fPIC -O2 -g -Wall -Werror -std=c99 -o posix_memalign64.so
posix_memalign.c
$ export
LD_PRELOAD="$PWD/posix_memalign32.so:$PWD/posix_memalign64.so:$LD_PRELOAD"
$ .../Metro 2033 Redux/benchmark.sh

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160517/fe1b63a6/attachment.html>


More information about the dri-devel mailing list