comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: Possible GNAT bug, but wanted to see if it was a violtion of the RM
Date: Sat, 24 Feb 2018 14:07:35 -0800 (PST)
Date: 2018-02-24T14:07:35-08:00	[thread overview]
Message-ID: <c002424a-b079-4fb9-894f-cccdd8ad9c3e@googlegroups.com> (raw)
In-Reply-To: <lyvaeojcac.fsf@pushface.org>

On Friday, February 23, 2018 at 4:17:02 AM UTC-5, Simon Wright wrote:
> I don't know if it helps, but running under the debugger (GCC 8.0.1,
> macOS) show the first exception is
> 
> Catchpoint 1, PROGRAM_ERROR (Main.Composite.Vectors.Implementation.TC_Check: attempt to tamper with cursors) at __gnat_debug_raise_exception (
>     e=0x10003eaa0 <program_error>, message=...) at s-excdeb.adb:40
> 40	s-excdeb.adb: No such file or directory.
> (gdb) bt
> #0  __gnat_debug_raise_exception (e=0x10003eaa0 <program_error>, message=...)
>     at s-excdeb.adb:40
> #1  0x0000000100011cdd in ada__exceptions__complete_occurrence (x=0x1003020f0)
>     at a-except.adb:931
> #2  0x0000000100011ced in ada__exceptions__complete_and_propagate_occurrence (
>     x=0x1003020f0) at a-except.adb:942
> #3  0x0000000100011d42 in __gnat_raise_exception (
>     e=0x10003eaa0 <program_error>, message=...) at a-except.adb:984
> #4  0x0000000100006f27 in main.composite.vectors.implementation.tc_check ()
> #5  0x0000000100008e11 in main.composite.vectors.finalize ()
> #6  0x000000010000fe19 in main__composite__instanceDF.7589 ()
> #7  0x0000000100010250 in main___finalizer.4676 ()
> #8  0x0000000100006c20 in main ()

Thanks!  That confirms my initial suspicion of it being related to tamper 
checks, but I can't figure out how.  I looked through the GNAT code and 
saw how they locked it in the Constant_Reference function, but I can't 
for the life of me figure out how calling it using:

   Package.Operation(Object,Params).Discriminant

would work differently than

   Object.Operation(Params).Discriminant 

for that function call.  I would have assumed that both styles would 
produce the same code.  And even so, I wasn't able to figure out why
the busy lock for the tamper check wasn't released in the case that
generates the exception.

Is it safe to say I am not doing something illegal at least?  I'm
copying one anonymous access type into another (in order to propagate
the inner objects reference to the external object for iteration).
I feel like I remember someone saying you shouldn't be able to copy
anonymous access types, but perhaps in this case it is ok?

I'm gonna submit this to GNAT (I think) because I feel either way it is
a bug.  Either I am doing something legal that results in bad code or
I am doing something illegal and it isn't being caught by the compiler
or runtime at the right spot (I think).


  reply	other threads:[~2018-02-24 22:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23  2:36 Possible GNAT bug, but wanted to see if it was a violtion of the RM Jere
2018-02-23  9:16 ` Simon Wright
2018-02-24 22:07   ` Jere [this message]
2018-02-25 11:55     ` Simon Wright
2018-02-25 15:55       ` Jere
2018-02-24 22:10   ` Jere
2018-02-25 11:50     ` Simon Wright
2018-02-25 15:22       ` Jere
replies disabled

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