Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import fails on FreeBSD 7.2 #66

Closed
giampaolo opened this issue May 23, 2014 · 11 comments
Closed

Import fails on FreeBSD 7.2 #66

giampaolo opened this issue May 23, 2014 · 11 comments

Comments

@giampaolo
Copy link
Owner

From [email protected] on October 14, 2009 04:41:54

What steps will reproduce the problem?  
1. install via python setup.py install
2. import psutil 3. 

What is the expected output?  


What do you see instead?  
Python 2.5.4 ( r254 :67916, Apr 14 2009, 08:39:49) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.5/site-packages/psutil/__init__.py", line
58, in <module>
    from _psbsd import *
  File "/usr/local/lib/python2.5/site-packages/psutil/_psbsd.py", line 31,
in <module>
    TOTAL_PHYMEM = _psutil_bsd.get_total_phymem()
SystemError: error return without exception set What version of psutil are you using? On what operating system? trunk.  fails on 0.1.2 also 

Please provide any additional information below.  
I subbed in a function to replace the failing one using a call to sysctl.
Diff is attached.  Not a permanent solution though because it's slow.

Attachment: _psbsd.py.diff

Original issue: http://code.google.com/p/psutil/issues/detail?id=66

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From [email protected] on October 14, 2009 07:54:50

This is strange as there are no problems on both FreeBSD 7.0 and 7.1.
Didn't have the chance to install 7.2 to try this out.
Are we talking about 32 bit architecture?

@giampaolo
Copy link
Owner Author

From [email protected] on October 14, 2009 08:47:50

Marking the issue as high priority as it makes impossible to use psutil on FreeBSD.

Labels: -Priority-Medium Priority-High OpSys-FreeBSD Milestone-0.1.3

@giampaolo
Copy link
Owner Author

From [email protected] on October 14, 2009 08:56:15

I think HW_PHYSMEM may have changed in FreeBSD 7.2 and it's causing the call to
sysctl() to fail. We will need a FreeBSD 7.2 machine to test on and confirm but my
guess is that FreeBSD 7.2 changed the HW_PHYSMEM to a long instead of an int.

@giampaolo
Copy link
Owner Author

From [email protected] on December 15, 2009 13:19:47

Downloading 7.2 now, I'll try and setup a FreeBSD 7.2 env and sort this out over the
next few days.

Status: Accepted
Owner: jloden

@giampaolo
Copy link
Owner Author

From [email protected] on December 16, 2009 12:32:00

good news: I have FreeBSD 7.2 installed and running
bad news: I can't reproduce this issue

[jloden@freebsd7-2 psutil]$ python
Python 2.5.4 ( r254 :67916, Dec 15 2009, 21:07:06) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> 

Two possible guesses

1) the system this was reported against is 64bit instead of 32bit
2) I don't have enough RAM for my system to cause the int value to overflow

If the original reporter or anyone else that can reproduce this issue can let us know
if the system was 64bit and how much RAM was on the system that would be very helpful.

@giampaolo
Copy link
Owner Author

From [email protected] on January 28, 2010 12:07:47

I finally managed to install a 64 bit version of freebsd.
It seems there's a lot of work to do for 64 bits systems. r439 fixes this specific issue and allows psutil to be imoprted, but 8 test failures
reveals that there are other issues which require the code to be more careful when
types are declared.

Status: Started

@giampaolo
Copy link
Owner Author

From [email protected] on January 28, 2010 12:12:10

Verified that psutil.TOTAL_PHYMEM matches what shown by "sysctl -a | grep hw.physmem".

Summary: FreeBSD 64bit support
Labels: 64bit

@giampaolo
Copy link
Owner Author

From [email protected] on January 30, 2010 11:41:05

Here is a summary of functions which need to be fixed/converted for 64 bit systems:

get_avail_phymem()
get_pid_list()
uid
gid

As of right now test suite reports 10 failures.

@giampaolo
Copy link
Owner Author

From [email protected] on January 30, 2010 16:21:16

Since we already have Issue #61 for 64bit support I am changing this issue back to
just the import failure that was originally reported. Also committed r457 to solve
this without needing conditional macros. We can just use a long since that does not
cause a problem on 32bit FreeBSD.

Summary: Import fails on FreeBSD 7.2
Status: FixedInSVN

@giampaolo
Copy link
Owner Author

From g.rodola on November 12, 2010 19:14:59

Status: Fixed

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:50:49

Updated csets after the SVN -> Mercurial migration: r254 == revision 84d071065a8f r439 == revision 6b8f11aa58b2 r457 == revision 2f0911e5eabc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant