nikademus79 / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

RuntimeError: line not found on arm #188

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. install psutil on arm board
2. import psutil

What is the expected output? What do you see instead?

I expected no error instead I have:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/psutil-0.3.0-py2.6-linux-armv7l.egg/psutil/__init__.py", line 52, in <module>
    import psutil._pslinux as _psplatform
  File "/usr/lib/python2.6/site-packages/psutil-0.3.0-py2.6-linux-armv7l.egg/psutil/_pslinux.py", line 55, in <module>
    NUM_CPUS = _get_num_cpus()
  File "/usr/lib/python2.6/site-packages/psutil-0.3.0-py2.6-linux-armv7l.egg/psutil/_pslinux.py", line 45, in _get_num_cpus
    raise RuntimeError("line not found")
RuntimeError: line not found

What version of psutil are you using? What Python version?

psutil 0.3.0

On what operating system? Is it 32bit or 64bit version?

arm cortex a8 

Please provide any additional information below.

the output of /proc/cpuinfo is the following:

Processor   : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 491.57
Features    : swp half thumb fastmult vfp edsp thumbee neon 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x1
CPU part    : 0xc08
CPU revision    : 3

so is enough to change "processor" in "Processor" in 
/usr/lib/python2.6/site-packages/psutil-0.3.0-py2.6-linux
-armv7l.egg/psutil/_pslinux.py line _get_num_cpus() can you please use:

if line.startswith('processor') or line.startswith('Processor')

thanks

Original issue reported on code.google.com by drakkan1...@gmail.com on 19 Jul 2011 at 12:36

GoogleCodeExporter commented 8 years ago
Mmm... this is unfortunate because starting from now I'm no longer trusting 
/proc fs. =)
Could you please try to run the test suite and tell me if there is any failure?

Original comment by g.rodola on 19 Jul 2011 at 1:56

GoogleCodeExporter commented 8 years ago
here is the output from the test suite:

