beaugunderson / ps-screen

💻 list screen and tmux sessions and what's running inside them
3 stars 0 forks source link

no output on OS X 10.8.4 #2

Open evilchili opened 9 years ago

evilchili commented 9 years ago

ps-screen installs on OS X 10.8.4, but yields no output. Here is the install log, including the dependencies, should they be relevant:

spengler:greg Mon Nov 17 12:05:48 PST
!509 ~ sudo pip install ps-screen
Downloading/unpacking ps-screen
  Downloading ps-screen-1.0.2.tar.gz
  Running setup.py egg_info for package ps-screen

Downloading/unpacking click>=3.3 (from ps-screen)
  Downloading click-3.3.tar.gz (259kB): 259kB downloaded
  Running setup.py egg_info for package click

    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'examples'
    warning: no previously-included files matching '*.pyo' found under directory 'examples'
    no previously-included directories found matching 'docs/_build'
Downloading/unpacking psutil>=2.1.3 (from ps-screen)
  Downloading psutil-2.1.3.tar.gz (224kB): 224kB downloaded
  Running setup.py egg_info for package psutil

    warning: no previously-included files matching '*' found under directory 'docs/_build'
Downloading/unpacking tabulate>=0.7.3 (from ps-screen)
  Downloading tabulate-0.7.3.tar.gz
  Running setup.py egg_info for package tabulate

