How to increase soft stack limit?


 
Thread Tools Search this Thread
Operating Systems Solaris How to increase soft stack limit?
# 1  
Old 11-05-2012
How to increase soft stack limit?

SmilieDear Solaris 10 Specialists,

I am having difficulty trying to increase the soft stack limit to 16384 for user george on this Solaris 10 SunFire Sparc server as follows:

Code:
$ uname -a
SunOS galactica 5.10 Generic_141444-09 sun4v sparc SUNW,SPARC-Enterprise-T5220
% id -p                                                    
uid=25003(george) gid=25000(systems) projid=3(default)
$ ulimit -Ss
8192
$ ulimit -Hs
unlimited
$ prctl -n process.max-stack-size $$
process: 18382: ksh
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
process.max-stack-size
        basic           8.00MB      -   deny                             18382
        privileged      8.00EB      -   deny                                 -
        system          8.00EB    max   deny  
 
$ cat /etc/project
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
 
$ su
# projadd accountusers
# projmod -U george accountusers
 
$ cat /etc/project
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
accountusers:100::george::process.max-stack-size=(basic,16384,deny)
 
# id -p
uid=0(root) gid=0(root) projid=1(user.root)
# 
# csh
# newtask -v -p xtendusers csh
114291
Segmentation Fault (core dumped)
# ksh
# newtask -v -p xtendusers ksh    # only works for Korne shell
114261
# ulimit -Ss
16
# ulimit -Hs
unlimited

However, I am not able to apply the same changes (increase soft stack ulimit to
16384 for george, which will run a resource intensive in cron overnight scheduled
process) after having logged back in to the same system as george, particularly
in C shell where this program will be running in.

The output remains the same as follows:

Code:
% uname -a 
SunOS galactica 5.10 Generic_141444-09 sun4v sparc SUNW,SPARC-Enterprise-T5220  % id -p                                                    uid=25003(george) gid=25000(systems) projid=3(default)                          % prctl -n process.max-stack-size $$  
process: 22586: -csh
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
process.max-stack-size                                                                  basic           8.00MB      -   deny                             22586          privileged      8.00EB      -   deny                                 -          
 system          8.00EB    max   deny 
% ulimit -Ss
8192                           
% ulimit -Hs
unlimited

The stack limits of 8192 returned after logging back in as root.

I had to replaced process.max-file-descriptor to process.max-stack-size
in /etc/project directly since I couldn't work out how to do this from projmod.
process.max-file-descriptor was incorrectly added for xtendusers in
/etc/project initially. Not sure whether this may be reason why the change hasn't
taken affect for george.

My understanding of soft and hard limits was that the soft limit is the
maximum that the system can access by that user, and the hard limit
defines the maximum value the system can be updated to for soft limits. Is this
correct?

This resource intensive application needs the soft limit to be 16384.

Many thanks,

George
# 2  
Old 11-05-2012
Change George's shell to pfcsh. csh is not RBAC aware. It is still csh.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 11-07-2012
First we must create new user account:
Code:
root@testserver # useradd -d /export/home/george -m george
64 blocks
root@testserver # passwd george
New Password:
Re-enter new Password:
passwd: password successfully changed for george
root@testserver # tail -1 /etc/passwd
george:x:102:1::/export/home/george:/bin/sh

Now we create new project and set new value for process.max-stack-size:
Code:
root@testserver # projadd user.george
root@testserver # projmod -sK "process.max-stack-size=(basic,16384k,deny)" user.george
root@testserver # tail -1 /etc/project
user.george:101::::process.max-stack-size=(basic,16777216,deny)
root@testserver # id -p george
uid=102(george) gid=1(other) projid=101(user.test)

As you can see, I didn't use any special command to assign this project for user george. It is possible, because I use special name for project "user.george". With this method I can also assign default project for group. I just must use "group.groupname".
In your example project is assigned to user george but it is not the default project.
You can check that with command projects. You should get something like this:
Code:
# projects
default accountusers

To set accountusers as default project for user george with your method you should add the folowing line in file /etc/user_attr
Code:
george::::project=accountusers

