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-Thread: 103376,fc4ac82d0abec4ff X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Weird bug - Protected object - Gnat 3.15p win32 References: <5d6fdb61.0407110729.657570af@posting.google.com> In-Reply-To: <5d6fdb61.0407110729.657570af@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sun, 11 Jul 2004 19:26:29 GMT NNTP-Posting-Host: 63.184.104.129 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1089573989 63.184.104.129 (Sun, 11 Jul 2004 12:26:29 PDT) NNTP-Posting-Date: Sun, 11 Jul 2004 12:26:29 PDT Xref: g2news1.google.com comp.lang.ada:2147 Date: 2004-07-11T19:26:29+00:00 List-Id: Jano wrote: > The thing is that I have a protected type with a lot > of functions and quite some encapsulated data. Sud- > denly it has started to cause deadlocks. After any call > to a function (not procedure!) in the protected type, the > lock of the monitor is not released for some reason, > because any subsequent call to the object will lock and > not enter it. The function can have null body, no other > tasks are using the protected object. If a function has a null body, it will raise Program_Error. Is it possible that what you are seeing is the result of this exception, and tasks perhaps dying silently as a result? > protected type Blah is > -- procedures and functions > private > > Some_Array : Array_Type (1 .. 1); > -- Will work ok > Some_Array : Array_Type (1 .. Global_Variable); > -- Will deadlock > > end Blah; > > Note that Global_Variable also equals to 1! If Global_Variable changes after this type declaration is elaborated, using Global_Variable to index Some_Array will raise Constraint_Error, with similar effects to raising Program_Error. > I've tried to get a small reproducer using new code, but > failed, so there must be some other dependences for it > to arise. Using the code from the project where I've detected > it, it happens for every instance of the protected type. Without complete code that compiles and produces the problem, it's difficult to tell if this is a problem with GNAT or your code. The fact that you're having difficulty reproducing the problem means the latter is more likely. -- Jeff Carter "Ditto, you provincial putz?" Blazing Saddles 86