Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#22742 - ppython2] 2.7.1-4 quits with bus error on import ctypes

Attached to Project: Arch Linux
Opened by Sam Mussmann (smussman) - Friday, 04 February 2011, 03:15 GMT
Last edited by Allan McRae (Allan) - Friday, 15 April 2011, 11:20 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

python2 2.7.1-4

Upon attempting to import ctypes, Python quits with a bus error.

Here's a backtrace:

(gdb) run -m ctypes
Starting program: /usr/bin/python2 -m ctypes
[Thread debugging using libthread_db enabled]

Program received signal SIGBUS, Bus error.
0xb79fc702 in T.235 () from /usr/lib/libffi.so.5
(gdb) bt
#0 0xb79fc702 in T.235 () from /usr/lib/libffi.so.5
#1 0xb79fc7ee in T.229 () from /usr/lib/libffi.so.5
#2 0xb79fcefa in ffi_closure_alloc () from /usr/lib/libffi.so.5
#3 0xb7a0c3a8 in _ctypes_alloc_callback ()
from /usr/lib/python2.7/lib-dynload/_ctypes.so
#4 0xb7a06992 in ?? () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#5 0xb7ee8b5e in type_call () from /usr/lib/libpython2.7.so.1.0
#6 0xb7e914fc in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#7 0xb7f2a56c in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#8 0xb7f2cfb0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#9 0xb7f2d103 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#10 0xb7f3d02d in PyImport_ExecCodeModuleEx ()
from /usr/lib/libpython2.7.so.1.0
#11 0xb7f3d3b6 in load_source_module () from /usr/lib/libpython2.7.so.1.0
#12 0xb7f3e142 in load_package () from /usr/lib/libpython2.7.so.1.0
#13 0xb7f3e47f in import_submodule () from /usr/lib/libpython2.7.so.1.0
#14 0xb7f3e71c in load_next () from /usr/lib/libpython2.7.so.1.0
#15 0xb7f3ecd9 in import_module_level.clone.3 ()
from /usr/lib/libpython2.7.so.1.0
#16 0xb7f3f284 in PyImport_ImportModuleLevel ()
from /usr/lib/libpython2.7.so.1.0
#17 0xb7f24966 in builtin___import__ () from /usr/lib/libpython2.7.so.1.0
#18 0xb7ecd2e8 in PyCFunction_Call () from /usr/lib/libpython2.7.so.1.0
---Type <return> to continue, or q <return> to quit---
#19 0xb7f2b1c2 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#20 0xb7ead3e9 in gen_send_ex.clone.0 () from /usr/lib/libpython2.7.so.1.0
#21 0xb7ead753 in gen_iternext () from /usr/lib/libpython2.7.so.1.0
#22 0xb7f27660 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#23 0xb7f2c796 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#24 0xb7f2c796 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#25 0xb7f2c796 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#26 0xb7f2c796 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#27 0xb7f2cfb0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#28 0xb7eb8517 in function_call () from /usr/lib/libpython2.7.so.1.0
#29 0xb7e914fc in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#30 0xb7f59b49 in RunModule () from /usr/lib/libpython2.7.so.1.0
#31 0xb7f5a5b6 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#32 0x08048557 in main ()
(gdb) quit

If you need more info, let me know.
This task depends upon

Closed by  Allan McRae (Allan)
Friday, 15 April 2011, 11:20 GMT
Reason for closing:  Works for me
Additional comments about closing:  Many non-replications. Seems specific to the OPs system...
Comment by Stéphane Gaudreault (stephane) - Friday, 04 February 2011, 13:21 GMT
It works here :

$ /usr/bin/python2
Python 2.7.1 (r271:86832, Jan 6 2011, 11:45:30)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> libc = ctypes.cdll.LoadLibrary("libc.so.6")
>>> printf = libc.printf
>>> printf("It %s\n", "works!")
It works!
10
>>>

Looking at your gdb trace, it seems the problem is comming from the libffi.
Comment by Sam Mussmann (smussman) - Friday, 04 February 2011, 17:24 GMT
I tried downgrading libffi to the previous version (3.0.8) from the current version (3.0.9) and that did not fix the problem.

However, downgrading python to 2.6.5-3 does eliminate the error.

I currently do not need to have either python2.7 or python3 on this machine, and am happy holding on to the older version of python, especially since I'm not sure where I would start actually figuring out what the issue is.

I'm more than happy to test new versions of python2 and report back when the problem gets fixed.
Comment by Thomas Dziedzic (tomd123) - Saturday, 19 February 2011, 18:25 GMT
~ >>> /usr/bin/python2 -m ctypes
/usr/bin/python2: No module named ctypes.__main__; 'ctypes' is a package and cannot be directly executed

works here.

python2 2.7.1-6
Comment by Thomas Dziedzic (tomd123) - Sunday, 27 February 2011, 06:30 GMT
status?
Comment by Sam Mussmann (smussman) - Sunday, 27 February 2011, 18:07 GMT
I tried upgrading to 2.7.1-7, and am still getting the bus error.

I seem to get this error anytime the import machinery attempts to bring in ctypes. I can get it with 'python -m ctypes' or 'echo "import ctypes" | python2 -', so I'm guessing this happens before Python can figure out if the module is executable or not.
Comment by Jelle van der Waa (jelly) - Thursday, 31 March 2011, 08:34 GMT
it works here. Is your system fully up to date?

Python 2.7.1 (r271:86832, Feb 21 2011, 01:28:26)
[GCC 4.5.2 20110127 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>>

python2 2.7.1-7
Comment by Allan McRae (Allan) - Thursday, 31 March 2011, 09:26 GMT
And another works for me.

Is your issue on i686 or x86_64? Not that I can replicate on either...
Comment by Allan McRae (Allan) - Monday, 11 April 2011, 04:26 GMT
I think I am going to have to close this bug as a "Works for me". Especially given the four non-replications of this issue, which indicates this is probably specific to the OPs machine. So there is not much that can be done here...
Comment by Greg (dolby) - Monday, 11 April 2011, 05:34 GMT
Works for me as well with python 2.7.1-7 on i686

Loading...