My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 560: Seg fault on OpenBSD
2 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by vex...@gmail.com, Mar 20, 2012
What steps will reproduce the problem?
1. Run hello world from the documentation.

Sorry, I do not have python, libGL and libGLU built with debug symbols, but here is the trace nevertheless:

% LD_PRELOAD=/usr/X11R6/lib/libGL.so.12.0 gdb /usr/local/bin/python2.7
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd5.1"...(no debugging symbols found)

(gdb) run 
Starting program: /usr/local/bin/python2.7 
Python 2.7.2 (default, Mar 16 2012, 06:30:10) 
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.

(gdb) import pyglet
Undefined command: "import".  Try "help".
(gdb) run 
Starting program: /usr/local/bin/python2.7 
Python 2.7.2 (default, Mar 16 2012, 06:30:10) 
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyglet
>>> window = pyglet.window.Window()
>>> label = pyglet.text.Label('Hello, world',
...                           font_name='Times New Roman',
...                           font_size=36,
...                           x=window.width//2, y=window.height//2,
...                           anchor_x='center', anchor_y='center')


Program received signal SIGSEGV, Segmentation fault.
0x000000021ae691e1 in FcPatternObjectAddWithBinding () from /usr/X11R6/lib/libfontconfig.so.7.0
(gdb) 
(gdb) bt
#0  0x000000021ae691e1 in FcPatternObjectAddWithBinding () from /usr/X11R6/lib/libfontconfig.so.7.0
#1  0x00000002111803ac in ffi_call_unix64 () from /usr/local/lib/libffi.so.0.0
#2  0x0000000211180214 in ffi_call (cif=0x7f7ffffe4830, fn=0x21ae69cc0 <IA__FcPatternAddDouble>, rvalue=0x7f7ffffe4730, avalue=0x7f7ffffe4700)
    at src/x86/ffi64.c:484
#3  0x0000000210d6e544 in _ctypes_callproc () from /usr/local/lib/python2.7/lib-dynload/_ctypes.so
#4  0x0000000210d6869c in PyCFuncPtr_call () from /usr/local/lib/python2.7/lib-dynload/_ctypes.so
#5  0x000000020b513b78 in PyObject_Call () from /usr/local/lib/libpython2.7.so.0.0
#6  0x000000020b5a8d85 in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#7  0x000000020b5aaddf in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#8  0x000000020b5ac3f5 in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#9  0x000000020b53b309 in function_call () from /usr/local/lib/libpython2.7.so.0.0
#10 0x000000020b513b78 in PyObject_Call () from /usr/local/lib/libpython2.7.so.0.0
#11 0x000000020b522072 in instancemethod_call () from /usr/local/lib/libpython2.7.so.0.0
#12 0x000000020b513b78 in PyObject_Call () from /usr/local/lib/libpython2.7.so.0.0
#13 0x000000020b56b2ac in slot_tp_init () from /usr/local/lib/libpython2.7.so.0.0
#14 0x000000020b566e18 in type_call () from /usr/local/lib/libpython2.7.so.0.0
#15 0x000000020b513b78 in PyObject_Call () from /usr/local/lib/libpython2.7.so.0.0
#16 0x000000020b5a8d85 in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#17 0x000000020b5ac3f5 in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#18 0x000000020b5aa93d in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#19 0x000000020b5ac3f5 in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#20 0x000000020b5aa93d in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#21 0x000000020b5ac3f5 in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#22 0x000000020b5aa93d in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#23 0x000000020b5aaddf in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#24 0x000000020b5aaddf in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#25 0x000000020b5aaddf in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#26 0x000000020b5aaddf in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#27 0x000000020b5ac3f5 in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#28 0x000000020b53b309 in function_call () from /usr/local/lib/libpython2.7.so.0.0
#29 0x000000020b513b78 in PyObject_Call () from /usr/local/lib/libpython2.7.so.0.0
#30 0x000000020b5143a1 in call_function_tail () from /usr/local/lib/libpython2.7.so.0.0
#31 0x000000020b514842 in PyObject_CallFunction () from /usr/local/lib/libpython2.7.so.0.0
#32 0x000000020b52adc3 in property_descr_set () from /usr/local/lib/libpython2.7.so.0.0
#33 0x000000020b5503d4 in _PyObject_GenericSetAttrWithDict () from /usr/local/lib/libpython2.7.so.0.0
#34 0x000000020b550854 in PyObject_SetAttr () from /usr/local/lib/libpython2.7.so.0.0
#35 0x000000020b5a7d2d in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#36 0x000000020b5ac3f5 in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#37 0x000000020b5aa93d in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#38 0x000000020b5ac3f5 in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#39 0x000000020b5aa93d in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#40 0x000000020b5ac3f5 in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#41 0x000000020b53b309 in function_call () from /usr/local/lib/libpython2.7.so.0.0
#42 0x000000020b513b78 in PyObject_Call () from /usr/local/lib/libpython2.7.so.0.0
#43 0x000000020b522072 in instancemethod_call () from /usr/local/lib/libpython2.7.so.0.0
#44 0x000000020b513b78 in PyObject_Call () from /usr/local/lib/libpython2.7.so.0.0
#45 0x000000020b56b2ac in slot_tp_init () from /usr/local/lib/libpython2.7.so.0.0
#46 0x000000020b566e18 in type_call () from /usr/local/lib/libpython2.7.so.0.0
#47 0x000000020b513b78 in PyObject_Call () from /usr/local/lib/libpython2.7.so.0.0
#48 0x000000020b5a8d85 in PyEval_EvalFrameEx () from /usr/local/lib/libpython2.7.so.0.0
#49 0x000000020b5ac3f5 in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.7.so.0.0
#50 0x000000020b5ac4f2 in PyEval_EvalCode () from /usr/local/lib/libpython2.7.so.0.0
#51 0x000000020b5c8212 in run_mod () from /usr/local/lib/libpython2.7.so.0.0
#52 0x000000020b5c9c8d in PyRun_InteractiveOneFlags () from /usr/local/lib/libpython2.7.so.0.0
#53 0x000000020b5c9e6e in PyRun_InteractiveLoopFlags () from /usr/local/lib/libpython2.7.so.0.0
#54 0x000000020b5c9f7c in PyRun_AnyFileExFlags () from /usr/local/lib/libpython2.7.so.0.0
#55 0x000000020b5da168 in Py_Main () from /usr/local/lib/libpython2.7.so.0.0
#56 0x0000000000400931 in ___start ()
#57 0x0000000000000000 in ?? ()


You may notice the use of LD_PRELOAD. This prevents undefined symbol errors. Alternatively:
https://github.com/vext01/ports-wip/blob/master/x11/py-pyglet/patches/patch-pyglet_lib_py

I am using OpenBSD-current on amd64. Python 2.7.2 and pyglet 1.1.4.

Cheers

May 30, 2012
#1 vex...@gmail.com
For the record, this only happens on amd64 openbsd. Seems to work OK on i386.

Any idea?
May 30, 2012
#2 vex...@gmail.com
The crash is in font/freetype.py:

pattern = fontconfig.FcPatternCreate()
fontconfig.FcPatternAddDouble(pattern, FC_SIZE, c_double(size))
BOOM!

Stuff I have tried:
 * Wrapping FC_SIZE in c_char_p()
 * Checking the return of  fontconfig.FcPatternCreate(). It is not a NULL ptr.
 * Checking type(pattern). It is an int. Is this correct? Can an int contain a 64-bit ptr?
 * Define restype of fontconfig.FcPatternCreate() as c_void_p

As of yet have not been able to resolve the crash.

Any input from the pyglet developers?
May 30, 2012
#3 vex...@gmail.com
This appears to be a duplicate of #529
Sign in to add a comment

Powered by Google Project Hosting