[BRLTTY] Crash when sending char é ú?

Samuel Thibault samuel.thibault at ens-lyon.org
Mon Oct 2 16:43:11 EDT 2017


Hello,

Dave, could you apply the attached patch to get better debugging logs
from the server?

Quartel, Eric de, on lun. 02 oct. 2017 14:09:24 +0000, wrote:
> The problems with the é  character are still there but like you wrote
> camouflaged.

So could you please follow Sébastien's advice to get more information
on the crash so we can see what is going wrong in that case?

> - What is see is that writing to a Voayager gives more problems than to a alva
> bc640.
> 
> - But in both cases sending a long string - more then 40 characters -  with the
> é characters gives the next time i send a string different characters on the
> brailledisplay then i want.

That's odd, we normally do support this properly.

> brlapi_write("ééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé
> éééééééééééééééééééééééé");
> 
> shows the é's
> 
> but then next one
> 
> brlapi_write("dog cat horse");
> 
> give different characters.

How exactly do you call brlapi_write()? (that precise function does not
take a string directly) Could you perhaps just post to the list your
test programs, so we are sure of what is done exactly?

> Maybe the é characters takes more memory space? 

They do, they take 2 bytes each.  But both brlapi_client and
brlapi_server support that.  Could you perhaps run your brltty daemon
with -l server so we get the server-side logs?  Ideally with the
attached patch applied.

Thanks,
Samuel
-------------- next part --------------
diff --git a/Programs/brlapi_server.c b/Programs/brlapi_server.c
index bed399089..698db5135 100644
--- a/Programs/brlapi_server.c
+++ b/Programs/brlapi_server.c
@@ -945,7 +945,7 @@ static int handleSetFocus(Connection *c, brlapi_packetType_t type, brlapi_packet
 static void doLeaveTty(Connection *c)
 {
   Tty *tty = c->tty;
-  logMessage(LOG_CATEGORY(SERVER_EVENTS), "fd %"PRIfd"releasing tty %#010x",c->fd,tty->number);
+  logMessage(LOG_CATEGORY(SERVER_EVENTS), "fd %"PRIfd" releasing tty %#010x",c->fd,tty->number);
   c->tty = NULL;
   lockMutex(&apiConnectionsMutex);
   __removeConnection(c);
@@ -1106,6 +1106,7 @@ static int handleWrite(Connection *c, brlapi_packetType_t type, brlapi_packet_t
       if (coreCharset) unlockCharset();
       lockMutex(&c->brailleWindowMutex);
       memcpy(c->brailleWindow.text+rbeg-1,textBuf,rsiz*sizeof(wchar_t));
+      logMessage(LOG_CATEGORY(SERVER_EVENTS), "fd %"PRIfd" wrote %d characters %d bytes",c->fd,rsiz,textLen);
     } else
 #endif /* HAVE_ICONV_H */
     {
@@ -1115,6 +1116,7 @@ static int handleWrite(Connection *c, brlapi_packetType_t type, brlapi_packet_t
 	/* assume latin1 */
         c->brailleWindow.text[rbeg-1+i] = text[i];
       }
+      logMessage(LOG_CATEGORY(SERVER_EVENTS), "fd %"PRIfd" wrote %d characters %d bytes",c->fd,rsiz,rsiz);
     }
     if (!andAttr) memset(c->brailleWindow.andAttr+rbeg-1,0xFF,rsiz);
     if (!orAttr)  memset(c->brailleWindow.orAttr+rbeg-1,0x00,rsiz);


More information about the BRLTTY mailing list