csh (20110502-7) takes too long to run.. several of prlimit64

Bug #2032859 reported by Mwahal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
csh (Ubuntu)
New
Undecided
Unassigned

Bug Description

When running csh (bsd-csh), its very slow compared to tcsh or bash.
Running strace on it pointed that its filled with several thousand (actually million) of prlimit64 calls.
Not sure if it's a bug or it's due to some limits in /etc/sysctl.conf or some user setting.
But tcsh and bash dont suffer from this slowness. It's causing heavy system usage on the scripts running under csh, doesn't happen under tcsh or bash. tTe CPU under system spikes up as high as 90% when several scripts are running.

How to reproduce..

======
strace bsd-csh --version >&e
grep -c 'prlimit64' e
1024002
=====

Vs tcsh

=====
strace tcsh --version >&e1
grep -c 'prlimit64' e1
1
=====

Vs bash

====
strace bash --version > & e2
grep -c 'prlimit64' e2
1

======

==== starts like this ====
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1000*1024, rlim_max=1000*1024}) = 0
close(0) = 0
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1000*1024, rlim_max=1000*1024}) = 0
close(1) = 0
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1000*1024, rlim_max=1000*1024}) = 0
close(2) = 0

=== And finally ends like this ====

prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1000*1024, rlim_max=1000*1024}) = 0
close(1023997) = -1 EBADF (Bad file descriptor)
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1000*1024, rlim_max=1000*1024}) = 0
close(1023998) = -1 EBADF (Bad file descriptor)
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1000*1024, rlim_max=1000*1024}) = 0
close(1023999) = -1 EBADF (Bad file descriptor)
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1000*1024, rlim_max=1000*1024}) = 0
getcwd("XXXXXX", 4096) = 27
newfstatat(AT_FDCWD, "XXXXXX", {st_mode=S_IFDIR|0755, st_size=12288, ...}, 0) = 0
=====

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.