<div dir="ltr">Hi Joel,<div><br></div><div>Its possible interrupts are disabled. I am using the termios RTEMS_IO_RCVWAKEUP callback to get chars from console input. I accumulate them for a timer tick or two, then in a timer callback do rtems_message_queue_send()</div><div><br></div><div>The callstack above this from the rtems_message_queue_receive() in another task. The disable / enable interrupts wraps the 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">rtems_message_queue_send() and buffer management to protect against the timer being invoked again during that operation.</span></div><div><br></div><div>Should i be using a semaphore instead ?</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 February 2018 at 15:38, Joel Sherrill <span dir="ltr"><<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br>Based on the code, it looks like you have interrupts disabled<div>when you are making the call to 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">rtems_region_get_segment</span>().<br><div><br></div><div>For sure, you shouldn't free memory from an ISR though. <br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Feb 19, 2018 at 9:33 AM, Matthew J Fletcher <span dir="ltr"><<a href="mailto:amimjf@gmail.com" target="_blank">amimjf@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">For those interested the callstack looks like this;<div><br></div><div><div>bsp_fatal_extension() at bspclean.c:32 0x700d42ba<span style="white-space:pre-wrap">     </span></div><div>_User_extensions_Iterate() at userextiterate.c:175 0x700ef42a<span style="white-space:pre-wrap">    </span></div><div>_User_extensions_Fatal() at userextimpl.h:307 0x700eb9b2<span style="white-space:pre-wrap"> </span></div><div>_Terminate() at interr.c:35 0x700eb9b2<span style="white-space:pre-wrap">   </span></div><div>_Internal_error() at interr.c:52 0x700eb9e2<span style="white-space:pre-wrap">      </span></div><div>_Thread_Do_dispatch() at threaddispatch.c:186 0x700edd0a<span style="white-space:pre-wrap"> </span></div><div>_Thread_Dispatch_enable() at threaddispatch.h:227 0x700ef0f8<span style="white-space:pre-wrap">     </span></div><div>_Thread_Change_life() at threadrestart.c:684 0x700ef0f8<span style="white-space:pre-wrap">  </span></div><div>_Thread_Set_life_protection() at threadrestart.c:691 0x700ef10c<span style="white-space:pre-wrap">  </span></div><div>_API_Mutex_Lock() at apimutexlock.c:29 0x700eae86<span style="white-space:pre-wrap">        </span></div><div>_RTEMS_Lock_allocator() at allocatormutex.c:26 0x700eae6a<span style="white-space:pre-wrap">        </span></div><div>_Region_Get_and_lock() at regionimpl.h:76 0x700e9cdc<span style="white-space:pre-wrap">     </span></div><div>rtems_region_get_segment() at regiongetsegment.c:68 0x700e9cdc<span style="white-space:pre-wrap">   </span></div></div><div>...</div><div>... some of my code ...</div><div>...</div><div><div>_Thread_Handler() at threadhandler.c:134 0x700edde2<span style="white-space:pre-wrap">     </span></div><div>_Thread_Get() at threadget.c:38 0x700edda8<span style="white-space:pre-wrap">       </span></div></div><div><br></div><div>Its not clear to me what the issue might be.</div><div><br></div></div><div class="m_8657773146405539609HOEnZb"><div class="m_8657773146405539609h5"><div class="gmail_extra"><br><div class="gmail_quote">On 19 February 2018 at 13:13, Matthew J Fletcher <span dir="ltr"><<a href="mailto:amimjf@gmail.com" target="_blank">amimjf@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">All,<div><br></div><div>Replying to my own post, with <span style="color:rgb(0,0,0);white-space:pre-wrap">CPU_ENABLE_ROBUST_THREAD_<wbr>DISPATCH set FALSE i get a fatal exception, this on a Cortex-M7, rtems 5.0.0 from git.</span></div><div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">I think i will have to work around the new behavior somehow.</span><span class="m_8657773146405539609m_8499141459417915213HOEnZb"><font color="#888888"><br></font></span></font><span class="m_8657773146405539609m_8499141459417915213HOEnZb"><font color="#888888"><div><br></div>-- <br></font></span><span><div class="m_8657773146405539609m_8499141459417915213m_-1080242418760338005gmail_signature" data-smartmail="gmail_signature"><div><br>regards</div><div>---</div><div>Matthew J Fletcher</div><br></div>
</span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_8657773146405539609m_8499141459417915213gmail_signature" data-smartmail="gmail_signature"><div><br>regards</div><div>---</div><div>Matthew J Fletcher</div><br></div>
</div>
</div></div><br></div></div>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/users</a><br></blockquote></div><br></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div><br>regards</div><div>---</div><div>Matthew J Fletcher</div><br></div>
</div>