* gnat3.14p on solaris 9 crashes
@ 2002-11-19 4:16 Pete
2002-11-19 8:56 ` Thierry Lelegard
0 siblings, 1 reply; 2+ messages in thread
From: Pete @ 2002-11-19 4:16 UTC (permalink / raw)
Hi,
Has anyone had a successful port of gnat onto solaris 9? I can
get basic ada programs to run but when I try to use tasks there is a
crash in ada_init. I've tried recompiling gnat on solaris 9 but that
didn't work either. Everything works fine on solaris 7, and 8. For
example the following simple program crashes on solaris 9. I don't
even have to start the task to get a seg fault. Also, if I replace
the libthread.so with libthread.so from solaris 8, it doesn't crash
but it just hangs. Maybe gnat is assuming something it shouldn't
about the solaris threading model?
with Text_Io;
procedure Ada_Test is
task Do_It is
entry Start;
entry Stop;
end Do_It;
task body Do_It is
begin
select
accept Start;
while true loop
Text_Io.Put_Line("Hello world");
select
accept Stop;
exit;
or
delay 1.0;
end select;
end loop;
or
terminate;
end select;
end Do_It;
begin
null;
end Ada_Test;
- pete
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: gnat3.14p on solaris 9 crashes
2002-11-19 4:16 gnat3.14p on solaris 9 crashes Pete
@ 2002-11-19 8:56 ` Thierry Lelegard
0 siblings, 0 replies; 2+ messages in thread
From: Thierry Lelegard @ 2002-11-19 8:56 UTC (permalink / raw)
> Has anyone had a successful port of gnat onto solaris 9? I can
> get basic ada programs to run but when I try to use tasks there is a
> crash in ada_init. I've tried recompiling gnat on solaris 9 but that
> didn't work either. Everything works fine on solaris 7, and 8. For
> example the following simple program crashes on solaris 9. I don't
> even have to start the task to get a seg fault. Also, if I replace
> the libthread.so with libthread.so from solaris 8, it doesn't crash
> but it just hangs. Maybe gnat is assuming something it shouldn't
> about the solaris threading model?
Yes, this is a known problem at ACT (we had the same problem with
GNAT Pro and, as a paying customer, we reported it to ACT).
Apparently, GNAT uses some undocumented feature of libthread.so
that no longer works on Solaris 9. BTW, Sun completely redesigned
libthread.so in Solaris 9 (they call it the "T2 library").
One solution (at least with GNAT 3.15) is to use the pthread library
instead of the native thread library. Look at the gnat lib directory:
$ ls -l /opt/gnu/gnat/lib/gcc-lib/sparc-sun-solaris2.8/2.8.1/
total 15256
lrwxrwxrwx 1 root root 21 Oct 28 14:52 adainclude -> rts-native/adainclude
lrwxrwxrwx 1 root root 17 Oct 28 14:52 adalib -> rts-native/adalib
....
drwxr-xr-x 4 root root 512 May 27 22:58 rts-fsu
drwxr-xr-x 4 root root 512 May 27 22:58 rts-native
drwxr-xr-x 4 root root 512 May 27 22:58 rts-pthread
....
$
Modify the symbolic links adainclude and adalib so that they point
to rts-pthread instead of rts-native. It works with GNAT 3.15a1.
If you recompiled GNAT, you may want to fix the libthread problem
yourself. It seems that the problem is around the "self" function,
when the runtime gets the id of the current thread. Good luck.
-Thierry Lelegard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-11-19 8:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-19 4:16 gnat3.14p on solaris 9 crashes Pete
2002-11-19 8:56 ` Thierry Lelegard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox