comp.lang.ada
 help / color / mirror / Atom feed
From: 402450@cepsz.unizar.es (Jano)
Subject: Weird bug - Protected object - Gnat 3.15p win32
Date: 11 Jul 2004 08:29:42 -0700
Date: 2004-07-11T08:29:42-07:00	[thread overview]
Message-ID: <5d6fdb61.0407110729.657570af@posting.google.com> (raw)

Hi Ada men,

I think I've stumbled across another mortifying bug 
in gnat 3.15p win32, another one which has taken a lot 
of time to track down. Please share any knowledge you 
have about it:

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.

After tinkering around, I've detected that changing the
following private member declaration makes the deadlock
to go away:

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!

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.

Someone has noticed something like this?

Having been bitten hard at least twice by gnat bugs in 
3.15p win, I'm thinking of making a bugs page for other 
people to be warned ahead. I'm already aware of the 
following:

* The broken time packages.
* The broken Select in Gnat.Sockets.

If you're aware of such kind of bugs which are hard to 
detect and track down, please write about them so I can
collect them for reference. I think it can spare useful
time to newcomers.

Thanks!



             reply	other threads:[~2004-07-11 15:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-11 15:29 Jano [this message]
2004-07-11 15:56 ` Weird bug - Protected object - Gnat 3.15p win32 Ludovic Brenta
2004-07-12  8:48   ` Jano
2004-07-11 19:26 ` Jeffrey Carter
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