Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* stacksize limit
@ 2000-03-29  5:00 Mikael Borg
  2000-04-06  4:00 ` Johannes Nix
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Borg @ 2000-03-29  5:00 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

I am using some software that requires larger stack size
than the default (8Mb). To avoid running my calculations as
root, I figured I could raise the hard limit in
/etc/security/limits.conf. However, I am still not permitted
to set 'ulimit -s 32768' as user. Is there some service that
have to be kill -HUP'ed? Or is there some other way to
change the stack limit?

Mikael Borg

[-- Attachment #2: Card for Mikael Borg --]
[-- Type: text/x-vcard, Size: 233 bytes --]

begin:vcard 
n:Borg;Mikael
tel;work:+46-46-222 01 84
x-mozilla-html:FALSE
org:Lund University;Dept of Synchrotron radiation
adr:;;;;;;
version:2.1
email;internet:mikael.borg@sljus.lu.se
x-mozilla-cpt:;-15520
fn:Mikael Borg
end:vcard

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

* Re: stacksize limit
  2000-03-29  5:00 stacksize limit Mikael Borg
@ 2000-04-06  4:00 ` Johannes Nix
  2000-04-06  4:00   ` Michal Jaegermann
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Nix @ 2000-04-06  4:00 UTC (permalink / raw)


Mikael Borg <mikael.borg@sljus.lu.se> writes:

> I am using some software that requires larger stack size
> than the default (8Mb). To avoid running my calculations as
> root, I figured I could raise the hard limit in
> /etc/security/limits.conf. However, I am still not permitted
> to set 'ulimit -s 32768' as user. Is there some service that
> have to be kill -HUP'ed? Or is there some other way to
> change the stack limit?
> 

Many thanks for the hint. I run into the same problem last night,
XEmacs crashed constantly when parsing a certain BibTeX file. I had to
increase the stack size limit from 8 MB to 32MB, then it doesn't
crashes any more. In the case of XEmacs it seems to be related that
the regexp matcher uses alloca() to allocate memory on the stack, a
similar error was corrected for DEC OSF/1. (But the cause is not
confirmed yet).

It seems to be necessary to edit /etc/security/limits.conf, and also
remove possible limits imposed by the shell, as in /etc/profile .

Then it works with local logins. 


The whole thing is not documented and nobody but the enligthed kernel
hackers seem to know what all this limits do mean really. Perhaps some
of them could give me a hint what:


data seg size (kbytes)      unlimited
max memory size (kbytes)    unlimited
virtual memory (kbytes)     unlimited
pipe size (512 bytes)       8

does really mean. For example I got the impression that "max memory
size" (aka RSS size) is ignored completely. Maybe that "virtual
memory" is the sum of "data seg size" and "stack size", and that "max
memory" is the physical memory which should be smaller than "virtual
memory", and that "locked memory" cannot be more than "physical
memory" - but who knows. At least if I start xemacs with 10kB of "max
memory size" it runs happily and allocates 15 MB.

With remote logins using ssh I need to edit the sshd startup script,
that means in the SuSE case /etc/rc.d/sshd, and insert an

ulimit -s 32000

then it works. I think it's because it is not a child of login() but
started by an init script which is child from init.  Maybe that only
login reads the limits in limits.conf ?

Also, batch jobs still are unaffected. It seems to be necessary to
de-limit the atd startup script also if needed.

There is also a file /etc/initscript, it has a manpage - be careful
when creating it, if you make errors and don't have a root shell open
you won't be able to log in again!

As far as I understand, initscript is only able to set limits for
console login processes, so there wouldn't be any advantages compared
to editing limits.conf.


Johannes



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

* Re: stacksize limit
  2000-04-06  4:00 ` Johannes Nix
@ 2000-04-06  4:00   ` Michal Jaegermann
  2000-04-06  4:00     ` Johannes Nix
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Jaegermann @ 2000-04-06  4:00 UTC (permalink / raw)


Johannes Nix (Johannes.Nix@mail.uni-oldenburg.de) wrote:

