Hi,
Under certain circumstances ibqReadTimeout fails when called with a TIME_INFINITE interval.
On line 368 in hal_buffers.c the deadline gets calculated regardless if it's used later. If the size of systime_t and interval_t are different this triggers a chDbgCheck in chTimeAddX.
Recommendation: Only calculate deadline if interval isn't TIME_INFINITE or TIME_IMMEDIATE. The function obqWriteTimeout also has this problem.
Question: chTimeAddX could be a potential source of integer overflows if debug checks are disabled. How should we proceed if we want to add an interval that is larger then the max of systime_t ?
Best regards,
greb
Deadline calculation in ibqReadTimeout and obqWriteTimeout Topic is solved
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Deadline calculation in ibqReadTimeout and obqWriteTimeout
Hi,
Using deadlines you cannot have intervals larger than systime_t, the only solution would be to remove deadlines and have plain timeouts (which would also fix the first problem), we already did this for queues.
Giovanni
Using deadlines you cannot have intervals larger than systime_t, the only solution would be to remove deadlines and have plain timeouts (which would also fix the first problem), we already did this for queues.
Giovanni
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Who is online
Users browsing this forum: No registered users and 10 guests