test_BOOT_TIME (__main__.TestCase) ... ok
test_Popen (__main__.TestCase) ... ok
test_TOTAL_PHYMEM (__main__.TestCase) ... ok
test__str__ (__main__.TestCase) ... ok
test_cmdline (__main__.TestCase) ... ok
test_connection_fromfd (__main__.TestCase) ... ERROR
test_cpu_percent (__main__.TestCase) ... ok
test_cpu_times (__main__.TestCase) ... ok
test_cpu_times2 (__main__.TestCase) ... ok
test_create_time (__main__.TestCase) ... ok
test_deprecated_memory_functions (__main__.TestCase) ... ok
test_disk_partitions (__main__.TestCase) ... FAIL
test_disk_usage (__main__.TestCase) ... ok
test_eq (__main__.TestCase) ... ok
test_exe (__main__.TestCase) ... ok
test_fetch_all (__main__.TestCase) ... ok
test_get_children (__main__.TestCase) ... ok
test_get_connections (__main__.TestCase) ... ERROR
test_get_connections_all (__main__.TestCase) ... ok
test_get_io_counters (__main__.TestCase) ... FAIL
test_get_memory_info (__main__.TestCase) ... ok
test_get_memory_percent (__main__.TestCase) ... ok
test_get_num_threads (__main__.TestCase) ... ok
test_get_open_files (__main__.TestCase) ... ok
test_get_open_files2 (__main__.TestCase) ... ok
test_get_pid_list (__main__.TestCase) ... ok
test_get_process_list (__main__.TestCase) ... ok
test_get_set_ionice (__main__.TestCase) ... ok
test_get_threads (__main__.TestCase) ... ok
test_getcwd (__main__.TestCase) ... ok
test_getcwd_2 (__main__.TestCase) ... FAIL
test_gids (__main__.TestCase) ... ok
test_invalid_pid (__main__.TestCase) ... ok
test_is_running (__main__.TestCase) ... ok
test_kill (__main__.TestCase) ... ok
test_name (__main__.TestCase) ... ok
test_nice (__main__.TestCase) ... ok
test_parent_ppid (__main__.TestCase) ... ok
test_phymem_buffers (__main__.TestCase) ... ok
test_phymem_usage (__main__.TestCase) ... ok
test_pid (__main__.TestCase) ... ok
test_pid_0 (__main__.TestCase) ... ok
test_pid_exists (__main__.TestCase) ... ok
test_pid_exists_2 (__main__.TestCase) ... ok
test_process_iter (__main__.TestCase) ... ok
test_send_signal (__main__.TestCase) ... ok
test_status (__main__.TestCase) ... ok
test_suspend_resume (__main__.TestCase) ... ok
test_sys_cpu_percent (__main__.TestCase) ... ok
test_sys_cpu_percent_compare (__main__.TestCase) ... FAIL
test_sys_cpu_times (__main__.TestCase) ... ok
test_sys_cpu_times2 (__main__.TestCase) ... ok
test_sys_per_cpu_percent (__main__.TestCase) ... ok
test_sys_per_cpu_times (__main__.TestCase) ... ok
test_sys_per_cpu_times2 (__main__.TestCase) ... ok
test_terminal (__main__.TestCase) ... ok
test_terminate (__main__.TestCase) ... ok
test_test (__main__.TestCase) ... ok
test_uids (__main__.TestCase) ... ok
test_username (__main__.TestCase) ... ok
test_virtmem_usage (__main__.TestCase) ... FAIL
test_wait (__main__.TestCase) ... ok
test_wait_non_children (__main__.TestCase) ... ok
test_zombie_process (__main__.TestCase) ... ok
test_get_pids (_posix.PosixSpecificTestCase) ... ok
test_process_cmdline (_posix.PosixSpecificTestCase) ... ok
test_process_exe (_posix.PosixSpecificTestCase) ... ok
test_process_gid (_posix.PosixSpecificTestCase) ... ok
test_process_name (_posix.PosixSpecificTestCase) ... ok
test_process_parent_pid (_posix.PosixSpecificTestCase) ... ok
test_process_rss_memory (_posix.PosixSpecificTestCase) ... ok
test_process_uid (_posix.PosixSpecificTestCase) ... ok
test_process_username (_posix.PosixSpecificTestCase) ... ok
test_process_vsz_memory (_posix.PosixSpecificTestCase) ... ok
test_cached_phymem (_linux.LinuxSpecificTestCase) ... ok
test_disks (_linux.LinuxSpecificTestCase) ... ok
test_phymem_buffers (_linux.LinuxSpecificTestCase) ... ok
test_BOOT_TIME (__main__.LimitedUserTestCase) ... ok
test_Popen (__main__.LimitedUserTestCase) ... ok
test_TOTAL_PHYMEM (__main__.LimitedUserTestCase) ... ok
test__str__ (__main__.LimitedUserTestCase) ... ok
test_cmdline (__main__.LimitedUserTestCase) ... ok
test_connection_fromfd (__main__.LimitedUserTestCase) ... ok
test_cpu_percent (__main__.LimitedUserTestCase) ... ok
test_cpu_times (__main__.LimitedUserTestCase) ... ok
test_cpu_times2 (__main__.LimitedUserTestCase) ... ok
test_create_time (__main__.LimitedUserTestCase) ... ok
test_deprecated_memory_functions (__main__.LimitedUserTestCase) ... ok
test_disk_partitions (__main__.LimitedUserTestCase) ... ok
test_disk_usage (__main__.LimitedUserTestCase) ... ok
test_eq (__main__.LimitedUserTestCase) ... ok
test_exe (__main__.LimitedUserTestCase) ... ok
test_fetch_all (__main__.LimitedUserTestCase) ... ok
test_get_children (__main__.LimitedUserTestCase) ... ok
test_get_connections (__main__.LimitedUserTestCase) ... ok
test_get_connections_all (__main__.LimitedUserTestCase) ... ok
test_get_io_counters (__main__.LimitedUserTestCase) ... ok
test_get_memory_info (__main__.LimitedUserTestCase) ... ok
test_get_memory_percent (__main__.LimitedUserTestCase) ... ok
test_get_num_threads (__main__.LimitedUserTestCase) ... ok
test_get_open_files (__main__.LimitedUserTestCase) ... ok
test_get_open_files2 (__main__.LimitedUserTestCase) ... ok
test_get_pid_list (__main__.LimitedUserTestCase) ... ok
test_get_process_list (__main__.LimitedUserTestCase) ... ok
test_get_set_ionice (__main__.LimitedUserTestCase) ... ok
test_get_threads (__main__.LimitedUserTestCase) ... ok
test_getcwd (__main__.LimitedUserTestCase) ... ok
test_getcwd_2 (__main__.LimitedUserTestCase) ... ok
test_gids (__main__.LimitedUserTestCase) ... ok
test_invalid_pid (__main__.LimitedUserTestCase) ... ok
test_is_running (__main__.LimitedUserTestCase) ... ok
test_kill (__main__.LimitedUserTestCase) ... ok
test_name (__main__.LimitedUserTestCase) ... ok
test_nice (__main__.LimitedUserTestCase) ... ok
test_parent_ppid (__main__.LimitedUserTestCase) ... ok
test_phymem_buffers (__main__.LimitedUserTestCase) ... ok
test_phymem_usage (__main__.LimitedUserTestCase) ... ok
test_pid (__main__.LimitedUserTestCase) ... ok
test_pid_0 (__main__.LimitedUserTestCase) ... ok
test_pid_exists (__main__.LimitedUserTestCase) ... ok
test_pid_exists_2 (__main__.LimitedUserTestCase) ... ok
test_process_iter (__main__.LimitedUserTestCase) ... ok
test_send_signal (__main__.LimitedUserTestCase) ... ok
test_status (__main__.LimitedUserTestCase) ... ok
test_suspend_resume (__main__.LimitedUserTestCase) ... ok
test_sys_cpu_percent (__main__.LimitedUserTestCase) ... ok
test_sys_cpu_percent_compare (__main__.LimitedUserTestCase) ... ok
test_sys_cpu_times (__main__.LimitedUserTestCase) ... ok
test_sys_cpu_times2 (__main__.LimitedUserTestCase) ... ok
test_sys_per_cpu_percent (__main__.LimitedUserTestCase) ... ok
test_sys_per_cpu_times (__main__.LimitedUserTestCase) ... ok
test_sys_per_cpu_times2 (__main__.LimitedUserTestCase) ... ok
test_terminal (__main__.LimitedUserTestCase) ... ok
test_terminate (__main__.LimitedUserTestCase) ... ok
test_test (__main__.LimitedUserTestCase) ... ok
test_uids (__main__.LimitedUserTestCase) ... ok
test_username (__main__.LimitedUserTestCase) ... ok
test_virtmem_usage (__main__.LimitedUserTestCase) ... ok
test_wait (__main__.LimitedUserTestCase) ... ok
test_wait_non_children (__main__.LimitedUserTestCase) ... ok
test_zombie_process (__main__.LimitedUserTestCase) ... ok

