<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Likely dispatching was still disabled and you returned to the thread<br>
body without scheduling/dispatching to another thread. Your<br>
thread thought it was deleted but really continued past the<br>
pthread_exit() or rtems_task_delete() call. <br>
<br>
You must have a Classic API task which fell off the bottom of its<br>
body and returned. If the test is over, you need to exit().<br>
<br>
On 07/09/2012 07:32 AM, Ashi wrote:
<blockquote
cite="mid:CAJnfWeGfjjE9Q20OjzSsLuaz83C5joLUNXrwtBjt2fKhxTAcbQ@mail.gmail.com"
type="cite"><br>
<br>
<div class="gmail_quote">2012/7/9 Sebastian Huber <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:sebastian.huber@embedded-brains.de"
target="_blank">sebastian.huber@embedded-brains.de</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
On 07/09/2012 08:28 AM, Ashi wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
2012/7/6 Sebastian Huber <<a moz-do-not-send="true"
href="mailto:sebastian.huber@embedded-brains.de"
target="_blank">sebastian.huber@embedded-brains.de</a><br>
<mailto:<a moz-do-not-send="true"
href="mailto:sebastian.huber@embedded-brains.de"
target="_blank">sebastian.huber@embedded-brains.de</a>>>
<div class="im"><br>
<br>
On 07/06/2012 11:49 AM, Ashi wrote:<br>
<br>
I've a problem of _Thread_Disable_dispatch()
function in below code.<br>
It's my<br>
implementation of _POSIX_Keys_Run_destructors()
function. I come across the<br>
problem when I run the psxkey03 test:if
_Thread_Disable_dispatch() was<br>
commented out, psxkey03 can run without problem.
when<br>
_Thread_Disable_dispatch() added at line 1(as
below), psxkey03 will fail. I<br>
debug it in sparc-rtems4.11-gdb, and find psxkey03
runs into<br>
_Internal_error_Occurred() function then stop. I
know<br>
_POSIX_Keys_Get()(at line<br>
12) will also disable thread dispatch--does this
lead to the problem?<br>
However,<br>
can't figure out where exactly the problem exists,
could anyone explain<br>
it? Thanks!<br>
<br>
<br>
The _Thread_Disable_dispatch() can nest. I suppose
you want to acquire a<br>
resource in the destructor which is not free. The
path to<br>
_Internal_error_Occurred() should show the problem.<br>
<br>
Sebastian, I follow the calls in gdb, and find the error
is:<br>
Program received signal SIGINT, Interrupt.<br>
0x020168b8 in _Internal_error_Occurred
(the_source=INTERNAL_ERROR_CORE,<br>
is_internal=true, the_error=5)<br>
at ../../../../../../rtems/c/src/../../cpukit/score/src/interr.c:58<br>
58 _CPU_Fatal_halt( the_error );<br>
</div>
</blockquote>
<br>
What is the call stack here?<br>
<br>
</blockquote>
<div>Hi, Sebastian, the call stack is:<br>
<br>
<span class="st"> <em></em></span> #0 0x020168bc in
_Internal_error_Occurred (the_source=INTERNAL_ERROR_CORE,
is_internal=true, the_error=5) at
../../../../../../rtems/c/src/../../cpukit/score/src/interr.c:58<br>
#1 0x0202ae58 in _Thread_Handler () at
../../../../../../rtems/c/src/../../cpukit/score/src/threadhandler.c:197<br>
#2 0x0202acb0 in _Thread_Handler () at
../../../../../../rtems/c/src/../../cpukit/score/src/threadhandler.c:89<br>
<br>
and the info local shows:<br>
level = 4198629<br>
<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The error=5 is probably INTERNAL_ERROR_THREAD_EXITTED (see
also Internal_errors_Core_list). How did you terminate the
task?
<div class="HOEnZb">
<div class="h5"><br>
</div>
</div>
</blockquote>
<div>the task is terminated by Ctrl+C in sparc-rtems-gdb. <br>
However, as I said in my last post, the problem is gone when I
add _Thread_Enable_dispatch() at the end of each while
iteration...is it proper?<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 class="HOEnZb">
<div class="h5">
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany<br>
Phone : <a moz-do-not-send="true"
href="tel:%2B49%2089%2018%2090%2080%2079-6"
value="+4989189080796" target="_blank">+49 89 18 90 80
79-6</a><br>
Fax : <a moz-do-not-send="true"
href="tel:%2B49%2089%2018%2090%2080%2079-9"
value="+4989189080799" target="_blank">+49 89 18 90 80
79-9</a><br>
E-Mail : <a moz-do-not-send="true"
href="mailto:sebastian.huber@embedded-brains.de"
target="_blank">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>
_______________________________________________<br>
rtems-devel mailing list<br>
<a moz-do-not-send="true"
href="mailto:rtems-devel@rtems.org" target="_blank">rtems-devel@rtems.org</a><br>
<a moz-do-not-send="true"
href="http://www.rtems.org/mailman/listinfo/rtems-devel"
target="_blank">http://www.rtems.org/mailman/listinfo/rtems-devel</a><br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Best wishes!<br>
Zhongwei Yao<br>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research& Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
</pre>
</body>
</html>