From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,88076dc693273166 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-09 18:20:42 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.mel.connect.com.au!news.xtra.co.nz!newsfeed01.tsnz.net!news02.tsnz.net!news.iconz.co.nz From: Craig Carey Newsgroups: comp.lang.ada Subject: Re: To raise an exception in task and handle/catch it in outer-block. Message-ID: <17nuvvo1e7mjeca1jstfeud11o1gbv81jv@4ax.com> References: <3gTJb.369$Mb5.7531@news2.e.nsc.no> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Original-NNTP-Posting-Host: ip-210-185-5-173.internet.co.nz X-Original-Trace: 10 Jan 2004 15:18:40 +1300, ip-210-185-5-173.internet.co.nz Organization: "ICONZ Ltd." Date: Sat, 10 Jan 2004 15:20:43 +1300 NNTP-Posting-Host: 210.48.22.5 X-Complaints-To: abuse@tsnz.net X-Trace: news02.tsnz.net 1073701241 210.48.22.5 (Sat, 10 Jan 2004 15:20:41 NZDT) NNTP-Posting-Date: Sat, 10 Jan 2004 15:20:41 NZDT Xref: archiver1.google.com comp.lang.ada:4289 Date: 2004-01-10T15:20:43+13:00 List-Id: On Sun, 4 Jan 2004 12:58:52 -0800, "Frank" 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