[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2019-09-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

GitLab Migration User  changed:

   What|Removed |Added

 Resolution|--- |MOVED
 Status|NEW |RESOLVED

--- Comment #13 from GitLab Migration User  ---
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this link
to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/880.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2018-05-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

Timothy Arceri  changed:

   What|Removed |Added

  Component|Other   |Drivers/OSMesa

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-11-24 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

--- Comment #12 from Emil Velikov  ---
Hi Frederic, please send your patches to the ML for review[1].

[1] http://mesa3d.org/devinfo.html#submitting

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

Frederic Devernay  changed:

   What|Removed |Added

 Attachment #123121|0   |1
is obsolete||
 Attachment #123124|0   |1
is obsolete||

--- Comment #11 from Frederic Devernay  ---
Created attachment 123125
  --> https://bugs.freedesktop.org/attachment.cgi?id=123125=edit
patch for Mesa-11.1.2, v3

add a trivial check in osmesa_destroy_buffer (in case context is destroyed
before being made current)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

--- Comment #10 from Frederic Devernay  ---
Created attachment 123124
  --> https://bugs.freedesktop.org/attachment.cgi?id=123124=edit
patch for Mesa-11.1.2, v3

add a trivial check in osmesa_destroy_buffer (in case context is destroyed
before being made current)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

Frederic Devernay  changed:

   What|Removed |Added

 Attachment #123120|0   |1
is obsolete||

--- Comment #9 from Frederic Devernay  ---
Created attachment 123123
  --> https://bugs.freedesktop.org/attachment.cgi?id=123123=edit
patch for Mesa-11.2.0, v3

add a trivial check in osmesa_destroy_buffer (in case context is destroy before
being made current)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

--- Comment #8 from Roland Scheidegger  ---
(In reply to Frederic Devernay from comment #5)
> OK, there was another issue, which actually may affect other Gallium drivers
> as well: 
> 
> st_framebuffer_reuse_or_create() uses pointer comparison to check if it can
> reuse a framebuffer.
> 
> The problem is that a call to free followed by a call to malloc may very
> well return the exact same pointer! Pointer comparison should be used as a
> safe check but is very unreliable.

Yes, I think this is the same issue as originally reported here:
https://bugs.chromium.org/p/chromium/issues/detail?id=395818

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

Frederic Devernay  changed:

   What|Removed |Added

 Attachment #123109|0   |1
is obsolete||

--- Comment #7 from Frederic Devernay  ---
Created attachment 123121
  --> https://bugs.freedesktop.org/attachment.cgi?id=123121=edit
patch for Mesa-11.1.2, v2

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

Frederic Devernay  changed:

   What|Removed |Added

 Attachment #123108|0   |1
is obsolete||

--- Comment #6 from Frederic Devernay  ---
Created attachment 123120
  --> https://bugs.freedesktop.org/attachment.cgi?id=123120=edit
patch for Mesa-11.2.0, v2

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

--- Comment #5 from Frederic Devernay  ---
OK, there was another issue, which actually may affect other Gallium drivers as
well: 

st_framebuffer_reuse_or_create() uses pointer comparison to check if it can
reuse a framebuffer.

The problem is that a call to free followed by a call to malloc may very well
return the exact same pointer! Pointer comparison should be used as a safe
check but is very unreliable.

The consequence is that osmesa_st_framebuffer_validate() was not called and the
textures were not allocated, even though the osbuffer was just allocated.

I added a fix which explicitely sets st->ctx->WinSysDrawBuffer and
st->ctx->WinSysReadBuffer to NULL, so that the framebuffer is reallocated and
framebuffer_validate() is always called.

This is in the second version of the patch set.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

--- Comment #4 from Chuck Atkins  ---
> I don't really know anything about osmesa though nor why people still use
> it

We use OSMesa extensively for rendering on headless servers with no GPUs.  It's
*MUCH* better than dealing with having to start up an X server and use GLX. 
EGL is in the planned transition but it doesn't quite work yet with a
software-only no-X configuration, at least not that I've been able to configure
:-(.  Off topic for this bug though.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

--- Comment #3 from Roland Scheidegger  ---
I'm not really sure about that. It is possible this was intended for multiple
contexts rendering to the same buffer (as is possible with "ordinary" GL),
which won't work with this. Though you are certainly right that it's impossible
to use multiple buffers right now from different contexts.
As for multiple screens, I'm not quite sure why one wouldn't do? Albeit might
need some mutex protection?
I don't really know anything about osmesa though nor why people still use it,
Brian would be the person to ask how it's supposed to work.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

--- Comment #2 from Frederic Devernay  ---
Created attachment 123109
  --> https://bugs.freedesktop.org/attachment.cgi?id=123109=edit
patch for Mesa-11.1.2

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-21 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

Frederic Devernay  changed:

   What|Removed |Added

 CC||frederic.dever...@m4x.org

--- Comment #1 from Frederic Devernay  ---
Created attachment 123108
  --> https://bugs.freedesktop.org/attachment.cgi?id=123108=edit
patch for Mesa-11.2.0

Add proposed patch for Mesa 11.2.0, please review

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 95035] Gallium OSMesa driver is far from being thread-safe

2016-04-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=95035

Bug ID: 95035
   Summary: Gallium OSMesa driver is far from being thread-safe
   Product: Mesa
   Version: 11.2
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Other
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: frederic.dever...@m4x.org
QA Contact: mesa-dev@lists.freedesktop.org

see src/gallium/state_trackers/osmesa/osmesa.c

There are at least three global variables with no protection:
- stapi in get_st_api()
- stmgr in get_st_manager()
- BufferList

Consequently:
- OSMesaCreateContext cannot be called simultaneously from two threads
- OSMesaMakeCurrent called from two threads with the same buffer attribs will
share the same element in BufferList, and thus render to the same memory!

My guess is that these two objects should simply be stored in the context
itself, but I cannot foresee the consequences.

For example, will shared display lists still work?

I am willing to help on solving this (we use OSMesa in highly multithreaded
application).

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev