comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: Weird bug - Protected object - Gnat 3.15p win32
Date: Sun, 11 Jul 2004 19:26:29 GMT
Date: 2004-07-11T19:26:29+00:00	[thread overview]
Message-ID: <FvgIc.13623$oD3.7436@newsread1.news.pas.earthlink.net> (raw)
In-Reply-To: <5d6fdb61.0407110729.657570af@posting.google.com>

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




  parent reply	other threads:[~2004-07-11 19:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-11 15:29 Weird bug - Protected object - Gnat 3.15p win32 Jano
2004-07-11 15:56 ` Ludovic Brenta
2004-07-12  8:48   ` Jano
2004-07-11 19:26 ` Jeffrey Carter [this message]
2004-07-12  8:57   ` Jano
2004-07-12 16:07     ` Nick Roberts
2004-07-12 16:37       ` Jano
2004-07-12 17:00         ` Nick Roberts
2004-07-13  1:13         ` Jeffrey Carter
2004-07-13 12:03           ` Jano
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox