- Status Closed
- Percent Complete
- Task Type Patches
- Category Operating System/Drivers
- Assigned To No-one
- Operating System All players
- Severity Low
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#6259 - Panic if queue overflows
Here’s an additional test to force a panic if a queue overflows. Please can someone check my maths is right before I commit this, I wouldn’t want to cause unwanted panic, and it seems to detect a lot of overflows on my H300.
Closed by pondlife
2007-08-01 15:05
Reason for closing: Rejected
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
2007-08-01 15:05
Reason for closing: Rejected
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
It's rather too easy to overflow a
queue (by holding down a key during
initial boot for example)… so this is
probably not a good idea.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
from a quick look into the queuing stuff: mustn’t you also wrap the queue value for the test? I.e.
if(q→write == 1) like e.g. in queue_post() at kernel.c:164 as you otherwise would point to somewhere outside of the queue?
(Note that I know nothing of the queuing stuff, but that simply popped into my mind as I read the patch so I might be completely wrong – just wanted to note this
Since you will panic anyway, why not check after q→write has been incremented?
if(q→read == q→write)
Both read and write are forever-incrementing UINTs; they are not restricted by QUEUE_LENGTH_MASK. They will wrap eventually, but so will the proposed (q→read + QUEUE_LENGTH).
As I understand it, q→read == q→write just indicates an empty queue, not an overflowed one.
p.s. Out of interest, my H340 always overflows on shutdown with the standard queue length of 16…
Hehe, silly me. And I even wrote that code myself…
Linus: I knew you did, now I laugh.
Here’s an updated version that I’ve been using to find queue overflows for a while now. This one is enabled on logf builds only and keeps track of the queue name so you can actually tell which queue overflowed.
I’ll commit this one soon unless anyone objects.