Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Strange exception and software reboot

exception handling software reboot

  • Please log in to reply
5 replies to this topic

#1 Verdris

Verdris

    Advanced Member

  • Members
  • PipPipPip
  • 128 posts
  • LocationReno, NV

Posted 03 May 2013 - 01:49 AM

Hi all,

 

I occasionally get a strange exception "System.Exception". This is thrown during a try/catch block of mathematics, with the exception handling only there "just in case". Well, I'm glad it is, because I'm getting this unknown exception. It seems to be pathological: once it shows up once, it keeps showing up. So, in the handling, I want to reboot the board.

 

Does the NP2 support 

PowerState.RebootDevice(Boolean)

 

And can I stick to a simple software reboot, or should I set the bool to false for a hard reset?



#2 ziggurat29

ziggurat29

    Advanced Member

  • Members
  • PipPipPip
  • 244 posts

Posted 03 May 2013 - 12:27 PM

it is supported, I use it.

its not clear to me if soft reboot does anything different on np2; in my case I am using it as an emergency reset, so I use 'hard' in case it actually does something interesting and different.  for similar reasons, I use the variant with the timeout specified, because I really and truly want to reboot, giving my Program some opportunity to get its affairs in order, but not an infinite amount of time.

 

EDIT:  oh and I'm curious about your exception-generating math; unless it's a garden variety divide-by-zero.  have you looked at the exception text, or the stack trace?



#3 Verdris

Verdris

    Advanced Member

  • Members
  • PipPipPip
  • 128 posts
  • LocationReno, NV

Posted 03 May 2013 - 07:02 PM

it is supported, I use it.

its not clear to me if soft reboot does anything different on np2; in my case I am using it as an emergency reset, so I use 'hard' in case it actually does something interesting and different.  for similar reasons, I use the variant with the timeout specified, because I really and truly want to reboot, giving my Program some opportunity to get its affairs in order, but not an infinite amount of time.

 

EDIT:  oh and I'm curious about your exception-generating math; unless it's a garden variety divide-by-zero.  have you looked at the exception text, or the stack trace?

The exception text is "Not Supported" and there is no stack trace or disassembly available for this exception.

 

What exactly does the timeout in the reset do?



#4 ziggurat29

ziggurat29

    Advanced Member

  • Members
  • PipPipPip
  • 244 posts

Posted 03 May 2013 - 11:41 PM

Strictly speaking, I don't know.  I think it is meant to threshold how much time the handlers have before the CLR gives up and reboots regardless of their completion.  Some of that stuff, like hard and soft, I think has more meaning on different implementations of netmf (i.e. other than netduino's), but again I am speaking from ignorance and my google fu failed me when I tried to find out when I originally wrote the code.

 

I'm still curious about the math op that caused the exception to be thrown.  Can you not at least step the code and see which one threw it?  It might give you a clue to the underlying cause.  And by 'stack trace' I mean there is a member of the Exception object called stack trace, rather than something automatically spewed out to the console (like when java throws an exception).  If that clarifies anything.



#5 Verdris

Verdris

    Advanced Member

  • Members
  • PipPipPip
  • 128 posts
  • LocationReno, NV

Posted 08 May 2013 - 05:46 PM

Strictly speaking, I don't know.  I think it is meant to threshold how much time the handlers have before the CLR gives up and reboots regardless of their completion.  Some of that stuff, like hard and soft, I think has more meaning on different implementations of netmf (i.e. other than netduino's), but again I am speaking from ignorance and my google fu failed me when I tried to find out when I originally wrote the code.

 

I'm still curious about the math op that caused the exception to be thrown.  Can you not at least step the code and see which one threw it?  It might give you a clue to the underlying cause.  And by 'stack trace' I mean there is a member of the Exception object called stack trace, rather than something automatically spewed out to the console (like when java throws an exception).  If that clarifies anything.

I don't know anymore either. The exception hasn't been thrown for days now. I log all exceptions to an errors.txt file, and it's happily empty.



#6 ziggurat29

ziggurat29

    Advanced Member

  • Members
  • PipPipPip
  • 244 posts

Posted 08 May 2013 - 08:58 PM

I don't know anymore either. The exception hasn't been thrown for days now. I log all exceptions to an errors.txt file, and it's happily empty.

ah, heisenbug.  fun!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.