comp.lang.ada
 help / color / mirror / Atom feed
* Ada multi-threaded programs do not terminate under RedHat Linux
@ 2003-11-07 20:28 Ruben Stranders
  2003-11-07 21:45 ` Robert Spooner
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Ruben Stranders @ 2003-11-07 20:28 UTC (permalink / raw)


I'm a Ada newbie and I have to make a very simple program to
demonstrate the use of multithreading in Ada. For that purpose, I
created the following program.

============================
procedure test is
        task type counter;

        task body counter is
        i : integer :=0;
        begin
                put_line("Start");
                while i < 10000 loop
                        i := i + 1;
                end loop;
                put_line("Finish");
        end;

        task1 : counter;

begin
        put_line("Test");
end;
============================

I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb".
Unfortunately, the resulting program doesn't terminate. Instead of the
expected output:

Starting
Finished
Test

it only prints the first two lines. The body of the procedure "test"
is never called. I've tried this with several other programs and on
different machines (all with RedHat 9.0). Can anyone give me a
pointer?

Regards,

Ruben



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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-07 20:28 Ada multi-threaded programs do not terminate under RedHat Linux Ruben Stranders
@ 2003-11-07 21:45 ` Robert Spooner
  2003-11-07 21:53 ` Jeff C,
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Robert Spooner @ 2003-11-07 21:45 UTC (permalink / raw)
  To: Ruben Stranders

Ruben,

With the addition of:

with Ada.Text_IO; use Ada.Text_IO;

at the beginning, it compiles and runs OK using the latest public 
version of GNAT on Win2K. I don't have a linux machine to try.

Bob

Ruben Stranders wrote:
> I'm a Ada newbie and I have to make a very simple program to
> demonstrate the use of multithreading in Ada. For that purpose, I
> created the following program.
> 
> ============================
> procedure test is
>         task type counter;
> 
>         task body counter is
>         i : integer :=0;
>         begin
>                 put_line("Start");
>                 while i < 10000 loop
>                         i := i + 1;
>                 end loop;
>                 put_line("Finish");
>         end;
> 
>         task1 : counter;
> 
> begin
>         put_line("Test");
> end;
> ============================
> 
> I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb".
> Unfortunately, the resulting program doesn't terminate. Instead of the
> expected output:
> 
> Starting
> Finished
> Test
> 
> it only prints the first two lines. The body of the procedure "test"
> is never called. I've tried this with several other programs and on
> different machines (all with RedHat 9.0). Can anyone give me a
> pointer?
> 
> Regards,
> 
> Ruben

-- 
                             Robert L. Spooner
                      Registered Professional Engineer
                        Associate Research Engineer
                   Intelligent Control Systems Department

          Applied Research Laboratory        Phone: (814) 863-4120
          The Pennsylvania State University  FAX:   (814) 863-7841
          P. O. Box 30
          State College, PA 16804-0030       rls19@psu.edu




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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-07 20:28 Ada multi-threaded programs do not terminate under RedHat Linux Ruben Stranders
  2003-11-07 21:45 ` Robert Spooner
@ 2003-11-07 21:53 ` Jeff C,
  2003-11-07 22:55   ` news.planet.nl
  2003-11-08  2:08 ` Jeffrey Carter
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Jeff C, @ 2003-11-07 21:53 UTC (permalink / raw)



"Ruben Stranders" <rstranders@yahoo.com> wrote in message
news:43f0a81.0311071228.6620c6c2@posting.google.com...

>
> I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb".
> Unfortunately, the resulting program doesn't terminate. Instead of the
> expected output:
>
> Starting
> Finished
> Test
>
> it only prints the first two lines. The body of the procedure "test"
> is never called. I've tried this with several other programs and on
> different machines (all with RedHat 9.0). Can anyone give me a
> pointer?
>


I did not try to reproduce your problem with the stock gnat from redhat 9
but
with my 5.01p like RPM the program does indeed exit.

http://newserver.thecreems.com/article.php?story=20031019213608350





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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-07 21:53 ` Jeff C,
@ 2003-11-07 22:55   ` news.planet.nl
  0 siblings, 0 replies; 14+ messages in thread
From: news.planet.nl @ 2003-11-07 22:55 UTC (permalink / raw)


Thanks for the tip. However, I'm working on a multi-user system with a linux
shell. I do not have - nor can I obtain - root privileges. Does anyone have
experience with the RH9 gnat rpms?


"Jeff C," <nolongersafeto@userealemailsniff.com> wrote in message
news:jvUqb.139227$HS4.1095252@attbi_s01...
>
> "Ruben Stranders" <rstranders@yahoo.com> wrote in message
> news:43f0a81.0311071228.6620c6c2@posting.google.com...
>
> >
> > I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb".
> > Unfortunately, the resulting program doesn't terminate. Instead of the
> > expected output:
> >
> > Starting
> > Finished
> > Test
> >
> > it only prints the first two lines. The body of the procedure "test"
> > is never called. I've tried this with several other programs and on
> > different machines (all with RedHat 9.0). Can anyone give me a
> > pointer?
> >
>
>
> I did not try to reproduce your problem with the stock gnat from redhat 9
> but
> with my 5.01p like RPM the program does indeed exit.
>
> http://newserver.thecreems.com/article.php?story=20031019213608350
>
>





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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-07 20:28 Ada multi-threaded programs do not terminate under RedHat Linux Ruben Stranders
  2003-11-07 21:45 ` Robert Spooner
  2003-11-07 21:53 ` Jeff C,
@ 2003-11-08  2:08 ` Jeffrey Carter
  2003-11-10 17:47   ` Warren W. Gay VE3WWG
       [not found] ` <h8fu71-s53.ln1@beastie.ix.netcom.com>
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Jeffrey Carter @ 2003-11-08  2:08 UTC (permalink / raw)


Ruben Stranders wrote:

> I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb".
> Unfortunately, the resulting program doesn't terminate. Instead of the
> expected output:
> 
> Starting
> Finished
> Test
> 
> it only prints the first two lines. The body of the procedure "test"
> is never called. I've tried this with several other programs and on
> different machines (all with RedHat 9.0). Can anyone give me a
> pointer?

Usually, under Unixes such as Linux, when people try to run a program 
called "test" nothing happens, since they're running a Unix utility 
rather than their program. But if you're getting some of the output from 
your program, I guess that's not the problem.

There has been some discussion here in the past about problems with 
tasking with the GNAT being distributed with some versions of Linux. You 
might try a Google search.

