Any insight on what targets _endless_loop__ in libcrt0

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Any insight on what targets _endless_loop__ in libcrt0

Andrew McLaren
Hi all,
 
I've got a situation where some logic (running on a 439 MSP430) ends up in
_endless_loop__ which is part of libcrt0. This can happen after the logic
has been happily running some intensive test logic for hours, and I'm trying
to ascertain how it could end up there. The debugger is not giving me a lot
of help (specifically no traceback of how it got here).
 
There is always a possibility that some memory corruption of mine has let
the logic go awol, and by its nature if it hits this logic it will be
trapped here. What I suspect is more likely is that _endless_loop__ is the
deliberate target of an unrecoverable error in one of the C functions (which
itself is no doubt triggered by something I have done!).
 
Can someone who understands the msp C runtime support give me any insights
into the intent behind _endless_loop__, and in what situations it could be
invoked. If I understand this better it may give me some clues where to
look.
 
Thanks, regards, and a great Christmas to all.
 
Andrew

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: Any insight on what targets _endless_loop__ in libcrt0

Peter Bigot-4
__endless_loop__ is placed in section .fini0 (the last of the nine reserved
finalization sections).  One way it can be reached in a normal application
is falling off the end of main().  It is what follows any other
finalization routines, including __stop_progExec__, which is normally empty
and appears in section .fini9.  __stop_progExec__ is jumped to by exit(3c)
if the macro definition of exit() from stdlib.h in msp430-libc is invoked.

So: Returning from main(), invoking exit(3c), or other magic that causes
code to jump into the finalization sections.

Peter


On Fri, Dec 20, 2013 at 6:31 PM, Andrew McLaren <[hidden email]>wrote:

> Hi all,
>
> I've got a situation where some logic (running on a 439 MSP430) ends up in
> _endless_loop__ which is part of libcrt0. This can happen after the logic
> has been happily running some intensive test logic for hours, and I'm
> trying
> to ascertain how it could end up there. The debugger is not giving me a lot
> of help (specifically no traceback of how it got here).
>
> There is always a possibility that some memory corruption of mine has let
> the logic go awol, and by its nature if it hits this logic it will be
> trapped here. What I suspect is more likely is that _endless_loop__ is the
> deliberate target of an unrecoverable error in one of the C functions
> (which
> itself is no doubt triggered by something I have done!).
>
> Can someone who understands the msp C runtime support give me any insights
> into the intent behind _endless_loop__, and in what situations it could be
> invoked. If I understand this better it may give me some clues where to
> look.
>
> Thanks, regards, and a great Christmas to all.
>
> Andrew
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: Any insight on what targets _endless_loop__ in libcrt0

Andrew McLaren
Thanks Peter!
 
Was all to easy. An untrapped error had made it all the way back to main().
 
Regards
 
Andrew

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Bigot
Sent: Saturday, 21 December 2013 2:27 p.m.
To: [hidden email]
Cc: GCC for MSP430 - http://mspgcc.sf.net
Subject: Re: [Mspgcc-users] Any insight on what targets _endless_loop__ in
libcrt0


__endless_loop__ is placed in section .fini0 (the last of the nine reserved
finalization sections).  One way it can be reached in a normal application
is falling off the end of main().  It is what follows any other finalization
routines, including __stop_progExec__, which is normally empty and appears
in section .fini9.  __stop_progExec__ is jumped to by exit(3c) if the macro
definition of exit() from stdlib.h in msp430-libc is invoked.

So: Returning from main(), invoking exit(3c), or other magic that causes
code to jump into the finalization sections.


Peter



On Fri, Dec 20, 2013 at 6:31 PM, Andrew McLaren <[hidden email]>
wrote:


Hi all,

I've got a situation where some logic (running on a 439 MSP430) ends up in
_endless_loop__ which is part of libcrt0. This can happen after the logic
has been happily running some intensive test logic for hours, and I'm trying
to ascertain how it could end up there. The debugger is not giving me a lot
of help (specifically no traceback of how it got here).

There is always a possibility that some memory corruption of mine has let
the logic go awol, and by its nature if it hits this logic it will be
trapped here. What I suspect is more likely is that _endless_loop__ is the
deliberate target of an unrecoverable error in one of the C functions (which
itself is no doubt triggered by something I have done!).

Can someone who understands the msp C runtime support give me any insights
into the intent behind _endless_loop__, and in what situations it could be
invoked. If I understand this better it may give me some clues where to
look.

Thanks, regards, and a great Christmas to all.

Andrew

----------------------------------------------------------------------------
--
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831
<http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users





------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users