<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-07 1:05 GMT+08:00 Mihaela Panescu <span dir="ltr"><<a href="mailto:mihaela.panescu@gmail.com" target="_blank">mihaela.panescu.@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:georgia,serif">Hi,<br><br></div><div style="font-family:georgia,serif">Can you try with the following configuration:<br>
<div style="margin-left:8px">

<font color="black" face="Segoe UI">#define CONFIGURE_MAXIMUM_POSIX_KEYS             16</font> <br>

<font color="black" face="Segoe UI">#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS  16<br></font></div></div></div></blockquote><div><br></div><div>It works. Thanks.</div><div><br></div><div>Peng </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div style="font-family:georgia,serif"><div style="margin-left:8px"><font color="black" face="Segoe UI"><br></font></div><div style="margin-left:8px"><font color="black" face="Segoe UI">Mihaela<br></font></div>
<div style="margin-left:8px">

<font color="black" face="Segoe UI"><br><br></font></div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Sun, Jul 6, 2014 at 4:21 PM, Peng Fan <span dir="ltr"><<a href="mailto:van.freenix@gmail.com" target="_blank">van.freenix@gmail.com</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>I use qemu and gdb to debug,  The following is the backtrace. and I found that _POSIX_Keys_Allocate() returns NULL/0, is this correct? Any tips? I do not know how to debug this, or there should be some shell configuration when call rtems_shell_init?</div>



<div><br></div><div>Breakpoint 1, pthread_key_create (key=0x20b2c8, </div><div>    destructor=0x157d55 <rtems_shell_env_free>)</div><div>    at ../../../../../../rtems-new/c/src/../../cpukit/posix/src/keycreate.c:41</div>



<div>41<span style="white-space:pre-wrap">        </span>  the_key = _POSIX_Keys_Allocate();</div><div>(gdb) bt</div><div>#0  <b>pthread_key_create</b> (key=0x20b2c8, </div><div>    destructor=0x157d55 <rtems_shell_env_free>)</div>



<div>    at ../../../../../../rtems-new/c/src/../../cpukit/posix/src/keycreate.c:41</div><div>#1  0x00157db8 in <b>rtems_shell_current_env_make_key </b>()</div><div>    at ../../../../../../rtems-new/c/src/../../cpukit/libmisc/shell/shell.c:109</div>



<div>#2  0x0013f2fa in _Once (once_state=0x2071d8 <rtems_shell_current_env_once+4>, </div><div>    init_routine=0x157da1 <rtems_shell_current_env_make_key>)</div><div>    at ../../../../../../rtems-new/c/src/../../cpukit/score/src/once.c:42</div>



<div>#3  0x00136aca in pthread_once (</div><div>    once_control=0x2071d4 <rtems_shell_current_env_once>, </div><div>    init_routine=0x157da1 <rtems_shell_current_env_make_key>)</div><div>    at ../../../../../../rtems-new/c/src/../../cpukit/posix/src/pthreadonce.c:39</div>



<div>#4  0x00158f96 in rtems_shell_main_loop (shell_env_arg=0x5a4118)</div><div>    at ../../../../../../rtems-new/c/src/../../cpukit/libmisc/shell/shell.c:707</div><div>#5  0x00158f2e in rtems_shell_task (task_argument=5914904)</div>



<div>    at ../../../../../../rtems-new/c/src/../../cpukit/libmisc/shell/shell.c:671</div><div>#6  0x0014207c in _Thread_Handler ()</div><div>    at ../../../../../../rtems-new/c/src/../../cpukit/score/src/threadhandler.c:192</div>



<div>Backtrace stopped: previous frame identical to this frame (corrupt stack?)</div><div><b>(gdb) n</b></div><div><b>43<span style="white-space:pre-wrap">     </span>  if ( !the_key ) {</b></div><div><b>(gdb) p the_key</b></div>



<div><b>$1 = (POSIX_Keys_Control *) 0x0</b></div><div><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Peng.<br><br><div class="gmail_quote">2014-07-05 15:44 GMT+08:00 Peng Fan <span dir="ltr"><<a href="mailto:van.freenix@gmail.com" target="_blank">van.freenix@gmail.com</a>></span>:<div>


<div><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I encountered a problem when using qemu-system-arm to simulate RTEMS RTL using `qemu-system-arm -no-reboot -net none -nographic -M realview-pbx-a9 -m 256M -kernel build/arm-rtems4.11-realview_pbx_a9_qemu/rtld`</div>




<div><br></div><div>it continuly outputs the following msg, but not run into a shell prompt:</div><div>"</div><div><div>pthread_setspecific(shell_current_env_key)</div><div>Starting shell....</div><div><br></div><div>




pthread_setspecific(shell_current_env_key)</div><div>Starting shell....</div><div><br></div><div>pthread_setspecific(shell_current_env_key)</div><div>Starting shell....</div><div><br></div><div>pthread_setspecific(shell_current_env_key)</div>




<div>Starting shell....</div></div><div>"</div><div>I found that  `<span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">sc</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">=</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">rtems_shell_init </span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">(</span><span style="font-size:12px;color:rgb(221,17,68);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">"fstst"</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">,</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;color:rgb(0,153,153);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">60</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">*</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;color:rgb(0,153,153);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">1024</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">,</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;color:rgb(0,153,153);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">150</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">,</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;color:rgb(221,17,68);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">"/dev/console"</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">,</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;color:rgb(0,153,153);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">0</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">,</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;color:rgb(0,153,153);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">1</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">,</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap"> </span><span style="font-size:12px;color:rgb(0,134,179);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">NULL</span><span style="font-size:12px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;line-height:18px;white-space:pre-wrap">);</span>`  returns immediately with the return value RTEMS_SUCCESSFULL.</div>




<div><br></div><div>If I `git reset --hard <b>ffc862cbf567</b>` to the following RTEMS commit,</div><div><div>"commit <b>ffc862cbf567</b>068d1cc2b8417bafdf808dfcc67a</div><div>Author: Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></div>




<div>Date:   Tue Sep 17 13:08:49 2013 +0200</div><div><br></div><div>    bsp/realview-pbx-a9: Add NULL pointer protection</div><div><br></div><div>    Qemu Git version 8641136c54d216edb5bb8ef723c754039b4ce5cf3 or later is</div>




<div>    required."</div></div><div>RTL runs well. I am not familiar with RTEMS internal, not sure why this. The qemu verison is 2.0.0. RTEMS is 4.11.</div><div><br></div><div>Regards,</div><div>Peng.</div></div>
</blockquote></div></div></div><br></div></div>
<br></div></div>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><br></blockquote></div><br></div>
</blockquote></div><br></div></div>