Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi,
- I managed to compile and link all the dependencies libraries together
- with RTEMS 4.10.1 and Newlib, producing a final binary of about 32Mb.
- I run it with QEMU but a problem in runtime arose:
- The problem happens inside a c++ constructor, called from
- __do_global_ctors_aux (which if I understand it correctly, basically
- call all the constructors from the table of pointers to constructor
- defined in the .ctors section (i386-rtems-objdump -s -j .ctors
- message_producer_test | vim -)).
- __do_global_ctors_aux is called from RTEMS (_Thread_Handler
- ->INIT_NAME -> _init).
- The constructor is part of omniORB, omni_mutex::omni_mutex
- (http://pastebin.com/Pcd50Bni). Inside this constructor, a call to
- pthread_mutex_init is produced.
- From the gdb log (http://pastebin.com/QrRxWxse) I fear that the
- problem is allocating resources inside pthread_mutex_init, actually in
- objectallocate.c -> chainget.c -> chain.inl.
- At first, I though the problem was related to RTEMS running out of
- memory (and even tried to increase QEMU memory), but after taking a
- look to chain.inl, I think that the problem may be the omni_mutex
- constructor calling pthread_mutex_init and therefore allocating
- resources before RTEMS is completly ready. Although, RTEMS is the one
- calling __do_global_ctors_aux.
- I hope any of you can spread some light. In the meantime, what I have
- in mind is modify omniORB and delay the pthread_mutex_init call in
- omni_mutex.
- Kind regards,
- Ana
- P.S. In order to simplify the understanding of the problem, I attach
- the code from mutexinit.c (http://pastebin.com/cC6G2UjF), and since
- _Thread_Disable_dispatch(), _POSIX_Mutex_Allocate() and
- _Thread_Enable_dispatch() are inline functions, I also attached the
- unrolled version (http://pastebin.com/MxwXCCj5).
Advertisement
Add Comment
Please, Sign In to add comment