LIMIT DOES NOT LIMIT

LIMIT DOES NOT LIMIT

Post by Tobias Rula » Sat, 20 May 1995 04:00:00



high all

i'm using tcsh under 5.4. my man pages say that i can
limit the resources of a process - but i cannot. i was
able to limit filesize, that was no problem. but i
was not able to limit cputime as my man pages suggest.

i tried:   limit -h cputime 0:20
and this limit was actually set, but when a child
process of this shell needs more than 20 seconds
NOTHING happens, the process continues without aborting
or any reaction. if i were a shell :-) i'd send
a SIGKILL to the process when it has reached its limits.

why does this not happen?????? please answer, because
we have a buggy program here that kills our main server
several times a day...

    c u
        tobias
---
---------------------------------------------------------------------------
Tobias Ruland (student at Dept. of Artificial Intelligence, Univ. Erlangen)


      (Please write in ENGLISH, GERMAN or FINNISH)
WWW:  http://www8.informatik.uni-erlangen.de/~tsruland

 
 
 

LIMIT DOES NOT LIMIT

Post by ron na » Sat, 20 May 1995 04:00:00


Don't use the -h flag: limit cputime 20

This will cause a kill -XCPU to be sent to any process exceeding
20 seconds.

: i'm using tcsh under 5.4. my man pages say that i can
: limit the resources of a process - but i cannot. i was
: able to limit filesize, that was no problem. but i
: was not able to limit cputime as my man pages suggest.

: i tried:   limit -h cputime 0:20
--

  ,;( )__, )~\|  |
 ;; //   '--;    | Gin-N-Tonic   endurance horse
 '  ;\    |      | Luv on Fire   trusty trail horse

 
 
 

LIMIT DOES NOT LIMIT

Post by Joerg Schilli » Sun, 21 May 1995 04:00:00



>Don't use the -h flag: limit cputime 20

>This will cause a kill -XCPU to be sent to any process exceeding
>20 seconds.


>: i'm using tcsh under 5.4. my man pages say that i can
>: limit the resources of a process - but i cannot. i was
>: able to limit filesize, that was no problem. but i
>: was not able to limit cputime as my man pages suggest.

>: i tried:   limit -h cputime 0:20

Have you ever tried this ????

SIGXCPU is by default ignored on Solaris 2.x, I don't know why :-(
This breaks limit cputime <val>

Joerg

--
Private:J?rg Schilling Seestr. 110 D-13353 Berlin      (030)452 55 85


If you don't have iso-8859-1 chars my name is           J"org Schilling

 
 
 

LIMIT DOES NOT LIMIT

Post by Guy Harr » Sun, 21 May 1995 04:00:00



>SIGXCPU is by default ignored on Solaris 2.x,

Indeed?

        symixsrv% uname -a
        SunOS symixsrv 5.4 generic sun4m sparc
        symixsrv% cat foo.c
        main()
        {
                for (;;)
                        ;
        }
        symixsrv% gcc foo.c
        symixsrv% limit cputime 0:05
        symixsrv% ./a.out
        Cpu Limit Exceeded (core dumped)

 
 
 

LIMIT DOES NOT LIMIT

Post by Joerg Schilli » Mon, 22 May 1995 04:00:00




>>SIGXCPU is by default ignored on Solaris 2.x,

>Indeed?

        I repeat: SIGXCPU is by default ignored on Solaris 2.x,
                        limit cputime does *not* work.

.... Of course, if your login shell is /usr/bin/csh, csh hides this bug!

The bug is located in init(1M) and can be found - if not fixed - on all SYSVr4
implementations.

I would call this a serious bug, as it breaks the behavior that is guaranteed
by the manual (signal(5)). The correct behaviour of the kernel is superseeded
by init(1M).

Here is the buggy part in init.c:
                /*
                 * Reset all signals to the system defaults,
                 * making sure that SIGXCPU and SIGXFSZ remain
                 * ignored, for backward compatibility.
                 */
                for (i = SIGHUP; i <= SIGPWR; i++)
                        oldsigs[i] = sigset(i, SIG_DFL);

        (SIGXCPU has been ignored before this)

I believe the author of the comment above didn't realize the effect of his
act of - wrong understood - good will.

To verify:

log in on an account with the default shell (i.e. root)
% cat foo.c
#include <signal.h>
#include <sys/syscall.h>

main()
{
        printf("value of SIG_IGN: %d, current value of XCPU: %d\n", SIG_IGN,
                        syscall(SYS_signal, SIGXCPU, SIG_DFL));

Quote:}

% cc -o foo foo.c
% foo
value of SIG_IGN: 1, current value of XCPU: 1

Joerg

--
Private:J?rg Schilling Seestr. 110 D-13353 Berlin      (030)452 55 85


If you don't have iso-8859-1 chars my name is           J"org Schilling

 
 
 

1. LIMIT DOES REALLY NOT LIMIT

login shell? i've now tried:
  faui8s4% limit cputime 0:20
  faui8s4% limit
  cputime         0:20
  filesize        unlimited
  datasize        2097148 kbytes
  stacksize       8192 kbytes
  coredumpsize    0 kbytes
  descriptors     64
  memorysize      unlimited
  faui8s4% a.out   <---- loops indefinitely

and cputime is again not limited. now the question arises:
  1) do i really have to have /usr/bin/csh as LOGIN shell
or
  2) do i have a "wrong" /usr/bin/csh-version.
or
  3) both

   WHERE IS SUN ????? WHO WILL FIX THIS SERIOUS BUG FOR ME ?????

on my machine i'm getting exactly the same result, thnx for the test program.

faui8s4% uname -a
SunOS faui8s4 5.4 Generic_101945-23 sun4m sparc

the problem is: we've a buggy program here that runs for WWW community
but "kills" our server twice a day. do i have to install a daemon
that checks the runtime of all WWW programs and kills some when they
reach their cpulimit? this seems to be a dirty hack to me. or is anybody
out there who has a "cleaner" fix for this bug?

         thnx

           tobias

---
---------------------------------------------------------------------------
Tobias Ruland (student at Dept. of Artificial Intelligence, Univ. Erlangen)


      (Please write in ENGLISH, GERMAN or FINNISH)
WWW:  http://www8.informatik.uni-erlangen.de/~tsruland

2. 2 -> 3 files

3. setrlimit incorrectly allows hard limits to exceed soft limits

4. Calling COBOL from C/C++

5. Q: ulimit - refuses to limit cpu time, but limits other resources.

6. Moving from F50 to H70

7. Kernel Limits and RLOGIND limits

8. proxy/caching question?

9. Question of the day( <Limit> referer ...</Limit> )

10. Samba: How to limit access to 1 PC or limited timeframe?

11. File size limit and NFS export limit with Solaris 2.5

12. help!! 8 iso limit limit in redhat 7.2

13. Bandwith limit in ProFTPD - How can I disable the Limit ?