Bug in chprintf.c (Chibios 2.6.3)

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
dismirlian
Posts: 65
Joined: Fri Dec 20, 2013 3:59 pm
Has thanked: 1 time
Been thanked: 16 times

Bug in chprintf.c (Chibios 2.6.3)

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Bug in chprintf.c (Chibios 2.6.3)

Post 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
Post Reply