======================================================================
ERROR: test_connection_fromfd (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_psutil.py", line 147, in inner
    return fun(self, *args, **kwargs)
  File "test_psutil.py", line 968, in test_connection_fromfd
    sock.bind(('127.0.0.1', 0))
  File "<string>", line 1, in bind
error: [Errno 99] Cannot assign requested address

======================================================================
ERROR: test_get_connections (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_psutil.py", line 147, in inner
    return fun(self, *args, **kwargs)
  File "test_psutil.py", line 941, in test_get_connections
    cons = p.get_connections()
  File "/usr/lib/python2.6/site-packages/psutil-0.3.0-py2.6-linux-armv7l.egg/psutil/__init__.py", line 402, in get_connections
    return self._platform_impl.get_connections()
  File "/usr/lib/python2.6/site-packages/psutil-0.3.0-py2.6-linux-armv7l.egg/psutil/_pslinux.py", line 251, in wrapper
    raise NoSuchProcess(self.pid, self._process_name)
NoSuchProcess: process no longer exists (pid=1065)

======================================================================
FAIL: test_disk_partitions (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_psutil.py", line 405, in test_disk_partitions
    self.assertTrue(os.path.exists(disk.device))
AssertionError

======================================================================
FAIL: test_get_io_counters (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_psutil.py", line 147, in inner
    return fun(self, *args, **kwargs)
  File "test_psutil.py", line 614, in test_get_io_counters
    self.assertTrue(io2.write_bytes > io1.write_bytes)
AssertionError

======================================================================
FAIL: test_getcwd_2 (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_psutil.py", line 147, in inner
    return fun(self, *args, **kwargs)
  File "test_psutil.py", line 868, in test_getcwd_2
    self.assertEqual(p.getcwd(), expected_dir)
AssertionError: '/home/root/py_compile/psutil-0.3.0/test' != 
'/home/root/py_compile/psutil-0.3.0'

======================================================================
FAIL: test_sys_cpu_percent_compare (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_psutil.py", line 380, in test_sys_cpu_percent_compare
    self.assertEqual(t1, t2)
AssertionError: 9.0999999999999996 != 0.0

======================================================================
FAIL: test_virtmem_usage (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_psutil.py", line 255, in test_virtmem_usage
    self.assertTrue(mem.total > 0)
AssertionError

----------------------------------------------------------------------
Ran 141 tests in 12.049s

FAILED (failures=5, errors=2)

Original comment by drakkan1...@gmail.com on 19 Jul 2011 at 2:10

GoogleCodeExporter commented 8 years ago
This is now fixed in r1107.
As for the other failures I should put hands on an actual machine to fix them 
but I'd say they're not serious failures.

Original comment by g.rodola on 19 Jul 2011 at 2:43

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 19 Jul 2011 at 2:43

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 29 Jul 2011 at 2:07

GoogleCodeExporter commented 8 years ago
hi
I've got then same problen on my readynas (sparc architecture)

# cat /proc/cpuinfo 
cpu     : Infrant Technologics, Inc. - neon version: 0
fpu     : Softfpu
ncpus probed    : 1
ncpus active    : 1
BogoMips    : 186.36
MMU     : version: 0
LP      : HW.FW version: 0.1
FPGA        : fpga000000-0 Configuration: 0
AHB arbitraion  : 7
CPU id      : 0
Switch      : 0
ASIC        : IT3107

Original comment by sgal...@gmail.com on 11 Sep 2011 at 12:10

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 21 Oct 2011 at 11:44

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 21 Oct 2011 at 11:45

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 29 Oct 2011 at 3:44

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Updated csets after the SVN -> Mercurial migration:
r1107 == revision a43299154f1e

Original comment by g.rodola on 2 Mar 2013 at 12:02