comp.lang.ada
 help / color / mirror / Atom feed
* OA bug ?
@ 1999-06-21  0:00 Vladimir Olensky
  1999-06-21  0:00 ` Tucker Taft
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Olensky @ 1999-06-21  0:00 UTC (permalink / raw)



Here is small piece of code to illustrate the  problem :

=================================
with Ada.Finalization;

package T_Ctld is
 type T is  new  Ada.Finalization.Controlled  with private;
  type T_A is  access all T;
  type T_CA is  access all T'Class;

private
  type T is new Ada.Finalization.Controlled  with null  record;

end T_Ctld;

------------------------
with T_Ctld;  Use T_Ctld;
procedure Tst_Ctld_bug is

   Ptr1: T_CA;
begin
   null;

end Tst_Ctld_bug;

----------------------------
OA compiles everything with no problem.
At a link time it gives an error:
  t_ctld.obj : error LNK2005: t_ctld.t__acc_cleanup already defined in
t_ctld.obj  tst_ctld_bug.exe : fatal error LNK1169: one or more multiply
defined symbols found
-------------------------

Examination of T_Ctld assembler listing gives the following:

                     ;Listing of uninitialized data section   ;
                     ;                                        ;
 000000              t_ctld.t__acc_cleanup DB 32 DUP(?)       ;
 000020              t_ctld.t__acc_cleanup DB 32 DUP(?)       ;

and this explains the above problem
-----
 000000  corresponds to T_CA;
 000020  corresponds to T_A;

==============================

Changing T_ctld fixes the problem:

with Ada.Finalization;

package T_Ctld is
 type T is  new  Ada.Finalization.Controlled  with null record;
  type T_A is  access all T;
  type T_CA is  access all T'Class;

end T_Ctld;
-----------------------------
the same  piece of assembler listing:

                      ;Listing of uninitialized data section   ;
                      ;                                        ;
 000000               t_ctld.t_ca__acc_cleanup DB 32 DUP(?)    ;
 000020               t_ctld.t_a__acc_cleanup DB 32 DUP(?)     ;

Here everything is OK and as a result there are no problems
building Tst_Ctld_bug.
=========================================


So it looks as OA special edition has some problems with
 internal data representation for controlled types
 with private part.

With GNAT everything is OK.


Any comments ?

Regards.

Vladimir Olensky







^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: OA bug ?
  1999-06-21  0:00 OA bug ? Vladimir Olensky
@ 1999-06-21  0:00 ` Tucker Taft
  1999-06-22  0:00   ` Another OA bug ? (was Re: OA bug ?) czgrr
  0 siblings, 1 reply; 4+ messages in thread
From: Tucker Taft @ 1999-06-21  0:00 UTC (permalink / raw)


Vladimir Olensky wrote:
> ... OA compiles everything with no problem.
> At a link time it gives an error:
>   t_ctld.obj : error LNK2005: t_ctld.t__acc_cleanup already defined in
> t_ctld.obj  tst_ctld_bug.exe : fatal error LNK1169: one or more multiply
> defined symbols found
> -------------------------
> 
> Examination of T_Ctld assembler listing gives the following:
> 
>                      ;Listing of uninitialized data section   ;
>                      ;                                        ;
>  000000              t_ctld.t__acc_cleanup DB 32 DUP(?)       ;
>  000020              t_ctld.t__acc_cleanup DB 32 DUP(?)       ;
> 
> and this explains the above problem
> -----
>  000000  corresponds to T_CA;
>  000020  corresponds to T_A;

This bug was reported on 4/23/97, assigned PTR 2043, and fixed on 5/12/97. 
The fix was released to our licensees on 5/26/97.  I'm not sure
when it made it into the OA release, but apparently after
the "special edition" that you have was released.  You might
inquire whether there is a newer "special edition" available.

The problem related to declaring both an access-to-T and an
access-to-T'Class prior to the full definition for a controlled type T.

-Tucker Taft  stt@averstar.com

> ==============================
> 
> Changing T_ctld fixes the problem:
> 
> with Ada.Finalization;
> 
> package T_Ctld is
>  type T is  new  Ada.Finalization.Controlled  with null record;
>   type T_A is  access all T;
>   type T_CA is  access all T'Class;
> 
> end T_Ctld;
> -----------------------------
> the same  piece of assembler listing:
> 
>                       ;Listing of uninitialized data section   ;
>                       ;                                        ;
>  000000               t_ctld.t_ca__acc_cleanup DB 32 DUP(?)    ;
>  000020               t_ctld.t_a__acc_cleanup DB 32 DUP(?)     ;
> 
> Here everything is OK and as a result there are no problems
> building Tst_Ctld_bug.
> =========================================
> 
> So it looks as OA special edition has some problems with
>  internal data representation for controlled types
>  with private part.

As noted above, the problem related to declaring multiple access
types prior to the full definition of the designated, controlled type.

> With GNAT everything is OK.
> 
> Any comments ?
> 
> Regards.
> 
> Vladimir Olensky

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Another OA bug ? (was Re: OA bug ?)
  1999-06-21  0:00 ` Tucker Taft
@ 1999-06-22  0:00   ` czgrr
  1999-06-23  0:00     ` Tucker Taft
  0 siblings, 1 reply; 4+ messages in thread
From: czgrr @ 1999-06-22  0:00 UTC (permalink / raw)


Hi, all.

Is there also a fix going for this bug. I did email
adasupport@aonix.com but never got a reply...