I'm not sure what was your intention, but you set max-stack-size only to 16 kilobytes, so you get Segmentation Fault.
In my example I use 16384k notation and in /etc/project we can see 16777216.
Now we can log as george and check our configuration:
Code:
root@testserver # su - george
george@testserver # id -p
uid=102(george) gid=1(other) projid=101(user.george)
george@testserver # prctl -n process.max-stack-size $$
process: 21059: -sh
NAME    PRIVILEGE       VALUE    FLAG   ACTION                    RECIPIENT
process.max-stack-size
        basic                16,0MB      -   deny                             21059
        system          8,00EB    max   deny                                  -

I'm not sure but I think that you don't need to set up pfcsh. It is shell used when we setup RBAC but RBAC is not used in this case.
This User Gave Thanks to GP81 For This Post:
# 4  
Old 11-09-2012
Dear Jim mcnamara & GP81,

Thank you for providing detail steps to successfully increase the soft stack ulimit for user george. The important step is to ensure that the value 16777216 is set even though I got 16384k, and had to overwrite it with 16777216 by editing /etc/project to get the following:

Code:
user.george:101::::process.max-stack-size=(basic,16777216,deny)

It still puzzles me that (basic,16384,deny) worked for /usr/bin/sh & /usr/bin/ksh yet only (basic,16777216,deny) will worked for /usr/bin/csh. In other word, we don’t need /usr/bin/pfcsh but make sure that (basic,16777216,deny) is set instead.

Thank you so much for both of your help,

George

Last edited by fpmurphy; 11-09-2012 at 11:17 AM.. Reason: fonts and color tags removed
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Red Hat

Cannot set 'soft limits' for 'maximum stack size' for a standard user

Hi Guys, I'm trying to install Oracle Database on to Oracle Linux 7.6 but when the database install package checks the OS set-up, it keeps on failing on the soft limits for the stack. It's default value is 8192 but I'm trying to set it to 10240. This is what I added to... (2 Replies)
Discussion started by: ASGR
2 Replies

2. Solaris

8 character limit for ipcs command , any way to increase # of chars ?

Hello All, We have a working script which identifies and kills ipcs resources which havent been correctly killed during normal shutdowns. It is working fine and dandy however there are some issues now. Environment: SunOS 5.10 Generic_148888-03 sun4u sparc SUNW,SPARC-Enterprise ... (4 Replies)
Discussion started by: icalderus
4 Replies

3. Solaris

Limit: stacksize: Can't remove limit

Hi all, I'm using to Solaris machine. When I run a simple script this messenger come out:"limit: stacksize: Can't remove limit". Any one know the way to resolve this problem without reboot the machine? Thanks in advance. (3 Replies)
Discussion started by: Diabolist9
3 Replies

4. UNIX for Dummies Questions & Answers

Kernel Stack vs User Mode Stack

Hi, I am new to the linux kernel development area. I want to know what is the difference between kernel mode stack and user mode stack? Does each process has a user mode stack and a kernel mode stack?? Or Each process has a user mode stack and there is only one kernel mode stack that is shared by... (4 Replies)
Discussion started by: saurabhkoar
4 Replies

5. Programming

what is stack winding and stack unwinding

helo can u tell me what do you mean by stack winding and stack unwinding Regards, Amit (2 Replies)
Discussion started by: amitpansuria
2 Replies

6. AIX

chfs increase /var limit at 512mb?

Is there a limit of 512Mb when doing a "chfs -a size=XXXXX /myfs" ? I managed to increase /var to 512MB fine, no issues, then i wanted to increase /usr to 2Gb, but when i enter: # chfs -a size=2260992 /usr chfs: 0506-908 Cannot reduce size... (5 Replies)
Discussion started by: craigp84
5 Replies

7. UNIX for Dummies Questions & Answers

soft rebooting

When I do a hard reboot, the system recognizes both the ttya and the ttyb, but when I do a hard reboot, it only doesn't recognize the ttyb. Is there a way I can fix this??? Thanks!:confused: (5 Replies)
Discussion started by: nattie_h
5 Replies

8. Programming

How to increase the size of the stack

Hi!!, could someone tell me how to increase the stack size in HP-UX? Thanx (7 Replies)
Discussion started by: jyotipg
7 Replies
Login or Register to Ask a Question