Menu

#167 Seg fault on Ubuntu Fiesty x86-64 - 3.0.0a6

v3.0.0
closed-fixed
nobody
GLUT (25)
5
2009-07-19
2007-06-14
Anonymous
No

With
Python 2.5,Python-2.5.tar.bz2
numpy, numpy-1.0.tar.gz
PyOpenGL, PyOpenGL-3.0.0a6.tar.gz

OpenGL-ctypes/OpenGL/tests$ python test_glutwindow.py
newArguments ['test_glutwindow.py']
Segmentation fault (core dumped)

This occurs on line 78
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB )

Discussion

  • Gary Orser

    Gary Orser - 2007-06-14

    Logged In: YES
    user_id=82696
    Originator: NO

    Forgot to add:

    The script I used to build this python, generates a python that doesn't seg fault on Fiesty 32bit.
    It also seg faults, on SuSE 10.1 64 bit.

    This must be some sort of 64 bit issue.

     
  • Gary Orser

    Gary Orser - 2007-06-14

    Logged In: YES
    user_id=82696
    Originator: NO

    Forgot to add:

    The script I used to build this python, generates a python that doesn't seg fault on Fiesty 32bit.
    It also seg faults, on SuSE 10.1 64 bit.

    This must be some sort of 64 bit issue.

     
  • Nobody/Anonymous

    Logged In: NO

    What's going on this bug is still present in Ubuntu Gutsy (64 bits version), are pyopengl abandoned? or is there a secret bugfix? Nothing has happened with this bug for 4 month.

    A segfault on 64-bits Linux has to be considered a quite severe bug.

    I'm very new to Python but I need it for a course in 3d rendering at school so if there is some debugging I can do please let me know, but I think it's quite easy to reproduce.

    /Björn

     
  • Mike C. Fletcher

    Logged In: YES
    user_id=34901
    Originator: NO

    I can't reproduce the bug on a 64-bit Gentoo AMD64 machine running Python 2.5.1 and current CVS head against media-libs/freeglut-2.4.0-r1 . That is, the script runs here (I develop on this amd64 Gentoo box normally). Can you give more details about your library versions?

     
  • hippodriver

    hippodriver - 2008-05-03

    Logged In: YES
    user_id=1981020
    Originator: NO

    I get the same error on Fedora 9 AMD64 and Arch Linux ia32.
    Here are the library versions:
    a) Fedora 9
    - PyOpenGL-3.0.0-0.5.b1.fc9.noarch
    - freeglut-2.4.0-14.fc9.x86_64
    - python-2.5.1-25.fc9.x86_64
    b) Arch Linux 03052008
    - python 2.5.2-2
    - python-opengl 3.0.0b1-1
    - freeglut 2.4.0-3

     
  • hippodriver

    hippodriver - 2008-05-03

    Logged In: YES
    user_id=1981020
    Originator: NO

    I get the same error on Fedora 9 AMD64 and Arch Linux ia32.
    Here are the library versions:
    a) Fedora 9
    - PyOpenGL-3.0.0-0.5.b1.fc9.noarch
    - freeglut-2.4.0-14.fc9.x86_64
    - python-2.5.1-25.fc9.x86_64
    b) Arch Linux 03052008
    - python 2.5.2-2
    - python-opengl 3.0.0b1-1
    - freeglut 2.4.0-3

     
  • Nobody/Anonymous

    Logged In: NO

    I receive the segmentation fault on my 64 bit Hardy Heron on an AMD64-2x, but it happens at the import OpenGL.GL statement, and it goes away if I run as root: 'sudo python test_glutwindow.py'. I have tried to reinstall all opengl components but it still segfaults on import OpenGL.GL.

     
  • Nobody/Anonymous

    this also happened to me on Ubuntu 32bit. The problem was calling "glutInitDisplayMode" before "glutCreateWindow". If you call it the other way round it works. For more info look at launchpad: https://bugs.edge.launchpad.net/debian/+source/pyopengl/+bug/289925

     
  • David O'Gwynn

    David O'Gwynn - 2009-01-15

    Confirm that this causing problem on CentOS as well.

    --------------------------------
    Background
    --------------------------------
    >>] uname -a
    Linux ... 2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

    >>] /sbin/lspci | grep VGA
    01:00.0 VGA compatible controller: nVidia Corporation NV41GL [Quadro FX 1400] (rev a2)

    >>] lsb_release -rd
    Description: CentOS release 5.2 (Final)
    Release: 5.2
    --------------------------------

    This is a problem with PyOpenGL's wrapping of glut/freeglut somehow. The functions can be called directly via ctypes with no errors on my system.

    >>] python
    Python 2.6 (r26:66714, Nov 21 2008, 10:53:09)
    [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from ctypes import *
    >>> glut = cdll.LoadLibrary('libglut.so')
    >>> glut.glutInit(pointer(c_int(0)),pointer(c_char_p('')))
    234
    >>> glut.glutInitDisplayMode(c_int(2)) # GLUT_DOUBLE | GLUT_RGB
    344264064
    >>> wID = glut.glutCreateWindow(c_char_p('test window'))
    freeglut Unable to create direct context rendering for window 'test window'
    This may hurt performance.
    >>> print wID
    1
    >>>

    This correctly initializes a rendering context and pops up a window.

     
  • David O'Gwynn

    David O'Gwynn - 2009-01-15

    ACK! Forgot to include stack dump of PyOpenGL crapping out.... (PyOpenGL 3.0.0b6)

    Backtrace from gdb:

    >>] gdb python
    GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
    Copyright (C) 2006 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 "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1".

    (gdb) run
    Starting program: /.../dogwynn/bin/python
    [Thread debugging using libthread_db enabled]
    Python 2.6 (r26:66714, Nov 21 2008, 10:53:09)
    [GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    [New Thread 47200948283808 (LWP 29788)]
    >>> from OpenGL.GLUT import *
    [Detaching after fork from child process 29791. (Try `set detach-on-fork off'.)]
    [Detaching after fork from child process 29793.]
    [Detaching after fork from child process 29795.]
    [Detaching after fork from child process 29797.]
    [Detaching after fork from child process 29799.]
    [Detaching after fork from child process 29801.]
    [Detaching after fork from child process 29808.]
    [Detaching after fork from child process 29813.]
    [Detaching after fork from child process 29815.]
    [Detaching after fork from child process 29824.]
    >>> glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB)

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 47200948283808 (LWP 29788)]
    0x0000000000000000 in ?? ()
    (gdb) bt
    #0 0x0000000000000000 in ?? ()
    #1 0x00002aedd7548ce8 in ffi_call_unix64 ()
    at /.../dogwynn/sources/Python-2.6/Modules/_ctypes/libffi/src/x86/unix64.S:75
    #2 0x00002aedd7548b34 in ffi_call (cif=0x7fffd6eac6f0,
    fn=0x2aedd8e3daf0 <glGetError>, rvalue=0x7fffd6eac660,
    avalue=0x7fffd6eac650)
    at /.../dogwynn/sources/Python-2.6/Modules/_ctypes/libffi/src/x86/ffi64.c:430
    #3 0x00002aedd7543364 in _CallProc (pProc=0x2aedd8e3daf0 <glGetError>,
    argtuple=<value optimized out>, flags=<value optimized out>, argtypes=0x0,
    restype=0x712a740, checker=0x0)
    at /.../dogwynn/sources/Python-2.6/Modules/_ctypes/callproc.c:814
    #4 0x00002aedd753b118 in CFuncPtr_call (self=0x71a6120,
    inargs=0x2aedd3c19050, kwds=0x0)
    at /.../dogwynn/sources/Python-2.6/Modules/_ctypes/_ctypes.c:3855
    #5 0x0000000000417bbd in PyObject_Call (func=0x71a6120, arg=0x2aedd3c19050,
    kw=0x0) at Objects/abstract.c:2487
    #6 0x0000000000490ae6 in PyEval_EvalFrameEx (f=0x729e770,
    throwflag=<value optimized out>) at Python/ceval.c:3890
    #7 0x00000000004945e5 in PyEval_EvalCodeEx (co=0x71ba468,
    globals=<value optimized out>, locals=<value optimized out>,
    args=0x2aedd3c537a0, argcount=4, kws=0x0, kwcount=0, defs=0x71b4c80,
    defcount=2, closure=0x0) at Python/ceval.c:2942
    #8 0x00000000004ea41d in function_call (func=0x71bab90, arg=0x2aedd3c53788,
    kw=0x0) at Objects/funcobject.c:524
    #9 0x0000000000417bbd in PyObject_Call (func=0x71bab90, arg=0x2aedd3c53788,
    kw=0x0) at Objects/abstract.c:2487
    #10 0x000000000041ef4f in instancemethod_call (func=<value optimized out>,
    arg=0x2aedd3c53788, kw=0x0) at Objects/classobject.c:2579
    #11 0x0000000000417bbd in PyObject_Call (func=0x2aedd8391730,
    arg=0x2aedd3cebaf0, kw=0x0) at Objects/abstract.c:2487
    #12 0x000000000041a96f in PyObject_CallFunctionObjArgs (
    callable=0x2aedd8391730) at Objects/abstract.c:2718
    #13 0x00002aedd753b148 in CFuncPtr_call (self=0x7225390, inargs=0x1, kwds=0x0)
    at /.../dogwynn/sources/Python-2.6/Modules/_ctypes/_ctypes.c:3871
    #14 0x0000000000417bbd in PyObject_Call (func=0x7225390, arg=0x2aedd3c4bc50,
    kw=0x0) at Objects/abstract.c:2487
    ---Type <return> to continue, or q <return> to quit---
    #15 0x0000000000490ae6 in PyEval_EvalFrameEx (f=0x7293e60,
    throwflag=<value optimized out>) at Python/ceval.c:3890
    #16 0x00000000004945e5 in PyEval_EvalCodeEx (co=0x2aedd3ce1af8,
    globals=<value optimized out>, locals=<value optimized out>, args=0x0,
    argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
    at Python/ceval.c:2942
    #17 0x0000000000494622 in PyEval_EvalCode (co=0x0, globals=0x2aedd3c16a70,
    locals=0x3b30015280) at Python/ceval.c:515
    #18 0x00000000004b629d in PyRun_InteractiveOneFlags (fp=<value optimized out>,
    filename=0x5029b7 "<stdin>", flags=0x7fffd6ead420)
    at Python/pythonrun.c:1330
    #19 0x00000000004b64c4 in PyRun_InteractiveLoopFlags (fp=0x3b2f54d680,
    filename=0x5029b7 "<stdin>", flags=0x7fffd6ead420)
    at Python/pythonrun.c:756
    #20 0x00000000004b65ca in PyRun_AnyFileExFlags (fp=0x3b2f54d680,
    filename=0x5029b7 "<stdin>", closeit=0, flags=0x7fffd6ead420)
    at Python/pythonrun.c:725
    #21 0x0000000000413d2f in Py_Main (argc=<value optimized out>,
    argv=0x7fffd6ead548) at Modules/main.c:597
    #22 0x0000003b2f21d8b4 in __libc_start_main () from /lib64/libc.so.6
    #23 0x0000000000412f99 in _start ()
    (gdb)

     
  • Mike C. Fletcher

    • status: open --> closed-fixed
     
  • Mike C. Fletcher

    Error checking on GLUT functions was causing these issues, glut error checking is disabled for the 3.0.1 (upcoming) release. See the LaunchPad bug for more discussions.

     

Log in to post a comment.