iostreams test failure on psim

Till Straumann strauman at slac.stanford.edu
Wed Jun 18 19:58:03 UTC 2008


Gotcha.

I ran into a 'invalid opcode' exception.

libstdc++ uses inline assembly emitting the 'lwsync' instruction
which is not implemented by PSIM. AFAIK, all the motorola
PPCs do not have this instruction either but it seems to be
either ignored or silently mapped to 'sync'.

I had patched (I while ago so I didn't remember :-()
my gcc (gcc/config/rs6000/rtems.h) saying:

/* NEVER use lwsync (would not execute on psim and e500; no
 * benefit on motorola 32-bit ppc since these don't implement
 * lwsync)
 */
#undef  TARGET_NO_LWSYNC
/* FIXME: we should test for rs6000_cpu. but rather than
 * using lwsync by default we want to NOT use it by default.
 * AFAIK, there is no RTEMS BSP that uses a CPU that actually
 * implements lwsync.
 */
#define TARGET_NO_LWSYNC 1

HTH
-- Till
Joel Sherrill wrote:
> Till Straumann wrote:
>> Stripped = useless. The more info the better; please send unstripped 
>> version
>>
>> T.
>>
>> Joel Sherrill wrote:
>>  
>>> Till Straumann wrote:
>>>    
>>>> Joel Sherrill wrote:
>>>>
>>>>      
>>>>> Till Straumann wrote:
>>>>>
>>>>>        
>>>>>> Joel Sherrill wrote:
>>>>>>
>>>>>>
>>>>>>          
>>>>>>> Joel Sherrill wrote:
>>>>>>>
>>>>>>>
>>>>>>>            
>>>>>>>> Till Straumann wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>              
>>>>>>>>> Weird. It works for me here on psim but I might use a different
>>>>>>>>> 4.9 snapshot (and different gcc/newlib patches).
>>>>>>>>>
>>>>>>>>> It probably fails creating the __mutex
>>>>>>>>>
>>>>>>>>> (e.g., rtems_gxx_mutex_init() panics if semaphore
>>>>>>>>> creation fails -- do you have enough configured?).
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                 
>>>>>>>> Yes.  I had hand checked that but just to make sure
>>>>>>>> I added 10 more to the configuration and it fails in the
>>>>>>>> same way.   I will check sis to make sure it isn't something
>>>>>>>> wrong with the linker script.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>               
>>>>>>> It does work on sis.  I would really appreciate knowing
>>>>>>> if it runs for you.
>>>>>>>
>>>>>>>
>>>>>>>             
>>>>>> As I said - it does. Looks like I last updated on May/25/2008.
>>>>>>
>>>>>> However, I also do have the patches for PR1247 applied
>>>>>> (but I think the odds for this making the difference are small
>>>>>> -- even though it affects locking (newlib locks) and adds a few
>>>>>> semaphores to the config. table.
>>>>>>
>>>>>> Another difference against the trunk is that I have the
>>>>>> patch applied which bans #ifdef <<ppc_cpu>> from cpukit
>>>>>> but that shouldn't make a difference either.
>>>>>>
>>>>>>
>>>>>>
>>>>>>           
>>>>> Neither of those should make a difference.  This code
>>>>> runs first before any other tasks are created.  There is
>>>>> only a single init task and idle.
>>>>>
>>>>>        
>>>>>> T.
>>>>>>
>>>>>> PS: I just ran CVS update, 'bootstrap', reconfigured and rebuilt
>>>>>>  (my same patches still in place) and cxx_iostream.exe still works
>>>>>> fine
>>>>>> on psim here...
>>>>>>
>>>>>>
>>>>>>           
>>>>> <sigh> are you also using the psim script from
>>>>> libbsp/powerpc/psim/tools?
>>>>>
>>>>> Hmm... what gcc and patch are you using?
>>>>>
>>>>>         
>>>> Another approach: why don't you send me your ELF file and I'll try to
>>>> run it
>>>> on my psim?
>>>>
>>>>       
>>> Attached.  I stripped it since the unstripped bzip'ed was >1MB.
>>>
>>> --joel
>>>    
>>>> T.
>>>>
>>>>      
>>>>> [joel at iceland build-powerpc-psim-rtems]$ powerpc-rtems4.9-gcc 
>>>>> --version
>>>>> powerpc-rtems4.9-gcc (GCC) 4.3.1
>>>>> Copyright (C) 2008 Free Software Foundation, Inc.
>>>>> This is free software; see the source for copying conditions.  There
>>>>> is NO
>>>>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>>>>> PURPOSE.
>>>>>
>>>>> [joel at iceland build-powerpc-psim-rtems]$ rpm -qf
>>>>> /opt/rtems-4.9/bin/powerpc-rtems4.9-gcc
>>>>> rtems-4.9-powerpc-rtems4.9-gcc-4.3.1-13.fc8
>>>>>
>>>>> It does appear that the gthr-rtems.h issue in 4.2 is fixed in 
>>>>> 4.3.1 so
>>>>> that shouldn't
>>>>> be bothering us.
>>>>>
>>>>> Maybe it is the timezone or gravitational differences. :(
>>>>>
>>>>> --joel
>>>>>
>>>>>        
>>>>>>>> I don't have any real changes outstanding now if you
>>>>>>>> want to doublecheck the head.  I would appreciat
>>>>>>>> e it.
>>>>>>>>
>>>>>>>> --joel
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>              
>>>>>>>>> T.
>>>>>>>>>
>>>>>>>>> Joel Sherrill wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> This looks vaguely familiar but I don't find it
>>>>>>>>>> in the rtems mail list archives:
>>>>>>>>>>
>>>>>>>>>> #3  0x0007b478 in ?? ()
>>>>>>>>>> #4  0x000038a0 in get_locale_mutex ()
>>>>>>>>>>     at 
>>>>>>>>>> ../../../../../gcc-4.3.1/libstdc++-v3/src/locale_init.cc:42
>>>>>>>>>> #5  0x00004740 in locale (this=0x7b2ec)
>>>>>>>>>>     at
>>>>>>>>>> ../../../../../gcc-4.3.1/libstdc++-v3/src/locale_init.cc:215
>>>>>>>>>> #6  0x00001830 in Init (this=<value optimized out>)
>>>>>>>>>>     at
>>>>>>>>>> /builddir/build/BUILD/rtems-4.9-powerpc-rtems4.9-gcc-4.3.1/build/powerpc-rtems4.9/m603e/libstdc++-v3/include/streambuf:447 
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> #7  0x00000250 in __static_initialization_and_destruction_0 (
>>>>>>>>>>     __initialize_p=<value optimized out>, __priority=<value
>>>>>>>>>> optimized out>)
>>>>>>>>>>     at
>>>>>>>>>> /opt/rtems-4.9/lib/gcc/powerpc-rtems4.9/4.3.1/include/c++/iostream:77 
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> #8  0x00065a98 in __do_global_ctors_aux ()
>>>>>>>>>> #9  0x00065b10 in _init ()
>>>>>>>>>> #10 0x00055488 in _Thread_Handler ()
>>>>>>>>>>
>>>>>>>>>> I traced but can't tell much except that somewhere below 
>>>>>>>>>> here, it
>>>>>>>>>> is dying.
>>>>>>>>>> All object create calls are working but I am remembering
>>>>>>>>>> something was
>>>>>>>>>> broken in this area and we had a patch to gcc.
>>>>>>>>>>
>>>>>>>>>>   __gnu_cxx::__mutex&
>>>>>>>>>>   get_locale_mutex()
>>>>>>>>>>   {
>>>>>>>>>>     static __gnu_cxx::__mutex locale_mutex;
>>>>>>>>>>     return locale_mutex;
>>>>>>>>>>   }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                   
>>>>>>>> -- 
>>>>>>>> Joel Sherrill, Ph.D.             Director of Research & 
>>>>>>>> Development
>>>>>>>> joel.sherrill at OARcorp.com        On-Line Applications Research
>>>>>>>> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>>>>>>>>    Support Available             (256) 722-9985
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> rtems-users mailing list
>>>>>>>> rtems-users at rtems.com
>>>>>>>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>               
>>>>       
>>>     
>>
>>   
>
>




More information about the users mailing list