Jason White, le Fri 15 Jun 2012 13:33:43 +1000, a écrit :
> Program terminated with signal 11, Segmentation fault.
> #0  api_flush (brl=brl@entry=0x7f66f988aa40) at 
> ../../Programs/brlapi_server.c:2459

Mmm, indeed, that could happen.  Could you test the attached patch?

Samuel
Index: Programs/brlapi_server.c
===================================================================
--- Programs/brlapi_server.c    (révision 6570)
+++ Programs/brlapi_server.c    (copie de travail)
@@ -331,7 +331,11 @@
 /* Returns !0 if driver can return specific keycodes, 0 if not. */
 static int isKeyCapable(const BrailleDriver *brl)
 {
-  return (((brl->readKey!=NULL) && (brl->keyToCommand!=NULL)) || (disp && 
disp->keyNameTables!=NULL));
+  int ret;
+  pthread_mutex_lock(&driverMutex);
+  ret = ((brl->readKey!=NULL) && (brl->keyToCommand!=NULL)) || (disp && 
disp->keyNameTables!=NULL);
+  pthread_mutex_unlock(&driverMutex);
+  return ret;
 }
 
 /* Function : suspendDriver */
@@ -2558,8 +2562,10 @@
   ApiBraille.readPacket = NULL;
   ApiBraille.writePacket = NULL;
   braille=&ApiBraille;
+  pthread_mutex_lock(&driverMutex);
   brlResize(brl);
   driverConstructed=1;
+  pthread_mutex_unlock(&driverMutex);
   pthread_mutex_lock(&connectionsMutex);
   broadcastKey(&ttys, BRLAPI_KEY_TYPE_CMD|BRLAPI_KEY_CMD_NOOP, BRL_COMMANDS);
   pthread_mutex_unlock(&connectionsMutex);
@@ -2582,8 +2588,8 @@
   pthread_mutex_lock(&driverMutex);
   if (!coreActive && driverConstructed)
     suspendDriver(disp);
+  disp = NULL;
   pthread_mutex_unlock(&driverMutex);
-  disp = NULL;
 }
 
 /* Function : api_identify */
_______________________________________________
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@mielke.cc
For general information, go to: http://mielke.cc/mailman/listinfo/brltty

Reply via email to