From: Craig Carey <research@ijs.co.nz>
Subject: Re: To raise an exception in task and handle/catch it in outer-block.
Date: Sat, 10 Jan 2004 15:20:43 +1300
Date: 2004-01-10T15:20:43+13:00 [thread overview]
Message-ID: <17nuvvo1e7mjeca1jstfeud11o1gbv81jv@4ax.com> (raw)
In-Reply-To: 3gTJb.369$Mb5.7531@news2.e.nsc.no
On Sun, 4 Jan 2004 12:58:52 -0800, "Frank" <franjoe@frisurf.no> wrote:
...
>This issue came up because a exception raised in a task like this is not
>propagated automatically by Ada to the outer block, but is resolved within
>each task.
...
> task body A_Task is
...
> exception
> when others =>
> begin
> accept Stop do -- ... as in example
>
> accept Final do -- repeated here for clarity
> Ada.Text_IO.Put_Line ("Test_Task_Exception.A_Task.Final...
> -- We wish to communicate exception to the outer-block
> raise test_exception; <<<=== Bad News here. Delete this !!
> end Final;
> end;
> end A_Task;
>end Test_Task_Exception;
Lockups in GNAT running in Linux were observed by me to occur in Linux
when an exception was raised in a task's outmost exception handler.
The debugger may be unhelpful so it may be best to check all code and
delete any that would allow a task to be exited by the raising of an
exception.
Deleting that "raise" statement still leaves the Put_Line line which
could also raise an exception.
The lockup problems maybe are absent in Windows. In Linux, a call to
C's exit() [GNAT's OS_Exit] can zombi-ize the program over delay
statements, and any sort of blocking (though I don't recall seeing
barriers of protected objects being implication in the construction of
zombies).
The above call to raise is a way to get a lockup without any blocking.
I never submitted a bug report.
Craig Carey
next prev parent reply other threads:[~2004-01-10 2:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-04 5:58 To raise an exception in task and handle/catch it in outer-block Frank
2004-01-03 22:03 ` tmoran
2004-01-04 20:58 ` Frank
2004-01-04 20:35 ` tmoran
2004-01-07 3:48 ` Frank
2004-01-10 2:20 ` Craig Carey [this message]
2004-01-10 6:24 ` Robert I. Eachus
2004-01-10 21:05 ` Frank
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox