Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've just finished an install of Ubuntu 13.04 onto a brand new PC, and noticed that executing 'ps aux' in a terminal causes it to hang half-way through displaying a list of the processes:

$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  27076  2872 ?        Ss   15:20   0:00 /sbin/init
root         2  0.0  0.0      0     0 ?        S    15:20   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    15:20   0:00 [ksoftirqd/0]
[...trimmed...]
root      1207  0.0  0.0  20972   996 tty6     Ss+  15:20   0:00 /sbin/getty -8 38400 tty6
root      1219  0.0  0.0  70428  2812 ?        Ss   15:20   0:00 /usr/sbin/cups-browsed

...and it stops there, without returning to the command prompt. Pressing Ctrl-C to try to abort the listing doesn't terminate ps, and just displays ^C in the terminal.

Curious, I ran strace on it, and found ps was blocking on a read() call while trying to fetch the command line for the anacron process:

[...trimmed...]
write(1, "root      1207  0.0  0.0  20972 "..., 91root      1207  0.0  0.0  20972   996 tty6     Ss+  15:20   0:00 /sbin/getty -8 38400 tty6
) = 91
stat("/proc/1219", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
open("/proc/1219/stat", O_RDONLY)       = 6
read(6, "1219 (cups-browsed) S 1 1219 121"..., 1023) = 193
close(6)                                = 0
open("/proc/1219/status", O_RDONLY)     = 6
read(6, "Name:\tcups-browsed\nState:\tS (sle"..., 1023) = 777
close(6)                                = 0
open("/proc/1219/cmdline", O_RDONLY)    = 6
read(6, "/usr/sbin/cups-browsed\0", 131072) = 23
read(6, "", 131049)                     = 0
close(6)                                = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=331, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=331, ...}) = 0
write(1, "root      1219  0.0  0.0  70428 "..., 88root      1219  0.0  0.0  70428  2812 ?        Ss   15:20   0:00 /usr/sbin/cups-browsed
) = 88
stat("/proc/1239", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
open("/proc/1239/stat", O_RDONLY)       = 6
read(6, "1239 (anacron) D 1 1239 1239 0 -"..., 1023) = 189
close(6)                                = 0
open("/proc/1239/status", O_RDONLY)     = 6
read(6, "Name:\tanacron\nState:\tD (disk sle"..., 1023) = 772
close(6)                                = 0
open("/proc/1239/cmdline", O_RDONLY)    = 6
read(6, 

Incidentally, trying to do this also results in a hang:

$ cat /proc/1239/cmdline 

I've found a few other posts by others which have seen this particular phenomenon, but it seems no one has found a solution yet.

http://unix.stackexchange.com/questions/10980/suggestions-needed-to-debug-why-ps-ef-gets-stuck http://serverfault.com/questions/257764/suggestions-needed-to-debug-why-ps-ef-gets-stuck

This is a nearly fresh install of Ubuntu 13.04. I just downloaded the .iso from the Ubuntu downloads page last night, installed it via USB, and have installed all of the latest updates. After the install, I added a couple of other applications (nvidia-current, VirtualBox, Audacity, Audacious, Google Chrome, and VLC), but didn't notice this issue with ps until just now.

Hardware specs: Intel i7-3930K @ 3.20GHz, 16GB RAM, Nvidia GeForce GTX 680 (304.88 drivers).

Has anyone else experienced this issue before? Is there a workaround or kernel patch available?

share|improve this question

1 Answer 1

Are you using kerberos? I had the same problem when made this change in /etc/krb5.conf...

[libdefaults]
 default_realm = MYREALM
 dns_lookup_realm = true

...to...

[libdefaults]
 default_realm = MYREALM
 dns_lookup_realm = false

I was having problems with firefox hanging, and I thought that might be the solution. Rebooting didn't fix the "ps hanging" problem, but reverting that change and rebooting did.

share|improve this answer
    
This was right after a fresh install, so AFAIK Kerberos wasn't setup, and /etc/krb5.conf doesn't even exist. There was a kernel update pushed out last Tuesday (5/14) that seems to have fixed this issue for me, for now. I'll try to post more information if it happens again. –  Falken May 23 '13 at 5:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.