View Single Post
  #1   Spotlight this post!  
Unread 23-10-2013, 20:44
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
VxWorks exception handling and division by zero

I've been wondering how VxWorks on the cRIO reacts to uncaught exceptions in the user program. As I understand it, the user program is loaded as a kernel module, so it seems like an uncaught exception should result in a kernel panic. I wanted to test this out, so I wrote code that I expected to throw a runtime error on a button press. I tried a piece of code that would simply output the result of "1/0" to stderr. The result, however, was that "0" was printed to stderr, and no error or unexpected behavior occurred. The same code snippet,
Code:
std::cerr << 1/0 << std::endl;
in a native program caused a crash. So now I am left with two questions:

How does VxWorks respond to an uncaught exception in a kernel module?

Why is the result of "1/0" "0" in WindRiver C++?
Reply With Quote