: It seems to be necessary to edit /etc/security/limits.conf, and also
: remove possible limits imposed by the shell, as in /etc/profile .

: Then it works with local logins. 


: The whole thing is not documented and nobody but the enligthed kernel
: hackers seem to know what all this limits do mean really.

Er, no!  The whole thing is documented and rather well.  Maybe only not
in the most obvious place if you do not know where to look. :-)

Check section 6.11, "The resource limits module", in your PAM
documentation.  Most likely in /usr/doc/pam-... on your disk.
Few different formats of this document are available.

If your system is using PAM then whatever has to do with logins should
be checked with PAM documentation first.

   Michal



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

* Re: stacksize limit
  2000-04-06  4:00   ` Michal Jaegermann
@ 2000-04-06  4:00     ` Johannes Nix
  2000-04-07  4:00       ` Michal Jaegermann
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Nix @ 2000-04-06  4:00 UTC (permalink / raw)


michal@gortel.phys.ualberta.ca (Michal Jaegermann) writes:

> 
> Check section 6.11, "The resource limits module", in your PAM
> documentation.  Most likely in /usr/doc/pam-... on your disk.
> Few different formats of this document are available.
> 
> If your system is using PAM then whatever has to do with logins should
> be checked with PAM documentation first.
> 


You are right. What I still don't understand is that it didn't seem to
work with ssh altough there is a 

/etc/pam.d/ssh 
#%PAM-1.0
auth     required       /lib/security/pam_unix.so       # set_secrpc
auth     required       /lib/security/pam_nologin.so
auth     required       /lib/security/pam_env.so
account  required       /lib/security/pam_unix.so
password required       /lib/security/pam_unix.so       # strict=false
session  required       /lib/security/pam_unix.so       none # trace or debug
session  required       /lib/security/pam_limits.so

which should work if I understand the whole thing well. Also, I am
wondering why atd and crond don't use PAM, anybody could create a
memory-hungry cron job and try crash the system.

The last thing which I don't understand is that to lock memory using
memlockall() in every case I need root privileges even is the limit is
"unlimited" , so what the "max locked memory limit" is about ? (Would
be practical to know for me because I work with real-time
applications)?


Johannes







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

* Re: stacksize limit
  2000-04-06  4:00     ` Johannes Nix
@ 2000-04-07  4:00       ` Michal Jaegermann
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Jaegermann @ 2000-04-07  4:00 UTC (permalink / raw)


Johannes Nix (Johannes.Nix@mail.uni-oldenburg.de) wrote:
: michal@gortel.phys.ualberta.ca (Michal Jaegermann) writes:
: >
: > Check section 6.11, "The resource limits module", in your PAM
: > documentation.

: You are right. What I still don't understand is that it didn't seem to
: work with ssh altough there is a

: /etc/pam.d/ssh
....
: session  required       /lib/security/pam_limits.so

: which should work if I understand the whole thing well.

I am afraid that I do not know much more than documentation says.
Maybe there are some bugs somewhere?  There for sure were bugs
in PAM libraries which came with RH 6.0 distribution.  Also which
ssh is that. 'openssh'?  It is supposed to work correctly with PAM
but maybe something was forgotten.  As usual sources are available
to check that out.

: Also, I am
: wondering why atd and crond don't use PAM, anybody could create a
: memory-hungry cron job and try crash the system.

If you worried about that you would have to run cron and at jobs
via a wrapper which does '#!/bin/sh -login'.  This is an untested guess
but this is a login shell which sets limts.

: The last thing which I don't understand is that to lock memory using
: memlockall() in every case I need root privileges even is the limit is
: "unlimited" , so what the "max locked memory limit" is about ?

No idea.

Bug report time?

  Michal




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

end of thread, other threads:[~2000-04-07  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-29  5:00 stacksize limit Mikael Borg
2000-04-06  4:00 ` Johannes Nix
2000-04-06  4:00   ` Michal Jaegermann
2000-04-06  4:00     ` Johannes Nix
2000-04-07  4:00       ` Michal Jaegermann

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