comp.lang.ada
 help / color / mirror / Atom feed
  • * Re: Segmentation Fault
           [not found] <335358C5.43F8@reading.ac.uk>
           [not found] ` <33538A67.709A@reading.ac.uk>
    @ 1997-04-15  0:00 ` Robert Dewar
      1997-04-18  0:00   ` Keith Thompson
      1997-04-16  0:00 ` William Paul Berriss
      2 siblings, 1 reply; 12+ messages in thread
    From: Robert Dewar @ 1997-04-15  0:00 UTC (permalink / raw)
    
    
    
    <<This all works fine, compiles, runs etc.
    BUT, if I rewrite the program and ask for a 128 X 128 X 128 bin
    array, it compiles fine but when I come to run it it says ...>
    
    Sounds like a stack overflow to me, what makes you think it is anything else?
    
    
    
    
    
    ^ permalink raw reply	[flat|nested] 12+ messages in thread
  • * Re: Segmentation Fault
           [not found] <335358C5.43F8@reading.ac.uk>
           [not found] ` <33538A67.709A@reading.ac.uk>
      1997-04-15  0:00 ` Robert Dewar
    @ 1997-04-16  0:00 ` William Paul Berriss
      1997-04-16  0:00   ` Stack and Heap sizes William Paul Berriss
      2 siblings, 1 reply; 12+ messages in thread
    From: William Paul Berriss @ 1997-04-16  0:00 UTC (permalink / raw)
    
    
    
    Hi
    
    Here is the Ada code, v simple.
    
    --
    -- Filename :    test_memory_allocation.adb
    --
    -- Programmer :  Will Berriss
    --
    -- Machine : stssrita (SunOs 5.3,   a.k.a. Solaris 2.3 )
    --
    -- Compiler : GNAT 3.07 Ada 95 for Solaris 2.3/2.4/2.5
    --            (Installed 3 February 1997 by WPB)
    --
    -- Date :   15 April 1997
    --
    -- Edited :
    --
    
    with Ada.Command_Line, Ada.Sequential_IO, Ada.Text_IO,
    Ada.Integer_Text_IO;
    use Ada.Text_IO, Ada.Integer_Text_IO;
    --with EEG.Image_IO;
    
    with  EEG.Pixel_Types;             -- For a 512X512 Image type Image,
    and type Colour_Pixel
    use   EEG.Pixel_Types;             -- and types XCoordinate etc of
    Steve's
    
    procedure Test_Memory_Allocation is
    
    
       RedMax, GreenMax, BlueMax : Natural := 0;
    
    begin
    
        Put("Enter No of Red Coordinates  :  ");
        Get(RedMax);
        Put("Enter No of Green Coordinates  :  ");
        Get(GreenMax);
        Put("Enter No of Blue Coordinates  :  ");
        Get(BlueMax);
    
        New_Line;
        Put("Each bin is a Natural, 4 bytes .");
        New_Line;
    
        Put("Your Array is of Size : ");
        Put(Natural(RedMax * GreenMax * BlueMax * (Natural'Size / 8)));
        Put("  bytes.");
        New_Line;
    
        A:declare
    
    
          subtype RedRange is Natural range 0 .. RedMax -1;
          subtype GreenRange is Natural range 0 .. GreenMax -1;
          subtype BlueRange is Natural range 0 .. BlueMax -1;
    
    
        type Hist_Array is array( RedRange, GreenRange, BlueRange ) of
    Natural;
    
        H : Hist_Array := (others => (others => (others => 0)));
    
        begin  -- A
    
          H(1,1,1) := 1;
    
      end A;
    
    end Test_Memory_Allocation;
    
    
    Enteriung 85, 85, 85 is fine, but entering 128, 128, 128
    causes segmentation fault.
    
    Will
    -----
    -- 
    
    W P Berriss                 E-mail: W.P.Berriss@reading.ac.uk
    Department of Engineering
    The University of Reading
    Whiteknights
    Reading                     Tel:  0118 987 5123 
    Berkshire                     (+44 118 987 5123 outside UK)
    RG6 6AY    
    England                     Fax:  0118 931 3327    
    
    World Wide Web Home Page: 
    
    http://www.elec.rdg.ac.uk/people/postgrads/will.html
    
    
    
    
    ^ permalink raw reply	[flat|nested] 12+ messages in thread

  • end of thread, other threads:[~1997-04-20  0:00 UTC | newest]
    
    Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
    -- links below jump to the message on this page --
         [not found] <335358C5.43F8@reading.ac.uk>
         [not found] ` <33538A67.709A@reading.ac.uk>
    1997-04-15  0:00   ` Segmentation Fault Charlie Root
    1997-04-16  0:00   ` Nicolas HUYNH
         [not found]     ` <3355DB39.3BAF@reading.ac.uk>
    1997-04-19  0:00       ` I've Sussed my " Robert Dewar
    1997-04-15  0:00 ` Robert Dewar
    1997-04-18  0:00   ` Keith Thompson
    1997-04-20  0:00     ` Robert Dewar
    1997-04-16  0:00 ` William Paul Berriss
    1997-04-16  0:00   ` Stack and Heap sizes William Paul Berriss
    1997-04-16  0:00     ` Samuel Tardieu
    1997-04-16  0:00       ` Samuel Tardieu
    1997-04-18  0:00     ` Robert Dewar
    1997-04-20  0:00       ` Ada program's use of Stack and Heap William Paul Berriss
    

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