Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6148391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:16:21+00:00 2026-05-23T19:16:21+00:00

I have this small function that is causing me headaches on RHEL6, and I

  • 0

I have this small function that is causing me headaches on RHEL6, and I am not sure what is going on… and it is a pain to debug. When I run this I am getting a STORAGE_ERROR, so I did a gstack to see where the program is hanging (See below). It looks like an issue with memcmp although I’m not sure where/how it is being called.. Any ideas for a workaround?

When I change this function to just return ‘true’ it seems to work fine (STORAGE_ERROR goes away), so I figure that the problem is with some logic in this part: (Ada.Characters.Handling.To_Upper(EPS_List(1).all) = “LOCALHOST”);

  function Localhost_Only return Boolean is
  --++
     EPS_List : String_List_Type 
              := Values(Bstring.To_Bounded_String("EPS"));
  begin
    return (Ada.Characters.Handling.To_Upper(EPS_List(1).all) = "LOCALHOST");

  end Localhost_Only;

BEGIN EDIT***

Another way that workst was doing this (Moving it out of function scope… Why does this work?):

   EPS_List : String_List_Type 
              := Values(Bstring.To_Bounded_String("EPS"));

  function Localhost_Only return Boolean is
  --++

  begin
    return (Ada.Characters.Handling.To_Upper(EPS_List(1).all) = "LOCALHOST");

  end Localhost_Only;

END EDIT***

gstack output on the process:

Thread 1 (Thread 0x407059a0 (LWP 13610)):
#0  0x40000424 in __kernel_vsyscall ()
#1  0x00b2b2fc in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0x0b53dd9e in system__tasking__stages__vulnerable_complete_master ()
#3  0x0b53e242 in system__tasking__stages__finalize_global_tasks ()
#4  0x0b5845d3 in __gnat_last_chance_handler ()
#5  0x0b545c50 in ada__exceptions__exception_traces__unhandled_exception_terminateXn ()
#6  0x0b5459de in ada__exceptions__exception_propagation__propagate_exceptionXn ()
#7  0x0b5465c5 in __gnat_raise_nodefer_with_msg ()
#8  0x0b5469ed in ada__exceptions__raise_with_location_and_msg ()
#9  0x0b5469b8 in __gnat_raise_storage_error_msg ()
#10 0x0b546f98 in __gnat_rcheck_31 ()
#11 0x0b5363de in system__interrupt_management__notify_exception ()
#12 <signal handler called>
#13 0x0bcef590 in memcmp@@GLIBC_2.0 ()
#14 0x084a83c9 in common_network_configuration__localhost_only ()

Relevant types/function:

type Number_Of_Items_Type is range 0 .. 250;

subtype Index_Type is Number_Of_Items_Type 
     range Number_Of_Items_Type'First + 1 .. Number_Of_Items_Type'Last;

type String_List_Type is array (Index_Type range <>) 
     of String_Access.String_P_Type;

package Bstring is new Ada.Strings.Bounded.Generic_Bounded_Length 
                            (Max => Line_Length_Type'last);

   function Values(Name : Bstring.Bounded_String) return String_List_Type is
   --++
   -- ABSTRACT
   --   Return a list of pointers to strings. The strings are all the values
   --   associated with the specified name. All values are recursively 
   --   evaluated so that each entry in the returned list is a primitive
   --   name (i.e. integer, ip_address, or unix_workstation).
   --
   --   If a circular definition is detected, an empty list is returned. 
   --
   -- LOCAL DATA
     -- Number of items in list
     Count    : Number_Of_Items_Type := 0;

     -- List of pointers to strings containing the primitive values
     Out_List : String_List_Type (1 .. Index_Type'Last);

     -- The Index of the item being evaluated
     Item     : Config_Index_Type := 0;

     -- A safety net, to detect and prevent unlimited recursion, such as 
     -- will happen in the case of a circular definition.
     Depth    : Number_Of_Items_Type := 0;

     procedure Find_Values (Name : in Bstring.Bounded_String) is
     --++ 
     -- ABSTRACT
     --   This procedure recursively calls itself until it makes it all 
     --   The way through the Config_Array without finding a match on the
     --   specified Name. The index of the last name for which a match was
     --   found is used to get the value associated with that Name. This 
     --   is a primitive value associated with the name and is added to the
     --   Out_List. 
     --
     --   Depth is used to count the recursion depth, when it reaches a 
     --   maximum, no more recursive calls are made, preventing an endless
     --   loop in the case of a direct or indirect circular definition.
     begin 
       Depth := Depth + 1;
       for Index in 1 .. Config_Count loop
         if  Name_Match(Bstring.To_String(Name),Index) 
         and Count < Number_Of_Items_Type'last 
         and Depth < Number_Of_Items_Type'last then
           Item := Index;
           Find_Values (Config_Array(Index).Value);
         end if;
       end loop;
       if Item /= 0 then
         if Count < Number_Of_Items_Type'last then
           Count := Count + 1;
           Out_List(Count) := Config_Array(Item).Val_Ptr;
         end if;
         Item := 0;
       end if;
     end Find_Values;

   begin -- Values
     Find_Values(Name);
     if Depth < Number_Of_Items_Type'last then
       return Out_List(1..Count);
     else 
       return Null_String_List;
     end if;
   end Values;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:16:22+00:00Added an answer on May 23, 2026 at 7:16 pm

    The solution was to upgrade the compiler on RHEL6..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's a small thing, really: I have this function that converts dict objects to
I have this small script that sorts the content of a text file #
I have this function that puts some data with Ajax call in a php
I have this small script that shows a caption for a img when it
ok, so I have this small block of text: function onfocus(event) { if ($(this).val()
I have a small python VTK function that calculates the volume and surface area
I have a small function that will take a string of css (eg background:
I have tried to build a small function that would be use in controller
For example, I have a small function that I want it to keep adding
I have a small function which I want to rewrite, so that function is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.