Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* The stack and digital unix binaries
@ 1999-06-29 18:20 Neil Carlson
  1999-06-29 19:26 ` Greg Lindahl
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Carlson @ 1999-06-29 18:20 UTC (permalink / raw)
  To: axp-list

I have a large simulation code which I compile under digital unix
and then move the executable to an alpha/linux machine to run.
I frequently exceed the stack size, whose hard limit is hardcoded
to 8MB in include/linux/sched.h (look for _STK_LIM).  The comments
written there suggest that this ought to be adequate.  Perhaps, but
it depends on how it's used -- do the digital compilers use the stack
differently than gcc under linux would?
------------------------------------------------------------------------
Neil N. Carlson                      nnc@lanl.gov (work)
Theoretical Division                 nnc@roadrunner.com (non-work)
Group T-1, Mailstop B221
Los Alamos National Laboratory	     505-665-1220 (voice)
Los Alamos, NM 87545		     505-665-5757 (fax)


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

* Re: The stack and digital unix binaries
  1999-06-29 18:20 The stack and digital unix binaries Neil Carlson
@ 1999-06-29 19:26 ` Greg Lindahl
  1999-06-29 22:46   ` Neil Carlson
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Lindahl @ 1999-06-29 19:26 UTC (permalink / raw)
  To: axp-list

> I have a large simulation code which I compile under digital unix
> and then move the executable to an alpha/linux machine to run.
> I frequently exceed the stack size, whose hard limit is hardcoded
> to 8MB in include/linux/sched.h (look for _STK_LIM).  The comments
> written there suggest that this ought to be adequate.  Perhaps, but
> it depends on how it's used -- do the digital compilers use the stack
> differently than gcc under linux would?

You can increase your stack using the ulimit command.

Try:

ulimit -a
ulimit -Ha
ulimit -s new-size

If you don't like the hard limit, then you can raise it by editing
/etc/security/limits.conf (may be a RedHat-only hack, I dunno.)

Alternately, you can tell Compaq Fortran to use static variable
allocation. Most fortran compilers (like Compaq fortran and g77) allow
you to pick stack or static.

-- g


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

* Re: The stack and digital unix binaries
  1999-06-29 19:26 ` Greg Lindahl
@ 1999-06-29 22:46   ` Neil Carlson
  1999-06-30  2:52     ` Greg Lindahl
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Carlson @ 1999-06-29 22:46 UTC (permalink / raw)
  To: axp-list

Greg Lindahl wrote:
> 
> <stuff about the stack size limit>
>
> If you don't like the hard limit, then you can raise it by editing
> /etc/security/limits.conf (may be a RedHat-only hack, I dunno.)

I don't know what this does on your system but on my RH 5.2 systems
it doesn't do squat.  This file is part of pam, and looks to me to
be a placeholder for some future functionality.

Is it possible to cat a value to some special file in /proc to 
change the limit dynamically?  (I'm running 2.2.x)  Otherwise I'll
have to resort to editing the kernel source.

-Neil
------------------------------------------------------------------------
Neil N. Carlson                      nnc@lanl.gov (work)
Theoretical Division                 nnc@roadrunner.com (non-work)
Group T-1, Mailstop B221
Los Alamos National Laboratory	     505-665-1220 (voice)
Los Alamos, NM 87545		     505-665-5757 (fax)


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

* Re: The stack and digital unix binaries
  1999-06-29 22:46   ` Neil Carlson
@ 1999-06-30  2:52     ` Greg Lindahl
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Lindahl @ 1999-06-30  2:52 UTC (permalink / raw)
  To: axp-list

> > If you don't like the hard limit, then you can raise it by editing
> > /etc/security/limits.conf (may be a RedHat-only hack, I dunno.)
> 
> I don't know what this does on your system but on my RH 5.2 systems
> it doesn't do squat.  This file is part of pam, and looks to me to
> be a placeholder for some future functionality.

Me and my big mouth.

I recompiled my kernels to up it. Then I poked around and had never
tried /etc/security/limits.conf

The following hack does work; I found out about it after I recompiled.

> Log in as root and edit a file called /etc/initscript.  On my machine
> this
> script did not already exist.  In it put the following lines:
> #
> ulimit -Hs unlimited
> ulimit -Ss unlimited
> 
> eval exec "$4"
> 
> Then issue "chmod +x /etc/initscript" and reboot the machine.  Logging
> in
> either as root or an unpriviledged [sic] user should result in
> effectively
> unlimited stack memory (on the order of 2 GB).


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

end of thread, other threads:[~1999-07-08 22:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-06-29 18:20 The stack and digital unix binaries Neil Carlson
1999-06-29 19:26 ` Greg Lindahl
1999-06-29 22:46   ` Neil Carlson
1999-06-30  2:52     ` Greg Lindahl

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