Issue 442 in psutil: ImportError. undefined symbol: prlimit

74 views
Skip to first unread message

psu...@googlecode.com

unread,
Oct 17, 2013, 2:07:56 PM10/17/13
to psutil-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 442 by shchepyo...@gmail.com: ImportError. undefined symbol:
prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Hi!
Sorry for my English.
I installed with the help of let pip. In the console do import psutil and
get an error.

>>> import psutil
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/psutil/__init__.py", line
89, in <module>
import psutil._pslinux as _psplatform
File "/usr/local/lib/python2.6/dist-packages/psutil/_pslinux.py", line
21, in <module>
import _psutil_linux
ImportError: /usr/local/lib/python2.6/dist-packages/_psutil_linux.so:
undefined symbol: prlimit

What version of psutil are you using? What Python version?
psutil-1.1.1
Python 2.6.6

On what operating system?

OS: Debian GNU/Linux 6.0
Uname: Linux 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.41-2+deb7u2~bpo60+1
x86_64 GNU/Linux


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

psu...@googlecode.com

unread,
Oct 19, 2013, 4:20:38 AM10/19/13
to psutil-...@googlegroups.com
Updates:
Labels: OpSys-Linux

Comment #1 on issue 442 by g.rodola: ImportError. undefined symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Mmmm. I though I fixed this in issue 438.
Are you sure this is 1.1.1 version and not 1.1.0?
Please paste the output of "grep -r prlimit /usr/include/".
Also, does "man prlimit" work (I mean is the manual available?)?

psu...@googlecode.com

unread,
Oct 19, 2013, 1:00:21 PM10/19/13
to psutil-...@googlegroups.com

Comment #2 on issue 442 by shchepyo...@gmail.com: ImportError. undefined
symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

1. In the file "install.txt" output installing via pip. Install the version
1.1.1
2. The command "grep -r prlimit /usr/include/" no output
3. The command "man prlimit" outputs "No manual entry for prlimit"

P.S.
On another server I have is OS Debian 6.0. But the kernel Linux
2.6.32-5-amd64 # 1 SMP Mon Feb 25 02:37:03 UTC 2013 x86_64 GNU/Linux. There
psutil runs great.
This server, paragraphs 2 and 3 have the same result.

Attachments:
install.txt 1.4 KB

psu...@googlecode.com

unread,
Oct 19, 2013, 1:39:06 PM10/19/13
to psutil-...@googlegroups.com

Comment #3 on issue 442 by g.rodola: ImportError. undefined symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Please try revision 5bdae7b71188.

psu...@googlecode.com

unread,
Oct 19, 2013, 3:14:31 PM10/19/13
to psutil-...@googlegroups.com

Comment #4 on issue 442 by shchepyo...@gmail.com: ImportError. undefined
symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Thank you!
Revision 5bdae7b71188 working on my server.

psu...@googlecode.com

unread,
Oct 22, 2013, 1:33:02 PM10/22/13
to psutil-...@googlegroups.com

Comment #5 on issue 442 by D.V.Se...@gmail.com: ImportError. undefined
symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Dear Giampaolo,
Please release v1.1.2.

psu...@googlecode.com

unread,
Oct 22, 2013, 2:18:02 PM10/22/13
to psutil-...@googlegroups.com
Updates:
Status: Fixed
Labels: Milestone-1.1.2

Comment #6 on issue 442 by g.rodola: ImportError. undefined symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

I released a 1.1.2 bugfix-only release just now:
https://pypi.python.org/pypi/psutil#downloads
I really hope this issue won't appear again (this is the second time in 2
releases!). =)

psu...@googlecode.com

unread,
Oct 26, 2013, 4:33:33 PM10/26/13
to psutil-...@googlegroups.com

Comment #7 on issue 442 by Web...@gmail.com: ImportError. undefined symbol:
prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Hello!
I use Linux Debian 6.0, kernel 3.1.0-1.2-xen and psutil-1.1.2 (latest
version). Unfortunately I have the same error =(

"uname -a": Linux vmName 3.1.0-1.2-xen #5 SMP i686 GNU/Linux
---------------------
Python 3.3.0 (default, Oct 26 2013, 23:51:51)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "./psutil/__init__.py", line 89, in <module>
import psutil._pslinux as _psplatform
File "./psutil/_pslinux.py", line 21, in <module>
import _psutil_linux
ImportError:
/usr/local/myProjectName/python/lib/python3.3/site-packages/_psutil_li
nux.cpython-33m.so: undefined symbol: prlimit
------------------

1) command:
cat
/usr/local/myProjectName/python/lib/python3.3/site-packages/psutil/__init__.py
| grep __version__
display: __version__ = "1.1.2"

2) command: "grep -r prlimit /usr/include/" no output
3) command: "man prlimit" outputs "No manual entry for prlimit"

psu...@googlecode.com

unread,
Oct 27, 2013, 5:12:37 AM10/27/13
to psutil-...@googlegroups.com
Updates:
Status: ReOpened

Comment #8 on issue 442 by g.rodola: ImportError. undefined symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Damn!
How is that even possible?
In _psutil_linux.c we check whether __NR_prlimit64 is defined.
Your grep into /usr/include clearly shows it isn't so it should assume
prlimit() is NOT available.
Are you sure this is not a problem of 'old installation files still
sticking around'?
Please retry like this:

cd psutil-1.1.2
rm -rf build dist
sudo rm -rf
/usr/local/myProjectName/python/lib/python3.3/site-packages/psutil*
python setup.py install

psu...@googlecode.com

unread,
Oct 27, 2013, 12:44:10 PM10/27/13
to psutil-...@googlegroups.com

Comment #9 on issue 442 by Web...@gmail.com: ImportError. undefined symbol:
prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Hello!

First of all, I am sorry "grep -r prlimit /usr/include/" command output:
/usr/include/asm-generic/unistd.h:#define __NR_prlimit64 261
/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_prlimit64, sys_prlimit64)
/usr/include/asm/unistd_x32.h:#define __NR_prlimit64 (__X32_SYSCALL_BIT +
302)
/usr/include/asm/unistd_64.h:#define __NR_prlimit64 302
/usr/include/asm/unistd_32.h:#define __NR_prlimit64 340

I have made a small research.
I type next commands: (tmp - it is an empty folder)

cd /tmp
wget http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2
tar jxf ./Python-3.3.0.tar.bz2
cd ./Python-3.3.0
./configure --prefix=/tmp/python
make
make install

/tmp/python/bin/python3.3 and enter: import psutil. It is
output: "ImportError: no module named 'psuitl'"

cd /tmp/python/lib/python3.3/site-packages, than I enter "ls" command.
this command say that this directory contains only README file.

Than I type:
cd /tmp
wget https://pypi.python.org/packages/source/p/psutil/psutil-1.1.2.tar.gz
tar -zxvf psutil-1.1.2.tar.gz
cd psutil-1.1.2
/tmp/python/bin/python3.3 setup.py install

output:
----------------------------
.................
byte-compiling /tmp/python/lib/python3.3/site-packages/psutil/_compat.py to
_com
pat.cpython-33.pyc
byte-compiling /tmp/python/lib/python3.3/site-packages/psutil/_pssunos.py
to _ps
sunos.cpython-33.pyc
byte-compiling /tmp/python/lib/python3.3/site-packages/psutil/_error.py to
_erro
r.cpython-33.pyc
running install_egg_info
Writing /tmp/python/lib/python3.3/site-packages/psutil-1.1.2-py3.3.egg-info
-----------------------------------

/tmp/python/bin/python3.3 and enter: import psutil
output:
------------------------------------
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "./psutil/__init__.py", line 89, in <module>
import psutil._pslinux as _psplatform
File "./psutil/_pslinux.py", line 21, in <module>
import _psutil_linux
ImportError:
/tmp/python/lib/python3.3/site-packages/_psutil_linux.cpython-33m.s
o: undefined symbol: prlimit
-----------------------------------
In the file "/tmp/psutil-1.1.2/psutil/_psutil_linux.c" I changed "#define
HAVE_PRLIMIT defined(PSUTIL_KERN_PRLIMIT) && defined(__NR_prlimit64)"
to "#define HAVE_PRLIMIT 0" and after that all work fine.

