comp.lang.ada
 help / color / mirror / Atom feed
* Problem with tasking when root
@ 2004-08-04 12:05 Jean-Pierre Rosen
  2004-08-04 12:15 ` Duncan Sands
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Jean-Pierre Rosen @ 2004-08-04 12:05 UTC (permalink / raw)


Context: Gnat 3.15p+Glade, Linux 2.4.21, Mandrake.

I have a distributed application that works OK under Windows, and under Linux as a normal user.
When run as root, it deadlocks at task creation, i.e. I never return from a "new T", where T is a task type.
According to strace, it blocks within the runtime (getting into sigsuspend).

Does this ring a bell to someone?

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





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

* Re: Problem with tasking when root
  2004-08-04 12:05 Problem with tasking when root Jean-Pierre Rosen
@ 2004-08-04 12:15 ` Duncan Sands
       [not found] ` <200408041415.06638.baldrick@free.fr>
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Duncan Sands @ 2004-08-04 12:15 UTC (permalink / raw)
  To: comp.lang.ada; +Cc: Jean-Pierre Rosen

> I have a distributed application that works OK under Windows, and under Linux as a normal user.
> When run as root, it deadlocks at task creation, i.e. I never return from a "new T", where T is a task type.
> According to strace, it blocks within the runtime (getting into sigsuspend).

Can you supply the source?

Thanks,

Duncan.



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

* Re: Problem with tasking when root
       [not found] ` <200408041415.06638.baldrick@free.fr>
@ 2004-08-04 13:08   ` Jean-Pierre Rosen
       [not found]   ` <01b701c47a24$14619f90$f60206c0@VOYAGER>
  1 sibling, 0 replies; 15+ messages in thread
From: Jean-Pierre Rosen @ 2004-08-04 13:08 UTC (permalink / raw)
  To: comp.lang.ada

> > I have a distributed application that works OK under Windows, and
under Linux as a normal user.
> > When run as root, it deadlocks at task creation, i.e. I never return
from a "new T", where T is a task type.
> > According to strace, it blocks within the runtime (getting into
sigsuspend).
>
> Can you supply the source?
>
If you want to give it a try, I can send it to you, but it is definitely
too much for posting (31 files).
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr




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

* Re: Problem with tasking when root
  2004-08-04 12:05 Problem with tasking when root Jean-Pierre Rosen
  2004-08-04 12:15 ` Duncan Sands
       [not found] ` <200408041415.06638.baldrick@free.fr>
@ 2004-08-04 13:11 ` Marc A. Criley
  2004-08-04 15:28   ` Jean-Pierre Rosen
  2004-08-04 18:23 ` Colin Paul Gloster
  2004-08-06  4:54 ` Simon Wright
  4 siblings, 1 reply; 15+ messages in thread
From: Marc A. Criley @ 2004-08-04 13:11 UTC (permalink / raw)



"Jean-Pierre Rosen" <rosen@adalog.fr> wrote:

> Context: Gnat 3.15p+Glade, Linux 2.4.21, Mandrake.
>
> I have a distributed application that works OK under Windows, and under
Linux as a normal user.
> When run as root, it deadlocks at task creation, i.e. I never return from
a "new T", where T is a task type.
> According to strace, it blocks within the runtime (getting into
sigsuspend).
>
> Does this ring a bell to someone?

Is this possibly the NPTL threads problem? Have you got LD_ASSUME_KERNEL set
to 2.4.1 when running as a normal user, but perhaps left unset when running
as root? An immediate hang is what happens when hitting the first tasking
construct with GNAT 3.15p in an NPTL threads environment.

HTH,

Marc A. Criley
McKae Technologies
www.mckae.com





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

* Re: Problem with tasking when root
       [not found]   ` <01b701c47a24$14619f90$f60206c0@VOYAGER>
@ 2004-08-04 13:20     ` Duncan Sands
  2004-08-04 18:53       ` Ludovic Brenta
  0 siblings, 1 reply; 15+ messages in thread
From: Duncan Sands @ 2004-08-04 13:20 UTC (permalink / raw)
  To: comp.lang.ada

> If you want to give it a try, I can send it to you, but it is definitely
> too much for posting (31 files).

Please do, I'm kind of curious.

Duncan.



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

* Re: Problem with tasking when root
  2004-08-04 13:11 ` Marc A. Criley
@ 2004-08-04 15:28   ` Jean-Pierre Rosen
  2004-08-04 17:31     ` Marc A. Criley
  0 siblings, 1 reply; 15+ messages in thread
From: Jean-Pierre Rosen @ 2004-08-04 15:28 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 770 bytes --]


