2

I'm getting a segmentation fault when I try to run a simple "ps aux" for a certain user. If I run as root or another user it runs well. So I think is something related with ulimits, but I think that those parameters are enough:

bash-4.1$ ulimit -aS
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 128516
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 16384
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 256
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16384
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

bash-4.1$ ps aux
Segmentation fault (core dumped)

I also tried to run with strace but I don't see anything:

bash-4.1$ strace -f -F -v -s 8192 ps aux
...
uname({sysname="Linux", nodename="node1", release="2.6.39-400.215.10.el6uek.x86_64", version="#1 SMP Wed Sep 10 00:07:12 PDT 2014", machine="x86_64"}) = 0
open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 3
read(3, "0-3\n", 8192)                  = 4
close(3)                                = 0
statfs("/selinux", {f_type=0xf97cff8c, f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
brk(0)                                  = 0x1daa000
brk(0x1dcb000)                          = 0x1dcb000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_dev=makedev(252, 0), st_ino=408478, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=193600, st_size=99158576, st_atime=2015/05/03-16:54:32, st_mtime=2014/09/03-11:14:03, st_ctime=2014/09/03-11:14:03}) = 0
mmap(NULL, 99158576, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8d56d55000
...
rt_sigaction(SIGTRAP, {0x401ed0, ~[RTMIN RT_1], SA_RESTORER, 0x37ad8326b0}, NULL, 8) = 0
rt_sigaction(SIGILL, {0x401ed0, ~[RTMIN RT_1], SA_RESTORER,     0x37ad8326b0}, NULL, 8) = 0
rt_sigaction(SIGHUP, {0x401ed0, ~[RTMIN RT_1], SA_RESTORER, 0x37ad8326b0}, NULL, 8) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

Thanks in advance!

Sacx
  • 2,541
  • 15
  • 13
julian
  • 153
  • 7

1 Answers1

4

Try to increment the user stack size, the default on my Linux workstation is:

stack size              (kbytes, -s) 8192
kasperd
  • 29,894
  • 16
  • 72
  • 122
c4f4t0r
  • 5,149
  • 3
  • 28
  • 41
  • ok, I think you're right. I created a new user and it has the 8192 as stack size. The ps runs OK then when I change it to 256 I got the segmentation fault. Now I've to find where is configured the 256 limit for that user because the file /etc/security/limits.conf is with default values. – julian May 04 '15 at 12:19
  • Nice, set it in limits.conf for the concerned user then and restart, it should work. – Nabil Bourenane May 04 '15 at 13:09
  • some consultant set up "ulimit -s 256" on the .bash_profile and didn't noticed us :-( – julian May 04 '15 at 14:50