Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ada > #49598

Re: Help: Ada in NetBSD

From Fernando Oleo Blanco <irvise_ml@irvise.xyz>
Newsgroups comp.lang.ada
Subject Re: Help: Ada in NetBSD
Date 2021-09-22 22:05 +0200
Organization Aioe.org NNTP Server
Message-ID <sig2b7$i95$1@gioia.aioe.org> (permalink)
References <sgfpod$19sl$1@gioia.aioe.org> <646f270d-0e65-46a5-b40a-02afab608f1en@googlegroups.com> <sgo4f7$lri$1@gioia.aioe.org> <si2jm1$1i9p$1@gioia.aioe.org> <si54o5$h7b$1@gioia.aioe.org>

Show all headers | View raw


Another followup. This may require a new thread, but we will see.

So, very long story short. The assertion failure that I was getting, 
s-taprop.adb:659 was because "pthread_setschedparam" was returning a 
failure.

After digging up a bit, I noticed that the SCHED_{OTHER,RR,FIFO} 
constants in s-osint__netbsd (taken from J. Marino) were wrong.

I corrected the values and expected GNAT to finally work. It did not.

The error being returned now by "pthread_setschedparam" was, however, 
different. The error was that the input values were invalid. I checked 
the input values, all seemed correct. I decided to take a look at the 
validity of the "Priority" variable, as I did not know anything about 
it. Which values could it take?

Unsurprisingly, the priority for the task may take different values 
depending on the scheduler (SCHED_{OTHER,RR,FIFO}) and the OS. The link 
I found that showed/explained this is 
https://stackoverflow.com/questions/10657970/pthread-sched-get-priority-min-max-implementation-for-sched-other-sched-fifo

So I ran the code in the link to see if the Priority value was valid in 
NetBSD and... Oh... Min: -1 and Max: -1... Reading the POSIX manual it 
says that -1 is an error... Was I getting an error code?

I went into #netbsd, asked aaaaandd... No, it is no error, those are the 
actual values that NetBSD uses as valid ones... So NetBSD is _not_ POSIX 
compilant in this case... More quirks to take into account... However, 
this thing is going to get discussed with NetBSD people.

But this is not where it ends...

The priority number I was getting is the default in libgnat/system.ads:
gcc/ada/libgnat/system.ads:   Default_Priority : constant Priority := 15;

Some OSs/architectures have different defaults, but 15 seems to be the 
most common one. However, this causes another question. If the valid 
range is 0..0 (as in Ubuntu), how does GNAT know which priority value to 
use? I have more or less followed the flow from where the value of 
Priority gets set and I have not found anything that caught my eye. So I 
would expect that in Ubuntu (for example) a Priority of 15 would create 
an error... But it does not (GNAT works fine there). Strange... This 
will require further research...

BUT that is not all. In GDB I manually changed the value of Priority to 
-1 to see if it would work... And it did! But then when I told it to 
continue, it error out in another place, s-tpopmo.adb:213. That is no 
new error, in previous ACATS runs I was getting it in some places. And 
it seems related to the "adafinal" procedure, which is run when a 
program is done. Some tests were failing in adafinal while being 
debugged in gdb, and if I remember correctly, they were also failing in 
s-tpopmo.adb...

This little project of mine is going deeper and deeper each week... Arg...

Cheers,
-- 
Fernando Oleo Blanco
https://irvise.xyz

Back to comp.lang.ada | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-29 13:06 +0200
  Re: Help: Ada in NetBSD Stephane Carrez <stephane.carrez@gmail.com> - 2021-08-29 06:19 -0700
    Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-29 20:08 +0200
      Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-08-29 19:25 +0100
        Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-29 22:36 +0200
          Re: Help: Ada in NetBSD Stephane Carrez <stephane.carrez@gmail.com> - 2021-08-29 15:08 -0700
            Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-08-30 08:37 +0100
            Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-30 10:14 +0200
              Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-30 12:24 +0200
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-30 14:15 +0200
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-30 20:49 +0200
                Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-08-30 20:23 +0100
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-01 11:44 +0200
                Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-09-01 22:41 +0100
                Re: Help: Ada in NetBSD "Randy Brukardt" <randy@rrsoftware.com> - 2021-09-02 17:16 -0500
                Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-09-03 21:18 +0100
  Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-08-29 18:34 +0100
    Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-08-29 19:45 +0200
  Re: Help: Ada in NetBSD "John R. Marino" <mfl-commissioner@marino.st> - 2021-09-01 06:28 -0700
    Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-01 16:58 +0200
      Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-17 19:36 +0200
        Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-18 18:39 +0200
          Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-22 22:05 +0200
            Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-09-22 21:57 +0100
            Re: Help: Ada in NetBSD "Luke A. Guest" <laguest@archeia.com> - 2021-09-23 09:04 +0100
              Re: Help: Ada in NetBSD Kevin Chadwick <m8il1ists@gmail.com> - 2021-09-23 03:48 -0700
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-23 19:01 +0200
              Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-23 19:04 +0200
            Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-23 21:53 +0200
              Re: Help: Ada in NetBSD Simon Wright <simon@pushface.org> - 2021-09-24 08:48 +0100
                Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-24 11:44 +0200
    Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-13 20:49 +0200
      Re: Help: Ada in NetBSD Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2021-09-13 18:24 -0400
        Re: Help: Ada in NetBSD Fernando Oleo Blanco <irvise_ml@irvise.xyz> - 2021-09-17 19:19 +0200

csiph-web