Witam wszystkich.
Mam w programie drawing area, które zawiera ikony i teksty pod nimi. Mam funkcję przerysowującą ten obszar: [code]PrzerysujSchemat(...)[/code].
2 wątki mają możliwość użycia tej funkcji: wątek gtk (na przykład po wciśnięciu jakiegoś przcisku itp) oraz mój specjalny wątek odbierający sygnały z urządzenia peryferyjnego.
Jednak dostają błąd X-ów:
czasami:
my_prog: ../../src/xcb_io.c:242: process_responses: Assertion (((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed.czasami:Fatal IO error 0 (Success) on X server :0.0.czasami:Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.`
czasami:

The program 'my_prog' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 2658 error_code 14 request_code 53 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Błędy xów są asynchroniczne i nie da rady tego debugować. ale:

czasami mam segfault i debuger wskazuje linię 474 w pliku gslice.c:

471.  if (G_UNLIKELY (chunk))
472.    {
473.      /* allocating from freed list */
474.      (*magazine_chunks)->data = chunk->next;
475.    }
476.  else

czasami mam segfault i debuger wskazuje linię 444 w pliku gdataset.c:

gpointer
g_datalist_id_get_data (GData	 **datalist,
			GQuark     key_id)
{
  gpointer data = NULL;
  g_return_val_if_fail (datalist != NULL, NULL);
  if (key_id)
    {
      register GData *list;
442.      G_LOCK (g_dataset_global);
443.      for (list = G_DATALIST_GET_POINTER (datalist); list; list = list->next)
444.          if (list->id == key_id)
445.	  {
            data = list->data;
            break;
          }
      G_UNLOCK (g_dataset_global);
    }
  return data;
}

Używam semaforów podczas wywoływania tej funkcji, jednak to nie rozwiązuje problemów....