comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: ZLIB_ERROR with AWS
Date: Sat, 20 Oct 2012 11:04:31 +0200
Date: 2012-10-20T11:04:31+02:00	[thread overview]
Message-ID: <ioj6vmgui47m$.43as04veo40i$.dlg@40tude.net> (raw)
In-Reply-To: slrnk84oah.pm3.oka.sux@localhost.localdomain

On Sat, 20 Oct 2012 08:32:02 +0000 (UTC), Okasu wrote:

> On 2012-10-20, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>> No, it looks like a typical problem of the clean up involving controlled
>> types. That is when an exception is propagated amidst of some process
>> involving controlled objects in possibly not a coherent state. So that when
>> the propagation starts kicking them out of existence a call Finalize may
>> fail. That turns the original exception into Program_Error. This stuff is
>> barely testable, because one cannot foresee and emulate all possible
>> exceptions at all possible places. I bet that almost any Ada program has
>> issues of this kind. So, it is a bug, but not the original problem.
> 
> What bug are you talking about? Issue with zlib or finalize/adjust with HTTPS
> issue? 

Yes, that should never happen.

> Can you suggest workaround (without involving another
> language)?

It is likely not the original problem, it is an induced one:

A) There was an exception #1 which started winding the stack up (the
original issue)

B) Upon that in a Finalize of a controlled object happened an exception #2
(which is a secondary bug). Quite frequently this happens very lately when
the compiler kills strayed controlled objects at the library level. In that
case there is would be no stack trace at all.

C) #2 was not handled in Finalize, so the compiler converted it to the
exception #3, Program_Error, obscuring the things completely.

As for workarounds that depends on whether #1 was legitimate and how you
could prevent it from happening. Your first step could be to track #1 down.

If you want that and have access to the sources, you could modify the code
of the offending Finalize (where #2 propagates from) by adding at its
beginning something like:

   procedure Finalize (...) is
   begin
      Ada.Text_IO.Put_Line
      (  "#1 was:"
      &  Ada.Exceptions.Exception_Information
         (  GNAT.Most_Recent_Exception.Occurrence
      )  );
      ...

at the end of the Finalize you add:

      ...
   exception
      when Error : others =>
         Ada.Text_IO.Put_Line
         (  "#2 was:"
         & Ada.Exceptions.Exception_Information (Error)
         );
         raise;
   end Finalize;

Now in the output there should be lines "#1 was:" followed by "#2 was:",
which could give a hint what is going on.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-10-28  2:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-20  0:35 ZLIB_ERROR with AWS Okasu
2012-10-20  7:23 ` Okasu
2012-10-20  7:47   ` Dmitry A. Kazakov
2012-10-20  8:32     ` Okasu
2012-10-20  9:04       ` Dmitry A. Kazakov [this message]
2012-10-20 20:46         ` Okasu
2012-10-20 20:58           ` Pascal Obry
2012-10-20 21:15             ` Okasu
2012-10-20 21:25               ` Pascal Obry
2012-10-20 21:30                 ` Okasu
2012-10-20 22:26                   ` Okasu
2012-10-21  7:29                     ` Pascal Obry
2012-10-21 10:22                     ` Marius Amado-Alves
2012-10-21 20:44                       ` Okasu
2012-10-22  5:38                         ` Pascal Obry
2012-10-22  8:08                           ` Okasu
2012-10-22 15:39                             ` Pascal Obry
2012-10-21  6:17           ` darkestkhan
replies disabled

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