Powerpc and C++ - compiler query

Rosimildo da Silva rdasilva at connecttel.com
Wed Jul 26 23:11:43 UTC 2000


Nick.SIMON at syntegra.bt.co.uk wrote:
> 
> Dear chaps,
> 
> I'm having some jolly fun (i.e. inexplicable crashes) involving two tasks
> written in C++.
> 
> The problem manifests itself when running this chunk of code, which appears
> in many places after function calls:
> 
>  ADDI     R9,R28,0x0004
>  LWZ      R11,0x0000(R9)
>  ADDI     R9,R11,0x0004
>  LWZ      R11,0x0000(R9)
>  LWZ      R0,0x0000(R11)
> 
> R28 has been set previously from the result of get_eh_context (whatever that
> is)
> 
> This code results in an unnamed pointer in memory being overwritten with the
> value it pointed to.  Like an element being taken off a queue.
> Unfortunately, it seems to run out & so going to zero, and subsequently
> crashing.  This chain of pointers appears to be used by both threads, which
> I believe is the cause of the problem.
> 
> I am using rtems 4.5.0 beta 3 (not 3a) and the tools from the RPMs.  I'd be
> grateful for any light shed, especially on the role of get_eh_context.


Nick,

do these tasks have try/catch blocks ? If so, try to remove them
and isolate the problem. Remember that we have added
multi-threading capabilities when handling C++ exceptions.
I guess in beta3a was exactly when it was introduced.

lib/libc/gxx_wrappers.c implements the functions called by GCC
to provide thread-safe exceptions. You might be able to play
with it, and see if it is something there. I have added a 
preprocessor "flag" in there in case someone needs to 
debug this a little. :-)

Rosimildo.










-- 
Rosimildo da Silva            rdasilva at connectel.com 
ConnectTel, Inc.              Austin, TX -- USA      
Phone : 512-338-1111          Fax : 512-918-0449     
Mobile: 512-632-7579                                 
Company Page: http://www.connecttel.com              
Home Page: http://members.xoom.com/rosimildo/



More information about the users mailing list