Re: [PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-23 Thread Adam Jackson
On Wed, 2017-02-22 at 15:20 -0800, Keith Packard wrote: > > Adam Jackson writes: > > > On Wed, 2017-02-22 at 16:50 +0100, Olivier Fourdan wrote: > > > WriteToClient() can be called from XIChangeDeviceProperty() so from the > > > InputThread which is a problem as it allocates and free the input an

Re: [PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-22 Thread Peter Hutterer
On Thu, Feb 23, 2017 at 02:22:47AM -0500, Olivier Fourdan wrote: > Hi Peter, > > > > > --- > > > >  RFC: This is probably sub-optimal and broken in many places, but it > > > >   seems to avoid the memory corruption (so far)... At least it's a > > > >   start, I guess. > > > > > > It's cer

Re: [PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-22 Thread Olivier Fourdan
Hi Alan, > >>> WriteToClient() can be called from XIChangeDeviceProperty() so from the > >>> InputThread which is a problem as it allocates and free the input and > >>> output buffers. > > > > That seems like a bug to me; the input thread isn't supposed to be > > directly interacting with clients.

Re: [PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-22 Thread Olivier Fourdan
Hi Peter, > > > --- > > >  RFC: This is probably sub-optimal and broken in many places, but it > > >   seems to avoid the memory corruption (so far)... At least it's a > > >   start, I guess. > > > > It's certainly an improvement in correctness, I just hate it. ;) > > > > One problem wit

Re: [PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-22 Thread Keith Packard
Alan Coopersmith writes: > Should WriteToClient() have something like > assert(pthread_self() == mainThread) > added to help catch things like that? Should at least be a debug option... -- -keith signature.asc Description: PGP signature ___ x

Re: [PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-22 Thread Peter Hutterer
On Wed, Feb 22, 2017 at 03:06:43PM -0500, Adam Jackson wrote: > On Wed, 2017-02-22 at 16:50 +0100, Olivier Fourdan wrote: > > WriteToClient() can be called from XIChangeDeviceProperty() so from the > > InputThread which is a problem as it allocates and free the input and > > output buffers. > > >

Re: [PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-22 Thread Alan Coopersmith
On 02/22/17 03:20 PM, Keith Packard wrote: Adam Jackson writes: On Wed, 2017-02-22 at 16:50 +0100, Olivier Fourdan wrote: WriteToClient() can be called from XIChangeDeviceProperty() so from the InputThread which is a problem as it allocates and free the input and output buffers. That seems

Re: [PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-22 Thread Keith Packard
Adam Jackson writes: > On Wed, 2017-02-22 at 16:50 +0100, Olivier Fourdan wrote: >> WriteToClient() can be called from XIChangeDeviceProperty() so from the >> InputThread which is a problem as it allocates and free the input and >> output buffers. That seems like a bug to me; the input thread is

Re: [PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-22 Thread Adam Jackson
On Wed, 2017-02-22 at 16:50 +0100, Olivier Fourdan wrote: > WriteToClient() can be called from XIChangeDeviceProperty() so from the > InputThread which is a problem as it allocates and free the input and > output buffers. > > Add a new mutex to protect accesses to the input and output buffers from

[PATCH RFC xserver] os: Add a mutex to protect io buffers

2017-02-22 Thread Olivier Fourdan
WriteToClient() can be called from XIChangeDeviceProperty() so from the InputThread which is a problem as it allocates and free the input and output buffers. Add a new mutex to protect accesses to the input and output buffers from being accessed from different threads. Bugzilla: https://bugs.free