"Marc A. Criley" <mcNOSPAM@mckae.com> a �crit dans le message de news:2nc5jjFv53gkU1@uni-berlin.de...
>
> Is this possibly the NPTL threads problem? Have you got LD_ASSUME_KERNEL set
> to 2.4.1 when running as a normal user, but perhaps left unset when running
> as root? An immediate hang is what happens when hitting the first tasking
> construct with GNAT 3.15p in an NPTL threads environment.
>
Thanks for the suggestion, but it does not appear to change anything.
Moreover:
My kernel is 2.4.21. Has it NPTL already?
I doubt that the fact of being root would have an impact on this. It works OK if not root.

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





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

* Re: Problem with tasking when root
  2004-08-04 15:28   ` Jean-Pierre Rosen
@ 2004-08-04 17:31     ` Marc A. Criley
  2004-08-05  8:06       ` Jean-Pierre Rosen
  0 siblings, 1 reply; 15+ messages in thread
From: Marc A. Criley @ 2004-08-04 17:31 UTC (permalink / raw)


"Jean-Pierre Rosen" <rosen@adalog.fr> wrote:
>
> I doubt that the fact of being root would have an impact on this. It works
OK if not root.

Do you set LD_LIBRARY_PATH? Could it be altering the directories in which
runtime libraries are being sought?

(Hey, just flailing around here with the kinds of things that I've messed up
on in the past :-)

Marc





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

* Re: Problem with tasking when root
  2004-08-04 12:05 Problem with tasking when root Jean-Pierre Rosen
                   ` (2 preceding siblings ...)
  2004-08-04 13:11 ` Marc A. Criley
@ 2004-08-04 18:23 ` Colin Paul Gloster
  2004-08-05  8:07   ` Jean-Pierre Rosen
  2004-08-06  4:54 ` Simon Wright
  4 siblings, 1 reply; 15+ messages in thread
From: Colin Paul Gloster @ 2004-08-04 18:23 UTC (permalink / raw)


In article news:mdjqec.g9d.ln@skymaster Jean-Pierre Rosen wrote:
"[..]
  
I have a distributed application that works OK [..] under Linux as a normal user.
When run as root, [..]

[..]"

I have no useful suggestion, but why do you need to run it as root?



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

* Re: Problem with tasking when root
  2004-08-04 13:20     ` Duncan Sands
@ 2004-08-04 18:53       ` Ludovic Brenta
  0 siblings, 0 replies; 15+ messages in thread
From: Ludovic Brenta @ 2004-08-04 18:53 UTC (permalink / raw)


Duncan Sands writes:
>> If you want to give it a try, I can send it to you, but it is definitely
>> too much for posting (31 files).
>
> Please do, I'm kind of curious.
>
> Duncan.

Me too.

-- 
Ludovic Brenta.



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

* Re: Problem with tasking when root
  2004-08-04 17:31     ` Marc A. Criley
@ 2004-08-05  8:06       ` Jean-Pierre Rosen
  0 siblings, 0 replies; 15+ messages in thread
From: Jean-Pierre Rosen @ 2004-08-05  8:06 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 696 bytes --]


"Marc A. Criley" <mcNOSPAM@mckae.com> a �crit dans le message de news:2nckr8FvditvU1@uni-berlin.de...
> "Jean-Pierre Rosen" <rosen@adalog.fr> wrote:
> >
> > I doubt that the fact of being root would have an impact on this. It works
> OK if not root.
>
> Do you set LD_LIBRARY_PATH? Could it be altering the directories in which
> runtime libraries are being sought?
>
> (Hey, just flailing around here with the kinds of things that I've messed up
> on in the past :-)
>
Nice try, but my LD_LIBRARY_PATH is empty, whether I'm root or not.

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





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

* Re: Problem with tasking when root
  2004-08-04 18:23 ` Colin Paul Gloster
@ 2004-08-05  8:07   ` Jean-Pierre Rosen
  2004-08-06 10:28     ` Stephen Leake
  0 siblings, 1 reply; 15+ messages in thread
From: Jean-Pierre Rosen @ 2004-08-05  8:07 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 706 bytes --]

"Colin Paul Gloster" <Colin_Paul_Gloster@ACM.org> a �crit dans le message de news:slrnch2acb.q7m.Colin_Paul_Gloster@camac.dcu.ie...
> In article news:mdjqec.g9d.ln@skymaster Jean-Pierre Rosen wrote:
> "[..]
>
> I have a distributed application that works OK [..] under Linux as a normal user.
> When run as root, [..]
>
> [..]"
>
> I have no useful suggestion, but why do you need to run it as root?
Because it is a system utility that needs to perform command files with the identity of the user of the command file.
Only root can do a set-user-id

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





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

* Re: Problem with tasking when root
  2004-08-04 12:05 Problem with tasking when root Jean-Pierre Rosen
                   ` (3 preceding siblings ...)
  2004-08-04 18:23 ` Colin Paul Gloster
@ 2004-08-06  4:54 ` Simon Wright
  2004-08-06  7:58   ` Jean-Pierre Rosen
  4 siblings, 1 reply; 15+ messages in thread
From: Simon Wright @ 2004-08-06  4:54 UTC (permalink / raw)


"Jean-Pierre Rosen" <rosen@adalog.fr> writes:

> Context: Gnat 3.15p+Glade, Linux 2.4.21, Mandrake.
> 
> I have a distributed application that works OK under Windows, and
> under Linux as a normal user.  When run as root, it deadlocks at
> task creation, i.e. I never return from a "new T", where T is a task
> type.  According to strace, it blocks within the runtime (getting
> into sigsuspend).

One of the conditions for a (Linux, Solaris) Ada program to actually
respect priority assignments is that it is running as root. There may
be other conditions too, I believe that this area has changed quite a
lot.

Are you perhaps having a deadlock?

-- 
Simon Wright                               100% Ada, no bugs.



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

* Re: Problem with tasking when root
  2004-08-06  4:54 ` Simon Wright
