<div dir="ltr">Hi,<div><br></div><div>The scheduler doesnt seem to be involved in rtems_task_exit. I believe the scheduler is doing something wrong during the execution of rtems_yield for TA1. Is it related to isr_level? Please find the stacktrace below for execution of TA5 after TA1 yields:</div><div><br></div><div>(gdb) <br>0x00103c28 in Task5 (argument=0) at /home/richi/quick-start/src/rtems/c/src/../../testsuites/sptests/sp16/task5.c:53<br>53 status = rtems_region_get_segment(<br>(gdb) <br>60 puts_nocr( "TA5 - got segment from region 1 - " );<br>(gdb) ni<br>0x00103c2e 60 puts_nocr( "TA5 - got segment from region 1 - " );<br>(gdb) <br>0x00103c32 60 puts_nocr( "TA5 - got segment from region 1 - " );<br>(gdb) <br>61 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c38 61 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c3a 61 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c3e 61 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c42 61 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c44 61 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c46 61 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c4a 61 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c4e 61 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>62 new_line;<br>(gdb) <br>0x00103c56 62 new_line;<br>(gdb) <br>0x00103c5a 62 new_line;<br>(gdb) <br>64 status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 );<br>(gdb) <br>0x00103c62 64 status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 );<br>(gdb) ni<br>0x00103c66 64 status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 );<br>(gdb) <br>0x00103c68 64 status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 );<br>(gdb) <br>0x00103c6a 64 status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 );<br>(gdb) <br>0x00103c6c 64 status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 );<br>(gdb) <br>0x00103c6e 64 status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 );<br>(gdb) <br>0x00103c72 64 status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 );<br>(gdb) <br>65 puts_nocr(<br>(gdb) <br>0x00103c78 65 puts_nocr(<br>(gdb) <br>0x00103c7c 65 puts_nocr(<br>(gdb) <br>68 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c82 68 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c84 68 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c88 68 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c8c 68 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c8e 68 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c90 68 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c94 68 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>0x00103c98 68 Put_address_from_area_1( segment_address_2 );<br>(gdb) <br>69 new_line;<br>(gdb) <br>0x00103ca0 69 new_line;<br>(gdb) <br>0x00103ca4 69 new_line;<br>(gdb) <br>71 puts( "TA5 - rtems_task_exit" );<br>(gdb) <br>0x00103cac 71 puts( "TA5 - rtems_task_exit" );<br>(gdb) <br>0x00103cb0 71 puts( "TA5 - rtems_task_exit" );<br>(gdb) <br>72 rtems_task_exit();<br>(gdb) si<br>rtems_task_exit () at /home/richi/quick-start/src/rtems/c/src/../../cpukit/rtems/src/taskexit.c:23<br>23 {<br>(gdb) ni<br>0x0010ab42 23 {<br>(gdb) <br>0x0010ab44 23 {<br>(gdb) <br>27 cpu_self = _Thread_Dispatch_disable();<br>(gdb) <br>0x0010ab4a 27 cpu_self = _Thread_Dispatch_disable();<br>(gdb) <br>28 executing = _Per_CPU_Get_executing( cpu_self );<br>(gdb) <br>0x0010ab4e 28 executing = _Per_CPU_Get_executing( cpu_self );<br>(gdb) <br>0x0010ab52 28 executing = _Per_CPU_Get_executing( cpu_self );<br>(gdb) <br>30 _Thread_Exit(<br>(gdb) si<br>0x0010ab56 30 _Thread_Exit(<br>(gdb) <br>0x0010ab58 30 _Thread_Exit(<br>(gdb) <br>0x0010ab5a 30 _Thread_Exit(<br>(gdb) <br>_Thread_Exit (executing=0x2057c0 <_Per_CPU_Information>, set=THREAD_LIFE_PROTECTED, exit_value=0x0) at /home/richi/quick-start/src/rtems/c/src/../../cpukit/score/src/threadrestart.c:537<br>537 {<br>(gdb) ni<br>0x00110da4 537 {<br>(gdb) <br>0x00110da6 537 {<br>(gdb) <br>0x00110da8 537 {<br>(gdb) <br>0x00110daa 537 {<br>(gdb) <br>0x00110dac 537 {<br>(gdb) <br>548 _Thread_State_acquire( executing, &lock_context );<br>(gdb) <br>0x00110db2 548 _Thread_State_acquire( executing, &lock_context );<br>(gdb) <br>0x00110db4 548 _Thread_State_acquire( executing, &lock_context );<br>(gdb) <br>0x00110db6 548 _Thread_State_acquire( executing, &lock_context );<br>(gdb) <br>549 _Thread_Set_exit_value( executing, exit_value );<br>(gdb) <br>0x00110dbc 549 _Thread_Set_exit_value( executing, exit_value );<br>(gdb) <br>0x00110dbe 549 _Thread_Set_exit_value( executing, exit_value );<br>(gdb) <br>550 _Thread_Change_life_locked(<br>(gdb) si<br>0x00110dc4 550 _Thread_Change_life_locked(<br>(gdb) <br>0x00110dc6 550 _Thread_Change_life_locked(<br>(gdb) <br>0x00110dc8 550 _Thread_Change_life_locked(<br>(gdb) <br>0x00110dca 550 _Thread_Change_life_locked(<br>(gdb) <br>_Thread_Change_life_locked (the_thread=0x1101e5 <_Thread_State_acquire+28>, clear=(unknown: 2158976), set=(THREAD_LIFE_CHANGE_DEFERRED | THREAD_LIFE_DETACHED | unknown: 2103264), ignore=(THREAD_LIFE_TERMINATING | unknown: 2159008)) at /home/richi/quick-start/src/rtems/c/src/../../cpukit/score/src/threadrestart.c:245<br>245 {<br>(gdb) <br>0x001109bc 245 {<br>(gdb) ni<br>0x001109be 245 {<br>(gdb) <br>0x001109c0 245 {<br>(gdb) <br>0x001109c2 245 {<br>(gdb) <br>0x001109c4 245 {<br>(gdb) <br>0x001109c6 245 {<br>(gdb) <br>249 previous = the_thread->Life.state;<br>(gdb) <br>0x001109ca 249 previous = the_thread->Life.state;<br>(gdb) <br>0x001109ce 249 previous = the_thread->Life.state;<br>(gdb) <br>250 state = previous;<br>(gdb) <br>0x001109d2 250 state = previous;<br>(gdb) <br>251 state &= ~clear;<br>(gdb) <br>0x001109d6 251 state &= ~clear;<br>(gdb) <br>0x001109d8 251 state &= ~clear;<br>(gdb) <br>0x001109da 251 state &= ~clear;<br>(gdb) <br>0x001109dc 251 state &= ~clear;<br>(gdb) <br>252 state |= set;<br>(gdb) <br>0x001109e0 252 state |= set;<br>(gdb) <br>0x001109e2 252 state |= set;<br>(gdb) <br>0x001109e4 252 state |= set;<br>(gdb) <br>253 the_thread->Life.state = state;<br>(gdb) <br>0x001109e8 253 the_thread->Life.state = state;<br>(gdb) <br>0x001109ea 253 the_thread->Life.state = state;<br>(gdb) <br>255 state &= ~ignore;<br>(gdb) <br>0x001109f0 255 state &= ~ignore;<br>(gdb) <br>0x001109f2 255 state &= ~ignore;<br>(gdb) <br>0x001109f4 255 state &= ~ignore;<br>(gdb) <br>0x001109f6 255 state &= ~ignore;<br>(gdb) <br>258 _Thread_Is_life_change_allowed( state )<br>(gdb) <br>0x001109fa 258 _Thread_Is_life_change_allowed( state )<br>(gdb) <br>0x001109fe 258 _Thread_Is_life_change_allowed( state )<br>(gdb) <br>257 if (<br>(gdb) <br>0x00110a02 257 if (<br>(gdb) <br>259 && _Thread_Is_life_changing( state )<br>(gdb) <br>0x00110a06 259 && _Thread_Is_life_changing( state )<br>(gdb) <br>0x00110a0a 259 && _Thread_Is_life_changing( state )<br>(gdb) <br>0x00110a0c 259 && _Thread_Is_life_changing( state )<br>(gdb) <br>0x00110a0e 259 && _Thread_Is_life_changing( state )<br>(gdb) <br>261 the_thread->is_preemptible = the_thread->Start.is_preemptible;<br>(gdb) <br>0x00110a12 261 the_thread->is_preemptible = the_thread->Start.is_preemptible;<br>(gdb) <br>0x00110a16 261 the_thread->is_preemptible = the_thread->Start.is_preemptible;<br>(gdb) <br>0x00110a18 261 the_thread->is_preemptible = the_thread->Start.is_preemptible;<br>(gdb) <br>262 the_thread->budget_algorithm = the_thread->Start.budget_algorithm;<br>(gdb) <br>0x00110a1e 262 the_thread->budget_algorithm = the_thread->Start.budget_algorithm;<br>(gdb) <br>0x00110a22 262 the_thread->budget_algorithm = the_thread->Start.budget_algorithm;<br>(gdb) <br>0x00110a24 262 the_thread->budget_algorithm = the_thread->Start.budget_algorithm;<br>(gdb) <br>263 the_thread->budget_callout = the_thread->Start.budget_callout;<br>(gdb) <br>0x00110a2a 263 the_thread->budget_callout = the_thread->Start.budget_callout;<br>(gdb) <br>0x00110a2e 263 the_thread->budget_callout = the_thread->Start.budget_callout;<br>(gdb) <br>0x00110a30 263 the_thread->budget_callout = the_thread->Start.budget_callout;<br>(gdb) <br>265 _Thread_Add_post_switch_action(<br>(gdb) <br>0x00110a36 265 _Thread_Add_post_switch_action(<br>(gdb) <br>0x00110a3a 265 _Thread_Add_post_switch_action(<br>(gdb) <br>0x00110a3e 265 _Thread_Add_post_switch_action(<br>(gdb) <br>0x00110a42 265 _Thread_Add_post_switch_action(<br>(gdb) <br>0x00110a44 265 _Thread_Add_post_switch_action(<br>(gdb) <br>0x00110a46 265 _Thread_Add_post_switch_action(<br>(gdb) <br>272 return previous;<br>(gdb) <br>273 }<br>(gdb) <br>0x00110a4e 273 }<br>(gdb) <br>0x00110a50 273 }<br>(gdb) <br>0x00110a52 273 }<br>(gdb) <br>_Thread_Exit (executing=0x2017f8 <_RTEMS_tasks_Objects+2576>, set=(THREAD_LIFE_TERMINATING | THREAD_LIFE_DETACHED), exit_value=0x0) at /home/richi/quick-start/src/rtems/c/src/../../cpukit/score/src/threadrestart.c:556<br>556 _Thread_State_release( executing, &lock_context );<br>(gdb) <br>0x00110dd2 556 _Thread_State_release( executing, &lock_context );<br>(gdb) <br>0x00110dd4 556 _Thread_State_release( executing, &lock_context );<br>(gdb) so<br>source command requires file name of file to source.<br>(gdb) <br>source command requires file name of file to source.<br>(gdb) si<br>0x00110dd6 556 _Thread_State_release( executing, &lock_context );<br>(gdb) <br>_Thread_State_release (the_thread=0x0, lock_context=0x14) at /home/richi/quick-start/src/rtems/cpukit/include/rtems/score/threadimpl.h:570<br>570 {<br>(gdb) <br>0x0011023e 570 {<br>(gdb) ni<br>0x00110240 570 {<br>(gdb) <br>0x00110242 570 {<br>(gdb) <br>0x00110244 570 {<br>(gdb) <br>571 _Thread_State_release_critical( the_thread, lock_context );<br>(gdb) <br>0x00110248 571 _Thread_State_release_critical( the_thread, lock_context );<br>(gdb) <br>0x0011024a 571 _Thread_State_release_critical( the_thread, lock_context );<br>(gdb) <br>572 _ISR_lock_ISR_enable( lock_context );<br>(gdb) <br>0x00110250 572 _ISR_lock_ISR_enable( lock_context );<br>(gdb) <br>0x00110252 572 _ISR_lock_ISR_enable( lock_context );<br>(gdb) <br>0x00110254 572 _ISR_lock_ISR_enable( lock_context );<br>(gdb) <br>573 }<br>(gdb) <br>0x0011025a 573 }<br>(gdb) <br>0x0011025c 573 }<br>(gdb) <br>0x0011025e 573 }<br>(gdb) <br>_Thread_Exit (executing=0x2017f8 <_RTEMS_tasks_Objects+2576>, set=(THREAD_LIFE_TERMINATING | THREAD_LIFE_DETACHED), exit_value=0x0) at /home/richi/quick-start/src/rtems/c/src/../../cpukit/score/src/threadrestart.c:557<br>557 }<br>(gdb) <br>0x00110ddc 557 }<br>(gdb) <br>0x00110dde 557 }<br>(gdb) <br>0x00110de0 557 }<br>(gdb) <br>rtems_task_exit () at /home/richi/quick-start/src/rtems/c/src/../../cpukit/rtems/src/taskexit.c:36<br>36 _Thread_Dispatch_direct( cpu_self );<br>(gdb) <br>0x0010ab60 36 _Thread_Dispatch_direct( cpu_self );<br>(gdb) si<br>_Thread_Dispatch_direct (cpu_self=0x2017f8 <_RTEMS_tasks_Objects+2576>) at /home/richi/quick-start/src/rtems/c/src/../../cpukit/score/src/threaddispatch.c:351<br>351 {<br>(gdb) <br>0x0010ec7e 351 {<br>(gdb) <br>0x0010ec80 351 {<br>(gdb) <br>0x0010ec82 351 {<br>(gdb) ni<br>354 if ( cpu_self->thread_dispatch_disable_level != 1 ) {<br>(gdb) <br>0x0010ec86 354 if ( cpu_self->thread_dispatch_disable_level != 1 ) {<br>(gdb) <br>0x0010ec88 354 if ( cpu_self->thread_dispatch_disable_level != 1 ) {<br>(gdb) <br>0x0010ec8a 354 if ( cpu_self->thread_dispatch_disable_level != 1 ) {<br>(gdb) <br>358 _ISR_Local_disable( level );<br>(gdb) <br>0x0010ec96 358 _ISR_Local_disable( level );<br>(gdb) <br>359 _Thread_Do_dispatch( cpu_self, level );<br>(gdb) <br>0x0010ec9a 359 _Thread_Do_dispatch( cpu_self, level );<br>(gdb) <br>0x0010ec9c 359 _Thread_Do_dispatch( cpu_self, level );<br>(gdb) si<br>_Thread_Do_dispatch (cpu_self=0x1, level=20) at /home/richi/quick-start/src/rtems/c/src/../../cpukit/score/src/threaddispatch.c:260<br>260 {<br>(gdb) <br>0x0010ebb6 260 {<br>(gdb) <br>0x0010ebb8 260 {<br>(gdb) <br>0x0010ebba 260 {<br>(gdb) <br>0x0010ebbc 260 {<br>(gdb) <br>267 !_ISR_Is_enabled( level )<br>(gdb) <br>0x0010ebc0 267 !_ISR_Is_enabled( level )<br>(gdb) ni<br>0x0010ebc4 267 !_ISR_Is_enabled( level )<br>(gdb) <br>0x0010ebc6 267 !_ISR_Is_enabled( level )<br>(gdb) <br>0x0010ebca 267 !_ISR_Is_enabled( level )<br>(gdb) <br>266 if (<br>(gdb) <br>0x0010ebce 266 if (<br>(gdb) <br>276 executing = cpu_self->executing;<br>(gdb) <br>0x0010ebd8 276 executing = cpu_self->executing;<br>(gdb) <br>0x0010ebda 276 executing = cpu_self->executing;<br>(gdb) <br>281 level = _Thread_Preemption_intervention( executing, cpu_self, level );<br>(gdb) <br>0x0010ebde 281 level = _Thread_Preemption_intervention( executing, cpu_self, level );<br>(gdb) <br>0x0010ebe0 281 level = _Thread_Preemption_intervention( executing, cpu_self, level );<br>(gdb) <br>0x0010ebe2 281 level = _Thread_Preemption_intervention( executing, cpu_self, level );<br>(gdb) <br>0x0010ebe6 281 level = _Thread_Preemption_intervention( executing, cpu_self, level );<br>(gdb) <br>282 heir = _Thread_Get_heir_and_make_it_executing( cpu_self );<br>(gdb) <br>0x0010ebea 282 heir = _Thread_Get_heir_and_make_it_executing( cpu_self );<br>(gdb) <br>0x0010ebee 282 heir = _Thread_Get_heir_and_make_it_executing( cpu_self );<br>(gdb) <br>289 if ( heir == executing )<br>(gdb) <br>0x0010ebf2 289 if ( heir == executing )<br>(gdb) <br>0x0010ebf4 289 if ( heir == executing )<br>(gdb) <br>0x0010ebf6 289 if ( heir == executing )<br>(gdb) <br>290 goto post_switch;<br>(gdb) <br>323 cpu_self->thread_dispatch_disable_level = 0;<br>(gdb) <br>0x0010ec5c 323 cpu_self->thread_dispatch_disable_level = 0;<br>(gdb) <br>0x0010ec5e 323 cpu_self->thread_dispatch_disable_level = 0;<br>(gdb) <br>324 _Profiling_Thread_dispatch_enable( cpu_self, 0 );<br>(gdb) <br>0x0010ec62 324 _Profiling_Thread_dispatch_enable( cpu_self, 0 );<br>(gdb) <br>0x0010ec64 324 _Profiling_Thread_dispatch_enable( cpu_self, 0 );<br>(gdb) <br>326 _ISR_Local_enable( level );<br>(gdb) <br>0x0010ec6a 326 _ISR_Local_enable( level );<br>(gdb) <br>328 _Thread_Run_post_switch_actions( executing );<br>(gdb) <br>0x0010ec70 328 _Thread_Run_post_switch_actions( executing );<br>(gdb) <br><br></div><div>and now an infinite loop.</div><div><br></div><div>Before this, during the stack trace of rtems_yield by TA1, everything seemed normal and It gave control of the CPU to TA5 (Stack trace attached). What might be wrong?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 9, 2020 at 9:03 PM Richi Dubey <<a href="mailto:richidubey@gmail.com" target="_blank">richidubey@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Okay, I'm gonna do that. Thanks for the help.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 8, 2020 at 9:47 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Oct 8, 2020 at 9:38 AM Richi Dubey <<a href="mailto:richidubey@gmail.com" target="_blank">richidubey@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I have been trying to debug sp16 for the last few days. I am using the new Strong APA scheduler we worked on during this GSoC. The scheduler fails only for the following tests:<br>
><br>
> sp02.exe<br>
> sp16.exe<br>
> sp30.exe<br>
> sp31.exe<br>
> sp37.exe<br>
> sp42.exe<br>
> spfatal29.exe<br>
> tm24.exe<br>
><br>
> On executing sp16.exe, I get the following output:<br>
><br>
> *** BEGIN OF TEST SP 16 ***<br>
> *** TEST VERSION: 5.0.0.61ccb9c05dcd695114541960aa6bfc1315f30514-modified<br>
> *** TEST STATE: EXPECTED_PASS<br>
> *** TEST BUILD: RTEMS_NETWORKING RTEMS_POSIX_API RTEMS_SMP<br>
> *** TEST TOOLS: 7.5.0 20191114 (RTEMS 5, RSB 5 (0b7e87143b76), Newlib fbaa096)<br>
> TA1 - rtems_region_ident - rnid => 32010001<br>
> TA1 - rtems_region_get_segment - wait on 1000 byte segment from region 2<br>
> TA1 - got segment from region 2 - 0x00000040<br>
> TA1 - rtems_region_get_segment - wait on 3K segment from region 3<br>
> TA1 - got segment from region 3 - 0x00000080<br>
> TA1 - rtems_region_get_segment - get 3080 byte segment from region 1 - NO_WAIT<br>
> TA1 - got segment from region 1 - 0x00000040<br>
> TA1 - rtems_task_wake_after - yield processor<br>
> TA2 - rtems_region_get_segment - wait on 2K segment from region 1<br>
> TA1 - rtems_region_return_segment - return segment to region 1 - 0x00000040<br>
> TA1 - rtems_region_get_segment - wait 10 seconds for 3K segment from region 1<br>
> TA2 - got segment from region 1 - 0x00000040<br>
> TA2 - rtems_region_return_segment - return segment to region 1 - 0x00000040<br>
> TA2 - rtems_task_set_priority - make self highest priority task<br>
> TA2 - rtems_region_get_segment - wait on 3750 byte segment<br>
> TA1 - got segment from region 1 - 0x00000040<br>
> TA1 - rtems_region_return_segment - return segment to region 2 - 0x00000040<br>
> TA2 - got segment from region 2 - 0x00000040<br>
> TA2 - rtems_region_return_segment - return segment to region 2 - 0x00000040<br>
> TA2 - rtems_task_exit<br>
> TA1 - rtems_task_wake_after - yield processor<br>
> TA3 - rtems_region_get_segment - wait on 3750 byte segment from region 2<br>
> TA3 - got segment from region 2 - 0x00000040<br>
> TA3 - rtems_region_get_segment - wait on 2K segment from region 3<br>
> TA1 - rtems_task_delete - delete TA3<br>
> TA1 - rtems_task_wake_after - yield processor<br>
> TA4 - rtems_region_get_segment - wait on 1.5K segment from region 1<br>
> TA5 - rtems_region_get_segment - wait on 1.5K segment from region 1<br>
> TA1 - rtems_region_return_segment - return segment to region 1 - 0x00000040<br>
> TA1 - rtems_task_wake_after - yield processor<br>
> TA4 - got and returned 0x00000040<br>
> TA5 - got and returned 0x000006c0<br>
> TA1 - rtems_region_get_segment - wait 10 seconds for 3K segment from region 1<br>
> TA1 - got segment from region 1 - 0x00000040<br>
> TA1 - rtems_task_wake_after - yield processor<br>
> TA4 - rtems_region_get_segment - wait on 3K segment from region 1<br>
> TA5 - rtems_region_get_segment - wait on 3K segment from region 1<br>
> TA1 - rtems_task_delete - delete TA4<br>
> TA1 - rtems_region_return_segment - return segment to region 1 - 0x00000040<br>
> TA1 - rtems_task_wake_after - yield processor<br>
> TA5 - got segment from region 1 - 0x00000040<br>
> TA5 - rtems_region_return_segment - return segment to region 1 - 0x00000040<br>
> TA5 - rtems_task_exit<br>
><br>
> and it doesn't progress further from here. It gets stuck in some kind of loop. While debugging with gdb, I realized the loop is:<br>
><br>
> Clock_isr (arg=0x0) at /home/richi/quick-start/src/rtems/bsps/arm/include/../../shared/dev/clock/clockimpl.h:155<br>
> 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x001042fa 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x001042fc 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x001042fe 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
><br>
> 0x00104302 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104304 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104306 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x0010430a 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 154 while (<br>
> (gdb)<br>
> 0x0010430e 154 while (<br>
> (gdb)<br>
> 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104314 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104316 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104318 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x0010431c 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x0010431e 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104322 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104324 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
> 0x001042d2 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
> 0x001042d4 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
> 0x001042d8 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
> 0x001042dc 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
> 162 (*tc->tc_get_timecount)(tc),<br>
> (gdb)<br>
> 0x001042e2 162 (*tc->tc_get_timecount)(tc),<br>
> (gdb)<br>
> 160 _Timecounter_Tick_simple(<br>
> (gdb)<br>
> 0x001042e6 160 _Timecounter_Tick_simple(<br>
> (gdb)<br>
> 0x001042e8 160 _Timecounter_Tick_simple(<br>
> (gdb)<br>
> 0x001042ea 160 _Timecounter_Tick_simple(<br>
> (gdb)<br>
> 0x001042ee 160 _Timecounter_Tick_simple(<br>
> (gdb)<br>
> 0x001042f0 160 _Timecounter_Tick_simple(<br>
> (gdb)<br>
> 0x001042f2 160 _Timecounter_Tick_simple(<br>
> (gdb)<br>
><br>
> 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
><br>
> 0x001042fa 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x001042fc 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x001042fe 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
><br>
> 0x00104302 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104304 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104306 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x0010430a 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 154 while (<br>
> (gdb)<br>
> 0x0010430e 154 while (<br>
> (gdb)<br>
> 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104314 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104316 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104318 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x0010431c 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x0010431e 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104322 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 0x00104324 155 _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle<br>
> (gdb)<br>
> 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
> 0x001042d2 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
> 0x001042d4 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
> 0x001042d8 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
> 0x001042dc 159 _Timecounter_Acquire(&lock_context);<br>
> (gdb)<br>
><br>
> 162 (*tc->tc_get_timecount)(tc),<br>
> (gdb)<br>
> 0x001042e2 162 (*tc->tc_get_timecount)(tc),<br>
><br>
><br>
> and so on...<br>
><br>
> I cannot figure out what is wrong. Like Dr. Sherill suggested in a different .exe debug earlier, I set breakpoints and checked values of variables passed to the function and it all looks okay. I am quite sure this is because of the scheduler.<br>
><br>
> How do I progress further? Please let me know.<br>
><br>
<br>
The loop is spinning with an idle thread only, advancing the time<br>
counters still. The last message from TA1 is a yield. You need to dig<br>
into where TA1 got lost or why it doesn't get back the processor when<br>
TA5 exits.<br>
<br>
> Thanks,<br>
> Richi.<br>
><br>
><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>
</blockquote></div>