Undermining XGrabKeyboard

pcpa at mandriva.com.br pcpa at mandriva.com.br
Tue Mar 4 16:56:53 PST 2008

Quoting Peter Hutterer <mailinglists at who-t.net>:

> Paulo Cesar Pereira de Andrade wrote:
>>   I wrote a patch for the Mandriva X Server that handles keyboard
>> events using sigio, like mouse events,
> unless you wrote a lot more code than this, this will re-create the 
> problem that X mallocs and frees memory in the signal handler.

  I am not 100% sure about this, so feel free to correct me, but I believe
libc malloc is reentrant, or I am quite lucky and never got a malloc
interrupted, and calling malloc from a signal handler, or libc malloc
doesn't notice that, but under BSD I got this kind of problem (with
code not related to the X Server).

  Anyway, it is also using the patch from Matthieu Herrb to preallocate
input related memory, so it should not be calling malloc/free from the
"enqueue" routines.

> Cheers,
>   Peter


More information about the xorg mailing list