Home arrow Blog arrow FreakZ arrow DevJournal - Lucky!!
DevJournal - Lucky!! | Print |
Written by Akiba   
Saturday, 12 April 2008

Found a nasty bug today. I've been working on the MAC layer recently and stumbled across this one by mistake. Currently, when a frame is received, it will throw it into a queue and post a receive event to the MAC layer. The MAC layer will then process the frame. However, I made a mistake when I was writing one of my tests and accidentally generated two receive interrupts sequentially. Only one frame was taken out of the queue though and the second one was lost.

It turns out that after an event is processed, it will be cleared which means that the second event also got cleared from the event queue. Anyways, I modified the code to process frames until the buffer is empty in case two or more frames arrive back-to-back. It fixed the test and it logically removes the bug as well. Glad I took the time to set up a test environment and write a bunch of tests on the stack. That bug would have been at least a few days to a week to debug in actual hardware.

Hits: 682
Trackback(0)
Comments (0)Add Comment

Write comment

busy
  No Comments.

Discuss...
< Prev   Next >