[ros-dev] [ros-diffs] [hbelusca] 58110: while (TRUE); (when something is unimplemented) ---> ASSERT(FALSE); // while (TRUE); (unless we deal with a 'noreturn' function), and in some cases, return an adequate value. Part...

Timo Kreuzer timo.kreuzer at web.de
Fri Jan 4 21:39:36 UTC 2013


Seriously, all these "while (TRUE);"  are retarded. All they do is hide 
bugs.
Especially in usermode and at high irql. (which most of them are from a 
quick glance)
The result is not "The OS cannot continue and halts", but "One thread of 
the OS silently stops doing anything, eating up cpu, while the rest of 
the OS happily continues to mess up the system even more, hiding the 
previous debug print under a shitload of unrelated stuff, so that you 
won't notice anything, except that something doesn't work."
And on high irql it makes the system hang. Which is not much better, 
since usually the reason of a hang is not closely related to the latest 
debug prints, so that's not what you are looking at. "normal users" have 
no idea how to handle that. They won't give you a bt, something people 
often do when experiencing a crash or failed assertion.

If it's fatal, either bugcheck or ASSERT or DbgBreakPoint();

Therefore: good work, killing this crap.
If there is a DPRINT1 + UNIMPLEMENTED or not ... who cares? It's not 
like this is production code ;-)

Timo




More information about the Ros-dev mailing list