Chris Arena wrote:

> _giiPollall calls ...
>
> gii_event_mask
> _giiPollall(struct gii_input *inp, gii_event_mask mask, void *arg)
> {
> ....
>    retmask |= (curr->GIIeventpoll(curr, arg) & mask);
>
> where the NULL from above is now the value for the void * arg.
>
> The routine at curr->GIIeventpoll( ... ) isn't debugable, so I don't
> know where that goes.

As far as I can read in the sources, every device-driver initializes its
gii_input structure in a function like GIIdlinit (see e.g.
.../libgii/input/linux_kbd/input.c). In the case of the keyboard-driver the
function pointer GIIeventpoll should then point to
GII_keyboard_poll(gii_input*,void* arg) where arg is treated as a pointer
to an fd_set if not null.

Hm... The only file I find with calls to ggLock/ggUnlock is
.../libgii/input/gii.c. The mutex given as argument should always exist -
it belongs to the event queue (and is always allocated in
_giiEvQueueAllocate <- _giiInputAlloc <- giiOpen) or it is the mutex
_gii_safe_lock (allocated in giiInit, file .../libgii/gii/init.c).

So ggLock is called on the mutex of a queue that already has been deleted?


Oh - MAINTAINER OF GII: function giiClose in file .../libgii/gii/gii.c:
_giiEvQueueDestroy (*) is called two times (should do no harm though)!

int giiClose(struct gii_input *inp)
{
 struct gii_input *curr = inp;
 (...)

 _giiEvQueueDestroy(inp); /* This destroys _all_ queues ! */     <-- first
time

 do {
  struct gii_input *prev;

  curr->queue = NULL; /* For better error catching. */

  if (curr->GIIclose) {
   rc = curr->GIIclose(curr);
  }

  if (curr->dlhand) {
   _giiCloseDL(curr->dlhand);
   free(curr->dlhand);
  }
  prev = curr;
  curr = curr->next;
  _giiInputFree(prev);              <----- second time: _giiInputFree calls
(*)
 } while (curr != inp); /* looped through once. */



C.u. Martin


Reply via email to