-- 
Jeff Carter
"Why don't you bore a hole in yourself and let the sap run out?"
Horse Feathers
49




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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
       [not found] ` <h8fu71-s53.ln1@beastie.ix.netcom.com>
@ 2003-11-08  9:49   ` Ruben Stranders
       [not found]     ` <fhnv71-s24.ln1@beastie.ix.netcom.com>
  0 siblings, 1 reply; 14+ messages in thread
From: Ruben Stranders @ 2003-11-08  9:49 UTC (permalink / raw)


This is the output I'm getting:


==================
GNATMAKE 3.2.2 20030222 (3.2.2-4) Copyright 1995-2001 Free Software
Foundation, Inc.
  "test.ali" being checked ...
  -> "test.adb" time stamp mismatch
gcc -c test.adb
End of compilation
gnatbind -x test.ali
gnatlink test.ali
gnatlink: warning: executable name "test" may conflict with shell command
[strand00@atlas rts]$ ./test
Start  1
Finish  1
Start  2
Finish  2
===================

This is *very* strange....


"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message
news:h8fu71-s53.ln1@beastie.ix.netcom.com...
> Ruben Stranders fed this fish to the penguins on Friday 07 November
> 2003 12:28 pm:
>
> >
> > I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb".
> > Unfortunately, the resulting program doesn't terminate. Instead of the
> > expected output:
> >
>         A stale version of Mandrake (8.2), GNAT 3.15p, with the following
> modified version of your test:
>
> with ada.text_io; use ada.text_io;
>
> procedure test is
>         task type counter(ID : integer);
>
>         task body counter is
>                 i : integer := 0;
>         begin
>                 put("Start "); put_line(integer'image(ID));
>                 while i < 10_000 loop
>                         i := i + 1;
>                 end loop;
>                 put("Finish "); put_line(integer'image(ID));
>         end;
>
>         task1 : counter(1);
>         task2 : counter(2);
>
> begin
>         put_line("Test");
> end test;
>
> :produces the following (allowing for editor line wraps):
>
> [wulfraed@beastie ada]$ gnatmake -v test
>
> GNATMAKE 3.15p  (20020523) Copyright 1995-2002 Free Software
> Foundation, Inc.
>   "test.ali" being checked ...
>   -> "test.adb" time stamp mismatch
> gcc -c test.adb
> End of compilation
> gnatbind -x test.ali
> gnatlink test.ali
> gnatlink: warning: executable name "test" may conflict with shell
> command
>
> [wulfraed@beastie ada]$ ./test
> Start  1
> Finish  1
> Test
> Start  2
> Finish  2
>
> -- 
>  > ============================================================== <
>  >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
>  >      wulfraed@dm.net     |       Bestiaria Support Staff       <
>  > ============================================================== <
>  >        Bestiaria Home Page: http://www.beastie.dm.net/         <
>  >            Home Page: http://www.dm.net/~wulfraed/             <
>





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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-07 20:28 Ada multi-threaded programs do not terminate under RedHat Linux Ruben Stranders
                   ` (3 preceding siblings ...)
       [not found] ` <h8fu71-s53.ln1@beastie.ix.netcom.com>
@ 2003-11-08 21:36 ` Patrice Freydiere
  2003-11-10  9:29 ` Gerald Kasner
  5 siblings, 0 replies; 14+ messages in thread
From: Patrice Freydiere @ 2003-11-08 21:36 UTC (permalink / raw)


it works fine on my Linux 9.0 mandrake box.
I use a Gnat 3.15, given on the gnat web site.

Patrice

ps: be careful, gnat has it's own gcc version that can interfere with
local gcc version if it's first in path.

On Fri, 07 Nov 2003 12:28:27 +0000, Ruben Stranders wrote:

> I'm a Ada newbie and I have to make a very simple program to
> demonstrate the use of multithreading in Ada. For that purpose, I
> created the following program.
> 
> ============================
> procedure test is
>         task type counter;
> 
>         task body counter is
>         i : integer :=0;
>         begin
>                 put_line("Start");
>                 while i < 10000 loop
>                         i := i + 1;
>                 end loop;
>                 put_line("Finish");
>         end;
> 
>         task1 : counter;
> 
> begin
>         put_line("Test");
> end;
> ============================
> 
> I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb".
> Unfortunately, the resulting program doesn't terminate. Instead of the
> expected output:
> 
> Starting
> Finished
> Test
> 
> it only prints the first two lines. The body of the procedure "test"
> is never called. I've tried this with several other programs and on
> different machines (all with RedHat 9.0). Can anyone give me a
> pointer?
> 
> Regards,
> 
> Ruben




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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
       [not found]     ` <fhnv71-s24.ln1@beastie.ix.netcom.com>
@ 2003-11-08 23:09       ` Ruben Stranders
  2003-11-09  5:31         ` Adrian Hoe
  0 siblings, 1 reply; 14+ messages in thread
From: Ruben Stranders @ 2003-11-08 23:09 UTC (permalink / raw)


I get the following output:

