Page 1 of 1

Bug in chprintf.c (Chibios 2.6.3)

Posted: Fri Feb 28, 2014 1:24 pm
by dismirlian
Hello, I think I've found a bug in chvprintf, specifically in the line:

Code: Select all

chSequentialStreamWrite(chp, (uint8_t*)s, i);


The issue is that chSequentialStreamWrite calls chOQWriteTimeout, which doesn't accept a length of 0 (reserved, although I don't know why...), so I get a "chOQWriteTimeout" debug panic.

Maybe a quick fix could be:

Code: Select all

if (i > 0) 
  chSequentialStreamWrite(chp, (uint8_t*)s, i);


Thanks!!
Diego.

Re: Bug in chprintf.c (Chibios 2.6.3)

Posted: Fri Feb 28, 2014 1:28 pm
by Giovanni
Hi,

Thanks for reporting. It is being discussed, not sure if make zero a valid value for streams or add the check you suggest.

Giovanni