Summary: | [llvmpipe] SIGFPE pthread_barrier_destroy.c:40 | ||
---|---|---|---|
Product: | Mesa | Reporter: | Vinson Lee <vlee> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | mesa-dev |
Severity: | normal | ||
Priority: | medium | CC: | steve.langasek |
Version: | git | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Vinson Lee
2016-02-11 00:31:20 UTC
commit 4ed4c1d9210b11ce6faea81455c21531904ea45b Author: Vinson Lee <vlee@freedesktop.org> Date: Wed Feb 10 16:42:19 2016 -0800 llvmpipe: Do not use barriers if not using threads. Cc: mesa-stable@lists.freedesktop.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94088 Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Hello, The patch for this bug is incomplete. In between the calls to pipe_barrier_init() and pipe_barrier_destroy() are calls to pipe_barrier_wait(), which is implemented on top of pthread_barrier_wait(). Since pipe_barrier_init() has not been called, the calls to pthread_barrier_wait() have undefined behavior, as per <http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_barrier_wait.html>, <http://linux.die.net/man/3/pthread_barrier_wait>. The applied commit is sufficient to fix the immediate SIGFPE problem with glibc, but the API is still being used incorrectly and could result in future crashes on other implementations. (In reply to Steve Langasek from comment #2) > Hello, > > The patch for this bug is incomplete. In between the calls to > pipe_barrier_init() and pipe_barrier_destroy() are calls to > pipe_barrier_wait(), which is implemented on top of pthread_barrier_wait(). > > Since pipe_barrier_init() has not been called, the calls to > pthread_barrier_wait() have undefined behavior, as per > <http://pubs.opengroup.org/onlinepubs/009695399/functions/ > pthread_barrier_wait.html>, > <http://linux.die.net/man/3/pthread_barrier_wait>. > > The applied commit is sufficient to fix the immediate SIGFPE problem with > glibc, but the API is still being used incorrectly and could result in > future crashes on other implementations. I can't see how this could possibly happen. Unless I'm missing something, pipe_barrier_wait() is only called in the thread main function, which will never get called if we don't have any threads to begin with. Sorry, you're quite right, this code path is not used except when additional threads are spawned. Please ignore. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.