Start  1
Start  2
Finish  2
Finish  1
(Program doesn't terminate, have to kill it with Ctrl-C)

This indicates that the procedure test is never called.

Ruben



"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message
news:fhnv71-s24.ln1@beastie.ix.netcom.com...
> Ruben Stranders fed this fish to the penguins on Saturday 08 November
> 2003 01:49 am:
>
>
> > [strand00@atlas rts]$ ./test
> > Start  1
> > Finish  1
> > Start  2
> > Finish  2
> > ===================
> >
> > This is *very* strange....
> >
>         One more variation, with a much longer timing loop, and a bit more
> stuff going on inside.
>
> with ada.text_io; use ada.text_io;
>
> procedure test is
>         task type counter(ID : integer);
>
>         task body counter is
>                 i : integer := 0;
>         begin
>                 put("Start "); put_line(integer'image(ID));
>                 while i < 10_000_000 loop
>                         i := i + 1;
>                 end loop;
>                 put("Finish "); put_line(integer'image(ID));
>         end;
>
>         task1 : counter(1);
>         task2 : counter(2);
>
>         procedure adummy is
>                 task3 : counter(3);
>                 task4 : counter(4);
>         begin
>                 put_line("adummy");
>         end;
>
> begin
>         put_line("Test");
>         adummy;
>         put_line("End it");
> end test;
>
>         My output looks like:
>
> [wulfraed@beastie ada]$ ./test
> Start  1
> Test
> Start  2
> Start  3
> adummy
> Start  4
> Finish  1
> Finish Finish  2
>  3
> Finish  4
> End it
>
>         Notice how 2 and 3 overlapped the I/O (since the "Finish" and the
ID
> are separate calls).
>
>         Try something like this one, AND try redirecting the output to a
text
> file. I'm wondering if the RH9 console I/O system might be overwriting
> part of your output -- redirecting, as in
>
> [wulfraed@beastie ada]$ ./test >test.log
>
> would give you a file you can look at with a binary editor. At the very
> least, if you get 3 and 4 output you've shown that the main procedure
> /is/ executing, but then have to figure out why the tasks are getting
> to stdout, but not the main...
>
> -- 
>  > ============================================================== <
>  >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
>  >      wulfraed@dm.net     |       Bestiaria Support Staff       <
>  > ============================================================== <
>  >        Bestiaria Home Page: http://www.beastie.dm.net/         <
>  >            Home Page: http://www.dm.net/~wulfraed/             <
>





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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-08 23:09       ` Ruben Stranders
@ 2003-11-09  5:31         ` Adrian Hoe
  2003-11-09 10:39           ` Ruben Stranders
  0 siblings, 1 reply; 14+ messages in thread
From: Adrian Hoe @ 2003-11-09  5:31 UTC (permalink / raw)


Which version of gcc do you have on your RH9 box?

I used to have tasking problem with gcc 3.3 prerelease version bundled 
in SuSE 8.1. The problem disappear when I upgraded to SuSE 8.2. 
Apparently, the gcc 3.3 prerelease bundled in SuSE 8.2 had the problem 
fixed.

I'm running gcc 3.3 20030226 (prerelease) bundled with SuSE Linux 8.2.

I may suggest you to download latest release of gcc from RH website if 
any. gcc 3.3 from SuSE 8.2 should work on your RH9 too.



Ruben Stranders wrote:

> I get the following output:
> 
> Start  1
> Start  2
> Finish  2
> Finish  1
> (Program doesn't terminate, have to kill it with Ctrl-C)
> 
> This indicates that the procedure test is never called.
> 
> Ruben
> 
> 
> 
> "Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message
> news:fhnv71-s24.ln1@beastie.ix.netcom.com...
> 
>>Ruben Stranders fed this fish to the penguins on Saturday 08 November
>>2003 01:49 am:
>>
>>
>>
>>>[strand00@atlas rts]$ ./test
>>>Start  1
>>>Finish  1
>>>Start  2
>>>Finish  2
>>>===================
>>>
>>>This is *very* strange....
>>>
>>>
>>        One more variation, with a much longer timing loop, and a bit more
>>stuff going on inside.
>>
>>with ada.text_io; use ada.text_io;
>>
>>procedure test is
>>        task type counter(ID : integer);
>>
>>        task body counter is
>>                i : integer := 0;
>>        begin
>>                put("Start "); put_line(integer'image(ID));
>>                while i < 10_000_000 loop
>>                        i := i + 1;
>>                end loop;
>>                put("Finish "); put_line(integer'image(ID));
>>        end;
>>
>>        task1 : counter(1);
>>        task2 : counter(2);
>>
>>        procedure adummy is
>>                task3 : counter(3);
>>                task4 : counter(4);
>>        begin
>>                put_line("adummy");
>>        end;
>>
>>begin
>>        put_line("Test");
>>        adummy;
>>        put_line("End it");
>>end test;
>>
>>        My output looks like:
>>
>>[wulfraed@beastie ada]$ ./test
>>Start  1
>>Test
>>Start  2
>>Start  3
>>adummy
>>Start  4
>>Finish  1
>>Finish Finish  2
>> 3
>>Finish  4
>>End it
>>
>>        Notice how 2 and 3 overlapped the I/O (since the "Finish" and the
>>
> ID
> 
>>are separate calls).
>>
>>        Try something like this one, AND try redirecting the output to a
>>
> text
> 
>>file. I'm wondering if the RH9 console I/O system might be overwriting
>>part of your output -- redirecting, as in
>>
>>[wulfraed@beastie ada]$ ./test >test.log
>>
>>would give you a file you can look at with a binary editor. At the very
>>least, if you get 3 and 4 output you've shown that the main procedure
>>/is/ executing, but then have to figure out why the tasks are getting
>>to stdout, but not the main...
>>
>>-- 
>> > ============================================================== <
>> >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
>> >      wulfraed@dm.net     |       Bestiaria Support Staff       <
>> > ============================================================== <
>> >        Bestiaria Home Page: http://www.beastie.dm.net/         <
>> >            Home Page: http://www.dm.net/~wulfraed/             <
>>
> 
> 


-- 
Adrian Hoe
m a i l b o x AT a d r i a n h o e . c o m




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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-09  5:31         ` Adrian Hoe
@ 2003-11-09 10:39           ` Ruben Stranders
  2003-11-11  2:32             ` Adrian Hoe
  0 siblings, 1 reply; 14+ messages in thread
From: Ruben Stranders @ 2003-11-09 10:39 UTC (permalink / raw)


I'm using gcc 3.2.2. I'll try to upgrade to version 3.3, although the rpm's
are not (yet) available on redhat.com.




"Adrian Hoe" <adrianhoe@nowhere.com> wrote in message
news:3FADD13A.1020903@nowhere.com...
> Which version of gcc do you have on your RH9 box?
>
> I used to have tasking problem with gcc 3.3 prerelease version bundled
> in SuSE 8.1. The problem disappear when I upgraded to SuSE 8.2.
> Apparently, the gcc 3.3 prerelease bundled in SuSE 8.2 had the problem
> fixed.
>
> I'm running gcc 3.3 20030226 (prerelease) bundled with SuSE Linux 8.2.
>
> I may suggest you to download latest release of gcc from RH website if
> any. gcc 3.3 from SuSE 8.2 should work on your RH9 too.
>
>
>
> Ruben Stranders wrote:
>
> > I get the following output:
> >
> > Start  1
> > Start  2
> > Finish  2
> > Finish  1
> > (Program doesn't terminate, have to kill it with Ctrl-C)
> >
> > This indicates that the procedure test is never called.
> >
> > Ruben
> >
> >
> >
> > "Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message
> > news:fhnv71-s24.ln1@beastie.ix.netcom.com...
> >
> >>Ruben Stranders fed this fish to the penguins on Saturday 08 November
> >>2003 01:49 am:
> >>
> >>
> >>
> >>>[strand00@atlas rts]$ ./test
> >>>Start  1
> >>>Finish  1
> >>>Start  2
> >>>Finish  2
> >>>===================
> >>>
> >>>This is *very* strange....
> >>>
> >>>
> >>        One more variation, with a much longer timing loop, and a bit
more
> >>stuff going on inside.
> >>
> >>with ada.text_io; use ada.text_io;
> >>
> >>procedure test is
> >>        task type counter(ID : integer);
> >>
> >>        task body counter is
> >>                i : integer := 0;
> >>        begin
> >>                put("Start "); put_line(integer'image(ID));
> >>                while i < 10_000_000 loop
> >>                        i := i + 1;
> >>                end loop;
> >>                put("Finish "); put_line(integer'image(ID));
> >>        end;
> >>
> >>        task1 : counter(1);
> >>        task2 : counter(2);
> >>
> >>        procedure adummy is
> >>                task3 : counter(3);
> >>                task4 : counter(4);
> >>        begin
> >>                put_line("adummy");
> >>        end;
> >>
> >>begin
> >>        put_line("Test");
> >>        adummy;
> >>        put_line("End it");
> >>end test;
> >>
> >>        My output looks like:
> >>
> >>[wulfraed@beastie ada]$ ./test
> >>Start  1
> >>Test
> >>Start  2
> >>Start  3
> >>adummy
> >>Start  4
> >>Finish  1
> >>Finish Finish  2
> >> 3
> >>Finish  4
> >>End it
> >>
> >>        Notice how 2 and 3 overlapped the I/O (since the "Finish" and
the
> >>
> > ID
> >
> >>are separate calls).
> >>
> >>        Try something like this one, AND try redirecting the output to a
> >>
> > text
> >
> >>file. I'm wondering if the RH9 console I/O system might be overwriting
> >>part of your output -- redirecting, as in
> >>
> >>[wulfraed@beastie ada]$ ./test >test.log
> >>
> >>would give you a file you can look at with a binary editor. At the very
> >>least, if you get 3 and 4 output you've shown that the main procedure
> >>/is/ executing, but then have to figure out why the tasks are getting
> >>to stdout, but not the main...
> >>
> >>-- 
> >> > ============================================================== <
> >> >   wlfraed@ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
> >> >      wulfraed@dm.net     |       Bestiaria Support Staff       <
> >> > ============================================================== <
> >> >        Bestiaria Home Page: http://www.beastie.dm.net/         <
> >> >            Home Page: http://www.dm.net/~wulfraed/             <
> >>
> >
> >
>
>
> -- 
> Adrian Hoe
> m a i l b o x AT a d r i a n h o e . c o m
>





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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-07 20:28 Ada multi-threaded programs do not terminate under RedHat Linux Ruben Stranders
                   ` (4 preceding siblings ...)
  2003-11-08 21:36 ` Patrice Freydiere
@ 2003-11-10  9:29 ` Gerald Kasner
  5 siblings, 0 replies; 14+ messages in thread
From: Gerald Kasner @ 2003-11-10  9:29 UTC (permalink / raw)


======
> 
> I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb".
> Unfortunately, the resulting program doesn't terminate. Instead of the
> expected output:
> 
> Starting
> Finished
> Test
> 
> it only prints the first two lines. The body of the procedure "test"
> is never called. I've tried this with several other programs and on
> different machines (all with RedHat 9.0). Can anyone give me a
> pointer?
> 
> Regards,
> 
> Ruben

RH9
with gcc-rpms vom redhat-rawhide: (now included in Fedora 1)
(It makes sense to upgrade the whole gcc-stuff, binutils..)

dual PIII machine

$ rpm -q gcc-gnat
gcc-gnat-3.3.2-1



 gnatmake -v test

GNATMAKE 3.3.2 20031022 (Red Hat Linux 3.3.2-1) Copyright 1995-2002 Free
Software Foundation, Inc.
  "test.ali" being checked ...
  -> "test.ali" missing.
gcc -c test.adb
End of compilation
gnatbind -x test.ali
gnatlink test.ali
gnatlink: warning: executable name "test" may conflict with shell
command

$ ./test
Start  1
Finish  1
Start  2
Finish  2
Test



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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-08  2:08 ` Jeffrey Carter
@ 2003-11-10 17:47   ` Warren W. Gay VE3WWG
  0 siblings, 0 replies; 14+ messages in thread
From: Warren W. Gay VE3WWG @ 2003-11-10 17:47 UTC (permalink / raw)


Jeffrey Carter wrote:

> Ruben Stranders wrote:
> 
>> I've compiled it under RedHat Linux 9.0 with "gnatmake test.adb".
>> Unfortunately, the resulting program doesn't terminate. Instead of the
>> expected output:
>>
>> Starting
>> Finished
>> Test
>>
>> it only prints the first two lines. The body of the procedure "test"
>> is never called. I've tried this with several other programs and on
>> different machines (all with RedHat 9.0). Can anyone give me a
>> pointer?
> 
> 
> Usually, under Unixes such as Linux, when people try to run a program 
> called "test" nothing happens, since they're running a Unix utility 
> rather than their program. But if you're getting some of the output from 
> your program, I guess that's not the problem.

If in doubt, always do a ./test if the executable is in your
current directory (this is a good general practice anyway, to
avoid trojan horses). If the executable is in another directory,
then you can also invoke by pathname, starting from '/'. Without
qualifying the name of the executable, Jeffrey is right: you
usually end up invoking the shell test command (builtin, or
otherwise).
-- 
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg




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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-09 10:39           ` Ruben Stranders
@ 2003-11-11  2:32             ` Adrian Hoe
  2003-11-11  2:34               ` Adrian Hoe
  0 siblings, 1 reply; 14+ messages in thread
From: Adrian Hoe @ 2003-11-11  2:32 UTC (permalink / raw)


Ruben Stranders wrote:

> I'm using gcc 3.2.2. I'll try to upgrade to version 3.3, although the rpm's
> are not (yet) available on redhat.com.



I ran gcc-gnat 3.2.2 on RH9 box and the problem was there. It could be 
either the compiler or gnat run-time library. Upgrade to a later version 
of gcc-gnat should solve the problem.
-- 
Adrian Hoe
m a i l b o x AT a d r i a n h o e . c o m




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

* Re: Ada multi-threaded programs do not terminate under RedHat Linux
  2003-11-11  2:32             ` Adrian Hoe
@ 2003-11-11  2:34               ` Adrian Hoe
  0 siblings, 0 replies; 14+ messages in thread
From: Adrian Hoe @ 2003-11-11  2:34 UTC (permalink / raw)


Adrian Hoe wrote:

> Ruben Stranders wrote:
> 
>> I'm using gcc 3.2.2. I'll try to upgrade to version 3.3, although the 
>> rpm's
>> are not (yet) available on redhat.com.
> 
> 
> 
> 
> I ran gcc-gnat 3.2.2 on RH9 box and the problem was there. It could be 
> either the compiler or gnat run-time library. Upgrade to a later version 
> of gcc-gnat should solve the problem.


Oops! I mistakenly hit on the send button on a wrong compose windows. 
Having time-slice for a few message composing sessions. :)


I installed SuSE's rpm (gcc-gnat 3.3) on RH9 and the problem disappeared.
-- 
Adrian Hoe
m a i l b o x AT a d r i a n h o e . c o m




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

end of thread, other threads:[~2003-11-11  2:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-07 20:28 Ada multi-threaded programs do not terminate under RedHat Linux Ruben Stranders
2003-11-07 21:45 ` Robert Spooner
2003-11-07 21:53 ` Jeff C,
2003-11-07 22:55   ` news.planet.nl
2003-11-08  2:08 ` Jeffrey Carter
2003-11-10 17:47   ` Warren W. Gay VE3WWG
     [not found] ` <h8fu71-s53.ln1@beastie.ix.netcom.com>
2003-11-08  9:49   ` Ruben Stranders
     [not found]     ` <fhnv71-s24.ln1@beastie.ix.netcom.com>
2003-11-08 23:09       ` Ruben Stranders
2003-11-09  5:31         ` Adrian Hoe
2003-11-09 10:39           ` Ruben Stranders
2003-11-11  2:32             ` Adrian Hoe
2003-11-11  2:34               ` Adrian Hoe
2003-11-08 21:36 ` Patrice Freydiere
2003-11-10  9:29 ` Gerald Kasner

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