--
-- SOURCE CODE.
-- OPTION 1: Uncomment only line 1 of main procedure.
-- OPTION 2: Uncomment only line 2 of main procedure.
--
PROCEDURE main IS

  TYPE a_type IS DIGITS 15 ;
  TYPE b_type IS DIGITS 15 ;

  a : a_type ;
  b : b_type := 1.0 ;

  FUNCTION "*" ( l : IN a_type ; r : IN b_type ) RETURN b_type IS
  BEGIN
    RETURN 0.0 ;
  END ;

  FUNCTION "/" ( l, r : IN b_type ) RETURN a_type IS
  BEGIN
    RETURN 0.0 ;
  END ;

BEGIN
  -- a := 1.0 * b / 1.0 ;
  -- a := 1.0 * b_type'( 1.0 ) / 1.0 ;

END main ;


--
-- COMPILER VERSION.
--
-- ObjectAda for Windows
-- V7.1.1.352 (professional edition)
--
-- Achieved by installing CD labelled "PRO71" (Version 7.1)
-- Followed by CD labelled "OAOPE71" (OpenPack),
-- Followed by CD labelled "OA711" (Version 7.1.1 Update, Ref:
A1102.7.1.1).


--
-- COMPILER OUTPUT.
--

-- OPTION 1:
--------------------Target: Win32 (Intel) Debug--------------------
-- Assertion failed: subtype_is_scalar(scalar_subtype) ||
(subtype_is_private(scalar_subtype) && (subtype_ili_slot(scalar_subtype)
>0)), file \\efreeti\d-drive\adamagic\src\ccomp\subtype.c, line 8599
--
-- abnormal program termination
-- main.ada: Internal: line 25 col 22 Fatal internal assertion failure.
--
-- Tool execution failed.

-- OPTION 2:
--------------------Target: Win32 (Intel) Debug--------------------
-- Assertion failed: value!=NULL_UR_PTR, file \\efreeti\d-
drive\adamagic\src\ccomp\tree_build.c, line 2733
--
-- abnormal program termination
-- main.ada: Internal: line 26 col 35 Fatal internal assertion failure.
--
-- Tool execution failed.

Cheers,
czgrr

--
No email, please - reply to the newsgroup.
My opinions are not necessarily those of my
employer.
Use any suggestions at your own risk.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Another OA bug ? (was Re: OA bug ?)
  1999-06-22  0:00   ` Another OA bug ? (was Re: OA bug ?) czgrr
@ 1999-06-23  0:00     ` Tucker Taft
  0 siblings, 0 replies; 4+ messages in thread
From: Tucker Taft @ 1999-06-23  0:00 UTC (permalink / raw)


czgrr wrote:
> 
> Hi, all.
> 
> Is there also a fix going for this bug. I did email
> adasupport@aonix.com but never got a reply...

The example code is ambiguous.  The bug is in the error
reporting of ambiguity when you have user-defined operators.
There is not a fix yet (but there is now a PTR assigned ;-).

> --
> -- SOURCE CODE.
> -- OPTION 1: Uncomment only line 1 of main procedure.
> -- OPTION 2: Uncomment only line 2 of main procedure.
> --
> PROCEDURE main IS
> 
>   TYPE a_type IS DIGITS 15 ;
>   TYPE b_type IS DIGITS 15 ;
> 
>   a : a_type ;
>   b : b_type := 1.0 ;
> 
>   FUNCTION "*" ( l : IN a_type ; r : IN b_type ) RETURN b_type IS
>   BEGIN
>     RETURN 0.0 ;
>   END ;
> 
>   FUNCTION "/" ( l, r : IN b_type ) RETURN a_type IS
>   BEGIN
>     RETURN 0.0 ;
>   END ;
> 
> BEGIN
>   -- a := 1.0 * b / 1.0 ;
>   -- a := 1.0 * b_type'( 1.0 ) / 1.0 ;

Both of these are ambiguous, because the "*" can be either
the predefined "b_type * b_type => b_type" or the user-defined
"a_type * b_type => b_type".  If you disambiguate the type of
the first "1.0" via "a_type'(1.0)" or "b_type'(1.0)" it will 
compile successfully.

> 
> END main ;
> 
> --
> -- COMPILER VERSION.
> --
> -- ObjectAda for Windows
> -- V7.1.1.352 (professional edition)
> --
> -- Achieved by installing CD labelled "PRO71" (Version 7.1)
> -- Followed by CD labelled "OAOPE71" (OpenPack),
> -- Followed by CD labelled "OA711" (Version 7.1.1 Update, Ref:
> A1102.7.1.1).
> 
> --
> -- COMPILER OUTPUT.
> --
> 
> -- OPTION 1:
> --------------------Target: Win32 (Intel) Debug--------------------
> -- Assertion failed: subtype_is_scalar(scalar_subtype) ||
> (subtype_is_private(scalar_subtype) && (subtype_ili_slot(scalar_subtype)
> >0)), file \\efreeti\d-drive\adamagic\src\ccomp\subtype.c, line 8599
> --
> -- abnormal program termination
> -- main.ada: Internal: line 25 col 22 Fatal internal assertion failure.
> --
> -- Tool execution failed.
> 
> -- OPTION 2:
> --------------------Target: Win32 (Intel) Debug--------------------
> -- Assertion failed: value!=NULL_UR_PTR, file \\efreeti\d-
> drive\adamagic\src\ccomp\tree_build.c, line 2733
> --
> -- abnormal program termination
> -- main.ada: Internal: line 26 col 35 Fatal internal assertion failure.
> --
> -- Tool execution failed.
> 
> Cheers,
> czgrr

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-06-23  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-21  0:00 OA bug ? Vladimir Olensky
1999-06-21  0:00 ` Tucker Taft
1999-06-22  0:00   ` Another OA bug ? (was Re: OA bug ?) czgrr
1999-06-23  0:00     ` Tucker Taft

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