Re: [PATCH] server: Fix crash when accessing client which is already freed

2016-11-21 Thread Daniel Stone
Hi Pekka, On 21 November 2016 at 13:30, Pekka Paalanen wrote: > On Mon, 21 Nov 2016 12:19:43 + Daniel Stone wrote: >> I'm would suggest we document that invoking wl_display_flush_clients() / >> wl_connection_flush() from a request handler may cause undefined behaviour, >> and that it must on

Re: [PATCH] server: Fix crash when accessing client which is already freed

2016-11-21 Thread Pekka Paalanen
On Mon, 21 Nov 2016 12:19:43 + Daniel Stone wrote: > Hi Hyun Kook, > > On 23 September 2016 at 00:40, Hyun Kook Khang > wrote: > > > in wl_client_connection_data(), > > there is no guarantee that client would never be destroyed in the process > > of handling the pending input. > > > > For

Re: [PATCH] server: Fix crash when accessing client which is already freed

2016-11-21 Thread Daniel Stone
Hi Hyun Kook, On 23 September 2016 at 00:40, Hyun Kook Khang wrote: > in wl_client_connection_data(), > there is no guarantee that client would never be destroyed in the process > of handling the pending input. > > For example, > 1. It comes to wl_client_connection_data() > 2. wl_closure_invoke(

Re: [PATCH] server: Fix crash when accessing client which is already freed

2016-09-22 Thread Giulio Camuffo
Hi, could you write how to trigger the crash, also in the commit message maybe? Besides that, i have a comment inline below. 2016-09-21 9:08 GMT+02:00 Hyunkook Khang : > While processing pending data, client could be destroyed in the middle of > the process. (e.g. by invoking wl_display_flush_cli

[PATCH] server: Fix crash when accessing client which is already freed

2016-09-21 Thread Hyunkook Khang
While processing pending data, client could be destroyed in the middle of the process. (e.g. by invoking wl_display_flush_clients()). In this case, client will be freed, but we are still in the processing data of the client, so it could cause a crash. To avoid this, instead of destroying the clien