After some hard debuggin' with gdb i found out that this error is occurring at _Semaphore_Translate_core_mutex_return_code() but i still don't know why it happens. Here's the disassembly of the code where the error is generated<br>
<br>0x40040d88 <rtems_semaphore_obtain+192>: ld [ %l3 ], %g1<br>0x40040d8c <rtems_semaphore_obtain+196>: call 0x400410c8 <_Semaphore_Translate_core_mutex_return_code><br>0x40040d90 <rtems_semaphore_obtain+200>: ld [ %g1 + 0x34 ], %o0<br>
0x40040e20 <rtems_semaphore_obtain+344>: b 0x40040d8c <rtems_semaphore_obtain+196><br>0x40040e24 <rtems_semaphore_obtain+348>: ld [ %l3 ], %g1<br>0x40040ed8 <rtems_semaphore_obtain+528>: b 0x40040d8c <rtems_semaphore_obtain+196><br>
0x40040edc <rtems_semaphore_obtain+532>: ld [ %l3 ], %g1<br><br>And Stack copy:<br><br>Thread [3] (Suspended: Signal 'SIGSEGV' received. Description: Segmentation fault.) <br> 3 rtems_semaphore_obtain() c:\opt\rtems-4.10-mingw\src\rtems-4.10\cpukit\rtems\src\semobtain.c:90 0x40040edc <br>
2 <symbol is not available> 0x00000008 <br> 1 <symbol is not available> 0x0000000c <br><br>The last value i could get from %g1 is 0. Here's how i'm configuring semaphores:<br><br>#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 15<br>
<br><br>Any hints on what it can be failing? Should i set CONFIGURE_MAXIMUM_SEMAPHORES as well?<br><br><br>Best,<br>JM<br><br><br><br><br><div class="gmail_quote">On Fri, Nov 12, 2010 at 7:34 PM, Joel Sherrill <span dir="ltr"><<a href="mailto:joel.sherrill@oarcorp.com">joel.sherrill@oarcorp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 11/12/2010 01:05 PM, Joćo Rasta wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Daron,<br>
<br>
It is running on a LEON-3. The application exits raising the following exception:<br>
<br>
IU in error mode (tt = 0x07)<br>
<br>
which is a memory access to an unaligned address. The last instruction is this:<br>
<br>
4003bd74 d0006034 ld [%g1 + 0x34], %o0<br>
<br>
</blockquote></div>
What is the value of g1? Is it unaligned?<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
I don't understand why i have this error. The code where this error is being reported is compiled independently and then put in a library, but it uses the same cross-compiler as the main source code. I don't think i'm doing something wrong while compiling the library files, i use the same compilation flags..<br>
<br>
What can i be missing to have unaligned memory accesses?<br>
<br>
<br>
Best,<br>
JM<br>
<br>
<br>
<br></div><div class="im">
On Fri, Nov 12, 2010 at 6:43 PM, Daron Chabot <<a href="mailto:daron.chabot@gmail.com" target="_blank">daron.chabot@gmail.com</a> <mailto:<a href="mailto:daron.chabot@gmail.com" target="_blank">daron.chabot@gmail.com</a>>> wrote:<br>
<br>
<br>
On Fri, Nov 12, 2010 at 11:50 AM, Joćo Rasta<br></div><div class="im">
<<a href="mailto:freakforever@gmail.com" target="_blank">freakforever@gmail.com</a> <mailto:<a href="mailto:freakforever@gmail.com" target="_blank">freakforever@gmail.com</a>>> wrote:<br>
<br>
Hi,<br>
<br>
I have an RTEMS POSIX API application which comes to a point<br>
that if a small function (with some doubles passed as<br>
arguments) is called, the application exits with an error. At<br>
first i thought of increasing the stack space. I did this with<br>
CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE but the problem remains<br>
even if i remove all the contents of the function.<br>
<br>
1) Am i setting up the stack size correctly? I think i am, but<br>
i ask just in case..<br>
<br>
2) Is there any other explanation to why a function call<br>
crashes the application besides having a full stack? Again, i<br>
erased the function contents..<br>
<br>
<br>
What architecture is this running on ?<br>
<br>
What is the application exit error (message and/or return code)?<br>
<br>
It looks like all POSIX threads are created as floating-point<br>
tasks (FP state saved across context switches), so there<br>
"shouldn't" be a problem on that aspect...<br>
<br>
<br>
<br>
Best,<br>
JM<br>
<br>
<br>
<br>
_______________________________________________<br>
rtems-users mailing list<br></div>
<a href="mailto:rtems-users@rtems.org" target="_blank">rtems-users@rtems.org</a> <mailto:<a href="mailto:rtems-users@rtems.org" target="_blank">rtems-users@rtems.org</a>><div class="im"><br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
<br>
<br>
<br>
</div></blockquote><font color="#888888">
<br>
<br>
-- <br>
Joel Sherrill, Ph.D. Director of Research& Development<br>
joel.sherrill@OARcorp.com On-Line Applications Research<br>
Ask me about RTEMS: a free RTOS Huntsville AL 35805<br>
Support Available (256) 722-9985<br>
<br>
<br>
</font></blockquote></div><br>