---
I have moved "#define HAVE_PRLIMIT defined(PSUTIL_KERN_PRLIMIT) &&
defined(__NR_prlimit64)" at the top of the file (_psutil_linux.c) and it is
still equal true. There are not any "#includes" before this line.

After all of this, I have write small C programm:
#define HAVE_PRLIMIT defined(__NR_prlimit64)
int main(int argc, char *argv[]) {
#if HAVE_PRLIMIT
printf ("yes");
#else
printf ("no");
#endif
return 0;
}
after compilation it is print "no", so I can not understand, why when I
compile psuitl "defined(__NR_prlimit64)" is true (and this causes the
error), but when I complie my test program "defined(__NR_prlimit64)" is
false...

psu...@googlecode.com

unread,
Oct 27, 2013, 1:20:56 PM10/27/13
to psutil-...@googlegroups.com

Comment #10 on issue 442 by Web...@gmail.com: ImportError. undefined
symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

At this link: http://bugs.python.org/issue16595 I have found
that "prlimit() needs glibc 2.13+". But command "ldd --version"
return: "ldd (Debian EGLIBC 2.11.3-4) 2.11.3", so may be this causes an
error.

psu...@googlecode.com

unread,
Nov 4, 2013, 6:16:54 PM11/4/13
to psutil-...@googlegroups.com

Comment #11 on issue 442 by DanaGoye...@gmail.com: ImportError. undefined
symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

I'm using CentOS 6.4 in an lxc container under an Ubuntu 13.04 host.

It seems like checking for __NR_prlimit64 must not be entirely correct,
since I'm still getting the import error even with the above revision.

Kernel version: 3.11.0-12-generic (containers use the host's kernel)

Guest glibc:
ldd (GNU libc) 2.12

Guest grep:
/usr/include/asm-generic/unistd.h:#define __NR_prlimit64 261
/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_prlimit64, sys_ni_syscall)
/usr/include/asm/unistd_64.h:#define __NR_prlimit64 302
/usr/include/asm/unistd_64.h:__SYSCALL(__NR_prlimit64, sys_ni_syscall)
/usr/include/asm/unistd_32.h:/* #define __NR_prlimit64 340 */
/usr/include/bits/syscall.h:#define SYS_prlimit64 __NR_prlimit64

Host glibc:
ldd (Ubuntu EGLIBC 2.17-93ubuntu4) 2.17