Installing collected packages: ps-screen, click, psutil, tabulate
  Running setup.py install for ps-screen

    Installing ps-screen script to /usr/local/bin
  Running setup.py install for click

    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'examples'
    warning: no previously-included files matching '*.pyo' found under directory 'examples'
    no previously-included directories found matching 'docs/_build'
  Running setup.py install for psutil
    building '_psutil_osx' extension
    clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_osx.c -o build/temp.macosx-10.8-intel-2.7/psutil/_psutil_osx.o
    clang: warning: argument unused during compilation: '-mno-fused-madd'
    psutil/_psutil_osx.c:341:48: warning: format specifies type 'unsigned long' but the argument has type 'vm_address_t' (aka 'unsigned int') [-Wformat]
                sprintf(addr_str, "%016lx-%016lx", address, address + size);
                                   ~~~~~~          ^~~~~~~
                                   %016x
    /usr/include/secure/_stdio.h:49:56: note: expanded from macro 'sprintf'
      __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                           ^
    psutil/_psutil_osx.c:341:57: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat]
                sprintf(addr_str, "%016lx-%016lx", address, address + size);
                                          ~~~~~~            ^~~~~~~~~~~~~~
                                          %016x
    /usr/include/secure/_stdio.h:49:56: note: expanded from macro 'sprintf'
      __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                           ^
    2 warnings generated.
    psutil/_psutil_osx.c:126:31: warning: implicit conversion loses integer precision: 'long' to 'pid_t' (aka 'int') [-Wshorten-64-to-32]
        if (psutil_get_kinfo_proc(pid, &kp) == -1) {
            ~~~~~~~~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:168:24: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        ret = proc_pidpath(pid, &buf, sizeof(buf));
              ~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:211:31: warning: implicit conversion loses integer precision: 'long' to 'pid_t' (aka 'int') [-Wshorten-64-to-32]
        if (psutil_get_kinfo_proc(pid, &kp) == -1) {
            ~~~~~~~~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:229:31: warning: implicit conversion loses integer precision: 'long' to 'pid_t' (aka 'int') [-Wshorten-64-to-32]
        if (psutil_get_kinfo_proc(pid, &kp) == -1) {
            ~~~~~~~~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:250:31: warning: implicit conversion loses integer precision: 'long' to 'pid_t' (aka 'int') [-Wshorten-64-to-32]
        if (psutil_get_kinfo_proc(pid, &kp) == -1) {
            ~~~~~~~~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:271:31: warning: implicit conversion loses integer precision: 'long' to 'pid_t' (aka 'int') [-Wshorten-64-to-32]
        if (psutil_get_kinfo_proc(pid, &kp) == -1) {
            ~~~~~~~~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:306:42: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        err = task_for_pid(mach_task_self(), pid, &task);
              ~~~~~~~~~~~~                   ^~~
    psutil/_psutil_osx.c:350:39: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                err = proc_regionfilename(pid, address, buf, sizeof(buf));
                      ~~~~~~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:502:31: warning: implicit conversion loses integer precision: 'long' to 'pid_t' (aka 'int') [-Wshorten-64-to-32]
        if (psutil_get_kinfo_proc(pid, &kp) == -1) {
            ~~~~~~~~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:808:25: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        num = getfsstat(fs, len, MNT_NOWAIT);
              ~~~~~~~~~     ^~~
    psutil/_psutil_osx.c:906:31: warning: implicit conversion loses integer precision: 'long' to 'pid_t' (aka 'int') [-Wshorten-64-to-32]
        if (psutil_get_kinfo_proc(pid, &kp) == -1) {
            ~~~~~~~~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:942:42: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        err = task_for_pid(mach_task_self(), pid, &task);
              ~~~~~~~~~~~~                   ^~~
    psutil/_psutil_osx.c:1055:35: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        pidinfo_result = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, NULL, 0);
                         ~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:1068:35: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        pidinfo_result = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, fds_pointer,
                         ~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:1085:33: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                nb = proc_pidfdinfo(pid,
                     ~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:1191:35: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        pidinfo_result = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, NULL, 0);
                         ~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:1201:35: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        pidinfo_result = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, fds_pointer,
                         ~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:1219:33: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                nb = proc_pidfdinfo(pid, fdp_pointer->proc_fd,
                     ~~~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:1393:35: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        pidinfo_result = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, NULL, 0);
                         ~~~~~~~~~~~~ ^~~
    psutil/_psutil_osx.c:1402:35: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        pidinfo_result = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, fds_pointer,
                         ~~~~~~~~~~~~ ^~~
    20 warnings generated.
    clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_common.c -o build/temp.macosx-10.8-intel-2.7/psutil/_psutil_common.o
    clang: warning: argument unused during compilation: '-mno-fused-madd'
    clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/arch/osx/process_info.c -o build/temp.macosx-10.8-intel-2.7/psutil/arch/osx/process_info.o
    clang: warning: argument unused during compilation: '-mno-fused-madd'
    psutil/arch/osx/process_info.c:40:21: warning: implicit conversion loses integer precision: 'long' to 'pid_t' (aka 'int') [-Wshorten-64-to-32]
        kill_ret = kill(pid , 0);
                   ~~~~ ^~~
    psutil/arch/osx/process_info.c:176:14: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        mib[2] = pid;
               ~ ^~~
    psutil/arch/osx/process_info.c:194:11: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        len = strlen(arg_ptr);
            ~ ^~~~~~~~~~~~~~~
    3 warnings generated.
    clang -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch x86_64 build/temp.macosx-10.8-intel-2.7/psutil/_psutil_osx.o build/temp.macosx-10.8-intel-2.7/psutil/_psutil_common.o build/temp.macosx-10.8-intel-2.7/psutil/arch/osx/process_info.o -o build/lib.macosx-10.8-intel-2.7/_psutil_osx.so -framework CoreFoundation -framework IOKit
    building '_psutil_posix' extension
    clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_posix.c -o build/temp.macosx-10.8-intel-2.7/psutil/_psutil_posix.o
    clang: warning: argument unused during compilation: '-mno-fused-madd'
    psutil/_psutil_posix.c:29:42: warning: implicit conversion loses integer precision: 'long' to 'id_t' (aka 'unsigned int') [-Wshorten-64-to-32]
        priority = getpriority(PRIO_PROCESS, pid);
                   ~~~~~~~~~~~               ^~~
    psutil/_psutil_posix.c:49:40: warning: implicit conversion loses integer precision: 'long' to 'id_t' (aka 'unsigned int') [-Wshorten-64-to-32]
        retval = setpriority(PRIO_PROCESS, pid, priority);
                 ~~~~~~~~~~~               ^~~
    2 warnings generated.
    clang -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch x86_64 build/temp.macosx-10.8-intel-2.7/psutil/_psutil_posix.o -o build/lib.macosx-10.8-intel-2.7/_psutil_posix.so

    warning: no previously-included files matching '*' found under directory 'docs/_build'
  Running setup.py install for tabulate

Successfully installed ps-screen click psutil tabulate
Cleaning up...

And here's the bug:

spengler:greg Mon Nov 17 12:06:01 PST
!510 ~ ps-screen
spengler:greg Mon Nov 17 12:06:10 PST
!511 ~ screen -ls
There are screens on:
    41919.evilchili29627    (Attached)
    61154.solus (Detached)
2 Sockets in /var/folders/0d/hjp8x_sj0nbbpt3zcrypv0_r0000hb/T/.screen.

System/python info:

spengler:greg Mon Nov 17 12:08:41 PST
!514 ~ uname -a && python --version
Darwin spengler.ba.imgtec.org 12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
Python 2.7.2

This is an older box, so I would seek confirmation before worrying too hard about it.

beaugunderson commented 9 years ago

What's the output of: ps awux?

Do you mind running this command and emailing me the resulting ps.pickle and metadata.pickle files?

#!/usr/bin/env python

import pickle
import psutil

ps = list(psutil.process_iter())

metadata = []

for p in ps:
    m = [p.name()]

    try:
        m.append(p.cmdline())
    except psutil.AccessDenied:
        pass

    metadata.append(m)

ps_pickle = open('ps.pickle', 'wb')
metadata_pickle = open('metadata.pickle', 'wb')

pickle.dump(ps, ps_pickle, -1)
pickle.dump(metadata, metadata_pickle, -1)
beaugunderson commented 9 years ago

(Updated the above script to use binary mode, oops)

evilchili commented 9 years ago

sent!

beaugunderson commented 9 years ago

Ah, looks like that machine's screen binary is actually named screen-4.0.3. Easy to add support for binaries that start with screen-. :)

beaugunderson commented 9 years ago

Or, maybe for screen the correct way is to look at the socket directory... Maybe the right way for tmux too, come to think of it. Will investigate that further as it seems less fragile.