comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk>
Subject: Re: Large arrays (again), problem case for GNAT
Date: Thu, 14 Apr 2005 10:44:35 GMT
Date: 2005-04-14T10:44:35+00:00	[thread overview]
Message-ID: <pan.2005.04.14.10.46.05.356791@linuxchip.demon.co.uk.uk.uk> (raw)
In-Reply-To: pan.2005.04.13.12.46.52.518681@linuxchip.demon.co.uk.uk.uk

Hi!

Thank you very much for the feedback on this, particularly
those reporting success on particular configurations.

I should also comment:

I used 'malloc' rather then 'new' for two reasons:

1) Using 'new' fails, giving "raised STORAGE_ERROR : object too large"
   (in spite of having enough store to malloc and use)

2) My original program used 'mmap', but this is much more verbose
   to set up.  On Linux, large 'malloc' uses mmap anyway.

I calculate the size to allocate manually because attempting
to use the 'Size attribute fails (even when converted to a
suitably large type).

In fact the 'Size attribute fails on objects over 2147483647 bits :(
Sometimes this failure is silent (not trapped even with -gnato),
sometimes it gets a constaint error at compile time.

(The test supplied also fails with Size set to 67_108_865, which
is the smallest failing case.  This just exceeds the 2Gbit size limit.
In the 4-6Gbit region, the access to the 'last element is to the
wrong address, silently.  This is potentially serious!)

I have just tried the same code on GNAT/gcc 3.4.2 (Fedora Core 3, x86).
Everything works correctly, as far as I can tell!

My conclusions:

1) Update compilers more often!
   Don't expect (32-bit) 3.15p to work properly on large data

2) Convert 'size to a large type (eg 64-bit) before
   calculating bytes etc.

(and upgrade to x86-64 and 64-bit GNAT as soon as practicable)
(and pay for support if this kind of thing matters!)
-- 
Adrian Wrigley, Cambridge, UK.




  parent reply	other threads:[~2005-04-14 10:44 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-13 12:46 Large arrays (again), problem case for GNAT Dr. Adrian Wrigley
2005-04-13 13:10 ` Larry Kilgallen
2005-04-13 13:24   ` Alex R. Mosteo
2005-04-13 13:31   ` Marc A. Criley
2005-04-13 19:52 ` Jeffrey Carter
2005-04-13 19:54 ` Randy Brukardt
2005-04-13 22:01   ` (see below)
2005-04-14  0:16     ` Robert A Duff
2005-04-14  1:11       ` Alexander E. Kopilovich
2005-04-14  7:29         ` Dmitry A. Kazakov
2005-04-14  7:45           ` Duncan Sands
     [not found]           ` <1113464720.9829.20.camel@localhost.localdomain>
2005-04-14 13:59             ` Marius Amado Alves
2005-04-14 14:09               ` Dr. Adrian Wrigley
2005-04-14 14:40                 ` (see below)
     [not found]             ` <389d1596e98f95f0fdddc40afc0647b7@netcabo.pt>
2005-04-14 14:14               ` Duncan Sands
2005-04-14 15:18         ` Robert A Duff
2005-04-14 15:24           ` Robert A Duff
2005-04-15  5:21             ` Randy Brukardt
2005-04-15 11:49               ` Dr. Adrian Wrigley
2005-04-15 13:21                 ` Dmitry A. Kazakov
2005-04-15 14:31                   ` Dr. Adrian Wrigley
2005-04-15 14:57                     ` Dmitry A. Kazakov
2005-04-14 15:39           ` Dr. Adrian Wrigley
2005-04-14 15:48           ` Dmitry A. Kazakov
2005-04-14 21:19             ` Robert A Duff
2005-04-15  8:23               ` Dmitry A. Kazakov
2005-04-15  8:38                 ` Duncan Sands
2005-04-15  9:16                   ` Dmitry A. Kazakov
2005-04-15 18:30               ` Mark Lorenzen
2005-04-15 19:06                 ` Robert A Duff
     [not found]       ` <iSSDSN2L04G1@VB1162.spb.edu>
2005-04-14  7:34         ` Duncan Sands
2005-04-13 22:35 ` Robert A Duff
2005-04-14 11:40   ` Dr. Adrian Wrigley
2005-04-14 10:44 ` Dr. Adrian Wrigley [this message]
2005-04-14 15:03   ` Robert A Duff
2005-04-14 16:46     ` Dmitry A. Kazakov
2005-04-14 18:30       ` Pascal Obry
2005-04-14 19:45         ` Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2005-04-13 13:52 Duncan Sands
2005-04-13 14:20 ` Dr. Adrian Wrigley
replies disabled

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