Host grep:
/usr/include/asm-generic/unistd.h:#define __NR_prlimit64 261
/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_prlimit64, sys_prlimit64)
/usr/include/x86_64-linux-gnu/asm/unistd_x32.h:#define __NR_prlimit64
(__X32_SYSCALL_BIT + 302)
/usr/include/x86_64-linux-gnu/asm/unistd_64.h:#define __NR_prlimit64 302
/usr/include/x86_64-linux-gnu/asm/unistd_32.h:#define __NR_prlimit64 340
/usr/include/x86_64-linux-gnu/bits/syscall.h:#define SYS_prlimit64
__NR_prlimit64
/usr/include/x86_64-linux-gnu/bits/syscall.h:#define SYS_prlimit64
__NR_prlimit64
/usr/include/x86_64-linux-gnu/bits/syscall.h:#define SYS_prlimit64
__NR_prlimit64
/usr/include/x86_64-linux-gnu/bits/resource.h:extern int prlimit (__pid_t
__pid, enum __rlimit_resource __resource,
/usr/include/x86_64-linux-gnu/bits/resource.h:extern int __REDIRECT_NTH
(prlimit, (__pid_t __pid,
/usr/include/x86_64-linux-gnu/bits/resource.h: struct rlimit
*__old_limit), prlimit64);
/usr/include/x86_64-linux-gnu/bits/resource.h:# define prlimit prlimit64
/usr/include/x86_64-linux-gnu/bits/resource.h:extern int prlimit64 (__pid_t
__pid, enum __rlimit_resource __resource,

psu...@googlecode.com

unread,
Nov 6, 2013, 12:09:39 PM11/6/13
to psutil-...@googlegroups.com
Updates:
Labels: -Priority-Medium -Milestone-1.1.2 Priority-High

Comment #12 on issue 442 by g.rodola: ImportError. undefined symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Please anyone try revision af484b3ac7a5.

psu...@googlecode.com

unread,
Nov 6, 2013, 2:07:23 PM11/6/13
to psutil-...@googlegroups.com

Comment #13 on issue 442 by g.rodola: ImportError. undefined symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Sorry, try revision c3c9aae2d70b which hopefully should fix this issue once
and for all.

psu...@googlecode.com

unread,
Nov 6, 2013, 3:52:12 PM11/6/13
to psutil-...@googlegroups.com

Comment #14 on issue 442 by DanaGoye...@gmail.com: ImportError. undefined
symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Thanks, that does seem to work -- now the module loads properly in my
container environment.

psu...@googlecode.com

unread,
Nov 6, 2013, 4:30:55 PM11/6/13
to psutil-...@googlegroups.com

Comment #15 on issue 442 by g.rodola: ImportError. undefined symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

Finally! I will see if I can pack up a new version tomorrow.

psu...@googlecode.com

unread,
Nov 7, 2013, 4:25:59 PM11/7/13
to psutil-...@googlegroups.com
Updates:
Status: Fixed
Labels: Milestone-1.1.3

Comment #16 on issue 442 by g.rodola: ImportError. undefined symbol: prlimit
http://code.google.com/p/psutil/issues/detail?id=442

New 1.1.3 version is out.
Closing this out for now and seriously: I hope I won't have to reopen this
for the fourth time. =)

psu...@googlecode.com

unread,
Nov 10, 2014, 4:52:38 AM11/10/14
to psutil-...@googlegroups.com

Comment #17 on issue 442 by vikash2c...@gmail.com: ImportError. undefined
symbol: prlimit
https://code.google.com/p/psutil/issues/detail?id=442

I am facing same issue on MAC.

xymMac-vikash_kumar$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named psutil

psu...@googlecode.com

unread,
Nov 10, 2014, 5:08:13 AM11/10/14
to psutil-...@googlegroups.com

Comment #18 on issue 442 by g.rodola: ImportError. undefined symbol: prlimit
https://code.google.com/p/psutil/issues/detail?id=442

You cannot have this issue on OSX because:
- it should have already been fixed
- (most importantly) it's not supposed to happen on OSX at all because the
functionality using prlimit() is Linux only (!)
That error means psutil is not installed for some reason.

psu...@googlecode.com

unread,
Nov 12, 2014, 3:52:18 AM11/12/14
to psutil-...@googlegroups.com

Comment #19 on issue 442 by kumarvik...@gmail.com: ImportError. undefined
symbol: prlimit
https://code.google.com/p/psutil/issues/detail?id=442

Thanks g.rodola. It looks psutil is not installed properly. I tried to
reinstall it ...faced the error.

<<
SymMacToolkit-CPWKWBL7DTY3:/ vikash_kumar$ pip install psutil
Downloading/unpacking psutil
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'
Installing collected packages: psutil
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: error: unknown argument: '-mno-fused-madd'
[-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a
warning) in the future
error: command 'clang' failed with exit status 1
Complete output from command /usr/bin/python -c "import
setuptools;__file__='/private/var/folders/zb/glcnyrtx6yx7y22592bxld1dxdydkq/T/pip_build_vikash_kumar/psutil/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'),
__file__, 'exec'))" install --record
/var/folders/zb/glcnyrtx6yx7y22592bxld1dxdydkq/T/pip-wTP23r-record/install-record.txt
--single-version-externally-managed:
running install


So will eliminate this installation issue.

psu...@googlecode.com

unread,
Nov 12, 2014, 3:55:19 AM11/12/14
to psutil-...@googlegroups.com

Comment #20 on issue 442 by vikash2c...@gmail.com: ImportError. undefined
symbol: prlimit
https://code.google.com/p/psutil/issues/detail?id=442

Thanks g.rodola. It looks like psutil is not installed properly. I tried to
reinstall ... facing some error.

<<
SymMacToolkit-CPWKWBL7DTY3:/ vikash_kumar$ pip install psutil
Downloading/unpacking psutil
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'
Installing collected packages: psutil
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: error: unknown argument: '-mno-fused-madd'
[-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a
warning) in the future
error: command 'clang' failed with exit status 1
Complete output from command /usr/bin/python -c "import


So will eliminate this issue 1st.
Reply all
Reply to author
Forward
0 new messages