fastrprint crash on long string
dzzie opened this issue · 0 comments
fastrprint will hang the microcontroller if to long of a string is sent in one call. It seems to start to get buggy around 60 bytes, and guaranteed hang everytime with 150
Partial analysis below, I would not have figured it was copying data to a temp buffer for this operation, but since it is it should be performing buffer length checks, and optionally chunking the data and sending in blocks of appropriate size if the buffer is to long.
example: https://pastee.org/u95ez
this is probably in
socket.cpp - send -> simple_link_send
// Copy the data received from user into the TX Buffer
ARRAY_TO_STREAM(pDataPtr, ((unsigned char *)buf), len);
define ARRAY_TO_STREAM(p, a, l) {register short _i; for (_i = 0; _i < l; _i++) *(p)++ = ((uint8_t *) a)[_i];}
Also there is this:
//TX and RX buffer sizes, allow to receive and transmit maximum data at length 8.
ifdef CC3000_TINY_DRIVER
define TINY_CC3000_MAXIMAL_RX_SIZE 44
define TINY_CC3000_MAXIMAL_TX_SIZE 59
endif
I dont see CC3000_TINY_DRIVER defined anywhere in my code or the library (grep) but the behavior going away when I am below the 59 char limit is suspicious.