@ 2004-08-06  7:58   ` Jean-Pierre Rosen
  2004-08-06 17:42     ` Frode Tennebø
  0 siblings, 1 reply; 15+ messages in thread
From: Jean-Pierre Rosen @ 2004-08-06  7:58 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 695 bytes --]


"Simon Wright" <simon@pushface.org> a �crit dans le message de news:x7v657wj288.fsf@smaug.pushface.org...
> Are you perhaps having a deadlock?
>
No, no. Believe me, I investigated a lot before asking on c.l.a :-). I gave up when this sequence:

         Message ("Creating new task", Level => Info);
         Server := new Server_Task;
         Message ("Created new task", Level => Info);

printed the first message, and not the second one (no exception raised, gdb and strace showed I was actually stuck inside the "new
Server_Task".

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr






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

* Re: Problem with tasking when root
  2004-08-05  8:07   ` Jean-Pierre Rosen
@ 2004-08-06 10:28     ` Stephen Leake
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Leake @ 2004-08-06 10:28 UTC (permalink / raw)
  To: comp.lang.ada

"Jean-Pierre Rosen" <rosen@adalog.fr> writes:

> "Colin Paul Gloster" <Colin_Paul_Gloster@ACM.org> a écrit dans le message de news:slrnch2acb.q7m.Colin_Paul_Gloster@camac.dcu.ie...
> > In article news:mdjqec.g9d.ln@skymaster Jean-Pierre Rosen wrote:
> > "[..]
> >
> > I have a distributed application that works OK [..] under Linux as a normal user.
> > When run as root, [..]
> >
> > [..]"
> >
> > I have no useful suggestion, but why do you need to run it as root?

> Because it is a system utility that needs to perform command files
> with the identity of the user of the command file. Only root can do
> a set-user-id

That's not strictly true. You can set the "set-uid" bit on an
executable, and then it can change it's user id to root, even when run
from a user account. 

But that may lead to the same problem you are having.

-- 
-- Stephe




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

* Re: Problem with tasking when root
  2004-08-06  7:58   ` Jean-Pierre Rosen
@ 2004-08-06 17:42     ` Frode Tennebø
  0 siblings, 0 replies; 15+ messages in thread
From: Frode Tennebø @ 2004-08-06 17:42 UTC (permalink / raw)


On Friday 06 August 2004 09:58 Jean-Pierre Rosen wrote:

> printed the first message, and not the second one (no exception
> raised, gdb and strace showed I was actually stuck inside the "new
> Server_Task".

Just a stab in the dark: What does 'ulimit -a' (or 'limit' on some
systems/shell) say? Is there a difference between root and the user
which is OK?

 -Frode

-- 
^ Frode Tenneb� | email: frode@tennebo.com | Frode@IRC ^
|  with Standard.Disclaimer; use Standard.Disclaimer;  |



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

end of thread, other threads:[~2004-08-06 17:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-04 12:05 Problem with tasking when root Jean-Pierre Rosen
2004-08-04 12:15 ` Duncan Sands
     [not found] ` <200408041415.06638.baldrick@free.fr>
2004-08-04 13:08   ` Jean-Pierre Rosen
     [not found]   ` <01b701c47a24$14619f90$f60206c0@VOYAGER>
2004-08-04 13:20     ` Duncan Sands
2004-08-04 18:53       ` Ludovic Brenta
2004-08-04 13:11 ` Marc A. Criley
2004-08-04 15:28   ` Jean-Pierre Rosen
2004-08-04 17:31     ` Marc A. Criley
2004-08-05  8:06       ` Jean-Pierre Rosen
2004-08-04 18:23 ` Colin Paul Gloster
2004-08-05  8:07   ` Jean-Pierre Rosen
2004-08-06 10:28     ` Stephen Leake
2004-08-06  4:54 ` Simon Wright
2004-08-06  7:58   ` Jean-Pierre Rosen
2004-08-06 17:42     ` Frode Tennebø

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