<html><body><div style="color:#000; background-color:#fff; font-family:bookman old style, new york, times, serif;font-size:12pt"><div><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'bookman old style', 'new york', times, serif; background-color: transparent; font-style: normal;"><span>Hi,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'bookman old style', 'new york', times, serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'bookman old style', 'new york', times, serif; background-color: transparent; font-style: normal;"><span>Thanks a lot for the posting, I think what you have simulated there is exactly one of our problem manifestations. Indeed, after that pointer is NULL in </span><span style="font-family: 'times new roman', 'new york', times, serif; font-size:
 12pt;">_Thread_queue_Process_timeout, the system state is invalid and probably other bad manifestations we've seen, start to appear.</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;">One question, please, if it's ok with you - for a fast fix, what would you suggest, either verify that pointer for NULL and return immediately, if it's invalid, or wait for a fixing patch from you guys ?</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new
 york', times, serif; background-color: transparent; font-style: normal;">Or maybe disable interrupts altogether during the function call duration ? Would the NULL verification / interrupt disabling have negative impacts elsewhere ?</div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">Again, we are no experts in RTEMS, so sorry if my questions may not seem valid.</div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">Thanks a lot, cheers,</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color:
 transparent; font-style: normal;">Cezar</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'bookman old style', 'new york', times, serif; background-color: transparent; font-style: normal;"><span><br></span></div><div><br></div>  <div style="font-family: 'bookman old style', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Sebastian Huber <sebastian.huber@embedded-brains.de><br> <b><span style="font-weight: bold;">To:</span></b> rtems-users@rtems.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, August 22, 2013 6:37 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: Synchronization problem in message queue mechanism<br> </font> </div> <div class="y_msg_container"><br>Hello,<br><br>for a test case
 please have a look at the attached patch.  If I run this test <br>on a simulator I get:<br><br>(gdb) b threadqprocesstimeout.c:42 if the_thread_queue == 0<br>Breakpoint 3 at 0x201da00: file <br>../../../../../../rtems/c/src/../../cpukit/score/src/threadqprocesstimeout.c, <br>line 42.<br>(gdb) r<br>Starting program: <br>/scratch/git-rtems-testing/rtems/build-sparc-sis-rtems/sparc-rtems4.11/c/sis/testsuites/sptests/spintrcritical20/spintrcritical20.exe <br><br><br><br>*** TEST INTERRUPT CRITICAL SECTION 20 ***<br><br>Support - rtems_timer_create - creating timer 1<br><br>Breakpoint 3, _Thread_queue_Process_timeout (the_thread=0x2046b00) at <br>../../../../../../rtems/c/src/../../cpukit/score/src/threadqprocesstimeout.c:42<br>42        if ( the_thread_queue->sync_state != <br>THREAD_BLOCKING_OPERATION_SYNCHRONIZED &&<br>(gdb) p the_thread_queue<br>$1 = (Thread_queue_Control *) 0x0<br><br>So we have a NULL pointer access
 in _Thread_queue_Process_timeout().  This <br>destroys the system state.<br><br>On real systems the sequence in the test case can happen with nested interrupts <br>which interrupt the clock tick handler (this is a common setup).<br><br>-- <br>Sebastian Huber, embedded brains GmbH<br><br>Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>Phone   : +49 89 189 47 41-16<br>Fax     : +49 89 189 47 41-09<br>E-Mail  : <a ymailto="mailto:sebastian.huber@embedded-brains.de" href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a><br>PGP     : Public key available on request.<br><br>Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br><br>_______________________________________________<br>rtems-users mailing list<br><a ymailto="mailto:rtems-users@rtems.org" href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><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></div> </div> </div>  </div></body></html>