Results 1 to 7 of 7

Thread: 'ps u' hangs: reason/cause?

  1. #1

    Default 'ps u' hangs: reason/cause?

    Hi Gurus,
    I will appreciate any tips to work out what is happening in the following....

    I noticed that Yast won't start from the desktop. In trying to work out what was running I discovered that 'ps u' in fact 'hangs'. Specifically
    Code:
    # ps u
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root      3235  1.0  2.9  67480 61452 tty7     RLs+ Nov25  36:31 /usr/bin/Xorg -br -nolisten tcp :0 vt7 -aut
    root      3889  0.0  0.0   2152   652 tty1     Ss+  Nov25   0:00 /sbin/mingetty --noclear tty1
    root      3891  0.0  0.0   2152   652 tty2     Ss+  Nov25   0:00 /sbin/mingetty tty2
    root      3893  0.0  0.0   2152   632 tty3     Ss+  Nov25   0:00 /sbin/mingetty tty3
    root      3895  0.0  0.0   2152   632 tty4     Ss+  Nov25   0:00 /sbin/mingetty tty4
    root      3902  0.0  0.0   2152   628 tty5     Ss+  Nov25   0:00 /sbin/mingetty tty5
    root      3904  0.0  0.0   2152   632 tty6     Ss+  Nov25   0:00 /sbin/mingetty tty6
    Then I have to hit CTL+c
    However, the following commands do not hang:
    Code:
    ps ax
    ps x
    ps a
    But these commands do hang if I add 'u' to any of the options/switches

    I appreciate any tips/suggestions on how to work out what might be going wrong.

    Cheers
    Mark

  2. #2

    Default Re: 'ps u' hangs: reason/cause?

    adding some detail suggestsed elsewhere...
    Code:
    strace ps u
    
    <snip>
    ......
    </snip>
    
    socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 7
    setsockopt(7, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
    setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0
    fcntl64(7, F_GETFL)                     = 0x2 (flags O_RDWR)
    fcntl64(7, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
    connect(7, {sa_family=AF_INET, sin_port=htons(389), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in progress)
    poll([{fd=7, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 30000) = 1
    getpeername(7, {sa_family=AF_INET, sin_port=htons(389), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
    fcntl64(7, F_GETFL)                     = 0x802 (flags O_RDWR|O_NONBLOCK)
    fcntl64(7, F_SETFL, O_RDWR)             = 0
    time(NULL)                              = 1227780032
    time(NULL)                              = 1227780032
    write(7, "0\f\2\1\1`\7\2\1\3\4\0\200\0", 14) = 14
    gettimeofday({1227780032, 318107}, NULL) = 0
    poll([{fd=7, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 30000) = 0
    write(7, "0\6\2\1\2P\1\1", 8)           = 8
    time(NULL)                              = 1227780062
    time(NULL)                              = 1227780062
    stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2183, ...}) = 0
    socket(PF_FILE, SOCK_DGRAM, 0)          = 8
    fcntl64(8, F_SETFD, FD_CLOEXEC)         = 0
    connect(8, {sa_family=AF_FILE, path="/dev/log"}, 110) = 0
    send(8, "<14>Nov 27 21:01:02 ps: nss_ldap"..., 107, MSG_NOSIGNAL
    Not sure if that gives a clue?

  3. #3
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: 'ps u' hangs: reason/cause?

    Are you using LDAP to resolve user accounts?

  4. #4

    Default Re: 'ps u' hangs: reason/cause?

    Yes I am, the ldap server is running on this laptop - which is also a client. I am using ldap for some VM testing...

    Mark

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: 'ps u' hangs: reason/cause?

    Looks like LDAP is blocking on the lookup.

  6. #6

    Default Re: 'ps u' hangs: reason/cause?

    Hmm, this is wierd....
    Code:
    service ldap restart
    runs fine.
    I went to check /var/log/messages and discovered it also hangs without printing any output.

    Using strace the tail looks like:

    Code:
    strace tail -f /var/log/messages
    
    execve("/usr/bin/tail", ["tail", "-f", "/var/log/messages"], [/* 62 vars */]) = 0
    brk(0)                                  = 0x8054000
    access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
    open("/etc/ld.so.cache", O_RDONLY)      = 3
    fstat64(3, {st_mode=S_IFREG|0644, st_size=158225, ...}) = 0
    mmap2(NULL, 158225, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb806b000
    close(3)                                = 0
    open("/lib/libc.so.6", O_RDONLY)        = 3
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0Pg\1\0004\0\0\0"..., 512) = 512
    fstat64(3, {st_mode=S_IFREG|0755, st_size=1410320, ...}) = 0
    mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb806a000
    mmap2(NULL, 1320528, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f27000
    fadvise64(3, 0, 1320528, POSIX_FADV_WILLNEED) = 0
    mmap2(0xb8064000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13d) = 0xb8064000
    mmap2(0xb8067000, 9808, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb8067000
    close(3)                                = 0
    mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f26000
    set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f266c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
    open("/dev/urandom", O_RDONLY)          = 3
    read(3, "\265\253s\5", 4)               = 4
    close(3)                                = 0
    mprotect(0xb8064000, 8192, PROT_READ)   = 0
    mprotect(0x8052000, 4096, PROT_READ)    = 0
    mprotect(0xb80ad000, 4096, PROT_READ)   = 0
    munmap(0xb806b000, 158225)              = 0
    brk(0)                                  = 0x8054000
    brk(0x8075000)                          = 0x8075000
    open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
    open("/usr/share/locale/locale.alias", O_RDONLY) = 3
    fstat64(3, {st_mode=S_IFREG|0644, st_size=2512, ...}) = 0
    mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb8091000
    read(3, "# Locale name alias data base.\n#"..., 4096) = 2512
    read(3, "", 4096)                       = 0
    close(3)                                = 0
    munmap(0xb8091000, 4096)                = 0
    open("/usr/lib/locale/en_US.UTF-8/LC_CTYPE", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/locale/en_US.utf8/LC_CTYPE", O_RDONLY) = 3
    fstat64(3, {st_mode=S_IFREG|0644, st_size=254076, ...}) = 0
    mmap2(NULL, 254076, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7ee7000
    close(3)                                = 0
    open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3
    fstat64(3, {st_mode=S_IFREG|0644, st_size=26040, ...}) = 0
    mmap2(NULL, 26040, PROT_READ, MAP_SHARED, 3, 0) = 0xb808b000
    close(3)                                = 0
    open("/var/log/messages", O_RDONLY|O_LARGEFILE) = 3
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    _llseek(3, 0, [0], SEEK_CUR)            = 0
    _llseek(3, 0, [0], SEEK_END)            = 0
    _llseek(3, 0, [0], SEEK_SET)            = 0
    read(3, "", 8192)                       = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    fcntl64(3, F_GETFL)                     = 0x8000 (flags O_RDONLY|O_LARGEFILE)
    fcntl64(3, F_SETFL, O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    nanosleep({1, 0}, NULL)                 = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    nanosleep({1, 0}, NULL)                 = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    nanosleep({1, 0}, NULL)                 = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    nanosleep({1, 0}, NULL)                 = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    nanosleep({1, 0}, NULL)                 = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    nanosleep({1, 0}, NULL)                 = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    nanosleep({1, 0}, NULL)                 = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    nanosleep({1, 0}, NULL)                 = 0
    fstat64(3, {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
    nanosleep({1, 0}, ^C <unfinished ...>
    Any ideas?

    Mark

  7. #7
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: 'ps u' hangs: reason/cause?

    Why not turn off LDAP lookup to see if it unblocks things? Then you will know for sure if it's LDAP.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •