SourceForge has been redesigned. Learn more.
Close

#137 passing -v to python2.7 when starting pymol 1.6.x crashes python2.7

v1.6.0.0
closed-fixed
None
5
2015-01-17
2013-09-11
No

Using current pymol svn at r4042 built on darwin12 using the clang compilers, when pymol is started with '-v' passed to python2.7 such as…

PYMOL_PATH=/sw/lib/python2.7/site-packages/pymol
export PYMOL_PATH
exec /sw/bin/python2.7 -v /sw/lib/python2.7/site-packages/pymol/init.py

this causes python2.7 to segfault. Removing the '-v' in the startup command for pymol 1.6.0 makes the crash go latent again. This issue doesn't exist in the pymol 1.5.x releases.

This backtraces with…

$ gdb /sw/bin/python2.7
$ (gdb) r -v /sw/lib/python2.7/site-packages/pymol/init.py

as

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x000000010115bcb2 in CGORenderGL ()
(gdb) bt

0 0x000000010115bcb2 in CGORenderGL ()

1 0x000000010117d75e in OrthoRenderCGO ()

2 0x000000010117d670 in OrthoDoDraw ()

3 0x00000001012d9ca7 in ExecutiveDrawNow ()

4 0x000000010133ef65 in PyMOL_DrawWithoutLock ()

5 0x000000010132d714 in MainDrawLocked ()

6 0x000000010132e877 in MainDraw ()

7 0x0000000101a80729 in fghcbDisplayWindow ()

8 0x0000000101a83d41 in fgEnumWindows ()

9 0x0000000101a800bc in glutMainLoopEvent ()

10 0x0000000101a80325 in glutMainLoop ()

11 0x000000010132decc in main_common ()

12 0x000000010132e00c in main_shared ()

13 0x0000000101322f87 in CmdRunPyMOL ()

14 0x00000001000a3157 in PyEval_EvalFrameEx ()

15 0x00000001000a11d6 in PyEval_EvalCodeEx ()

16 0x00000001000a7fa6 in fast_function ()

17 0x00000001000a437f in PyEval_EvalFrameEx ()

18 0x00000001000a11d6 in PyEval_EvalCodeEx ()

19 0x00000001000a0b06 in PyEval_EvalCode ()

20 0x00000001000c81f1 in PyRun_FileExFlags ()

21 0x00000001000c7d3e in PyRun_SimpleFileExFlags ()

22 0x00000001000d9e00 in Py_Main ()

23 0x00007fff93a907e1 in start ()

(gdb)

Discussion

  • Jack Howarth

    Jack Howarth - 2013-09-11

    Backtrace with object files for -g build of pymol r4042 present

    Program received signal EXC_BAD_ACCESS, Could not access memory.
    Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
    CGORenderGL (I=0x0, color=0x0, set1=0x0, set2=0x0, info=0x0, rep=0x0) at layer1/CGO.c:7855
    7855      register PyMOLGlobals *G = I->G;
    (gdb) bt
    #0  CGORenderGL (I=0x0, color=0x0, set1=0x0, set2=0x0, info=0x0, rep=0x0) at layer1/CGO.c:7855
    #1  0x000000010117d75e in OrthoRenderCGO (G=0x10246ae70) at layer1/Ortho.c:1962
    #2  0x000000010117d670 in OrthoDoDraw (G=0x10246ae70, render_mode=69343936) at layer1/Ortho.c:1944
    #3  0x00000001012d9ca7 in ExecutiveDrawNow (G=0x10246ae70) at layer3/Executive.c:11802
    #4  0x000000010133ef65 in PyMOL_DrawWithoutLock (I=0x1009f6a00) at layer5/PyMOL.c:3907
    #5  0x000000010132d714 in MainDrawLocked () at layer5/main.c:664
    #6  0x000000010132e877 in MainDraw () at layer5/main.c:914
    #7  0x0000000101a80729 in fghcbDisplayWindow ()
    #8  0x0000000101a83d41 in fgEnumWindows ()
    #9  0x0000000101a800bc in glutMainLoopEvent ()
    #10 0x0000000101a80325 in glutMainLoop ()
    #11 0x000000010132decc in launch [inlined] () at /sw/src/fink.build/pymol-py27-1.6.0-2/pymol-1.6.0/layer5/main.c:1771
    #12 0x000000010132decc in main_common () at layer5/main.c:1838
    #13 0x000000010132e00c in main_shared (block_input_hook=<value temporarily unavailable, due to optimizations>) at layer5/main.c:1825
    #14 0x0000000101322f87 in APISuccess [inlined] () at /sw/src/fink.build/pymol-py27-1.6.0-2/pymol-1.6.0/layer4/Cmd.c:4413
    #15 0x0000000101322f87 in CmdRunPyMOL (self=0x10066f058, args=<value temporarily unavailable, due to optimizations>) at layer4/Cmd.c:4419
    #16 0x00000001000a3157 in PyEval_EvalFrameEx ()
    #17 0x00000001000a11d6 in PyEval_EvalCodeEx ()
    #18 0x00000001000a7fa6 in fast_function ()
    #19 0x00000001000a437f in PyEval_EvalFrameEx ()
    #20 0x00000001000a11d6 in PyEval_EvalCodeEx ()
    #21 0x00000001000a0b06 in PyEval_EvalCode ()
    #22 0x00000001000c81f1 in PyRun_FileExFlags ()
    #23 0x00000001000c7d3e in PyRun_SimpleFileExFlags ()
    #24 0x00000001000d9e00 in Py_Main ()
    #25 0x00007fff957257e1 in start ()
    Current language:  auto; currently minimal
    
     
  • Jack Howarth

    Jack Howarth - 2013-09-11

    Using the static analyzer in clang on layer1/CGO.c as…

    clang -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -fwrapv -O3 -Wall -Wstrict-prototypes -I/sw/include -D_PYMOL_VMD_PLUGINS -D_PYMOL_LIBPNG -D_PYMOL_FREETYPE -D_PYMOL_INLINE -D_PYMOL_OPENGL_SHADERS -DNO_MMLIBS -D_PYMOL_CGO_DRAWARRAYS -D_PYMOL_CGO_DRAWBUFFERS -D_CGO_DRAWARRAYS -D_PYMOL_GL_CALLLISTS -DOPENGL_ES_2 -D_PYMOL_NUMPY -Iov/src -Ilayer0 -Ilayer1 -Ilayer2 -Ilayer3 -Ilayer4 -Ilayer5 -Imodules/cealign/src -Imodules/cealign/src/tnt -Ibuild/generated -Icontrib/uiuc/plugins/include -Icontrib/uiuc/plugins/molfile_plugin/src -I/sw/lib/python2.7/site-packages/numpy/core/include -I/sw/include -I/sw/include/freetype2 -I/usr/include -I/usr/X11/include -I/usr/X11/include/freetype2 -I/sw/include/python2.7 -c layer1/CGO.c -o build/temp.macosx-10.8-x86_64-2.7/layer1/CGO.o -ffast-math -funroll-loops -O3 -fcommon --analyze
    

    reveals…

    layer1/CGO.c:487:3: warning: Dereference of null pointer
    VLACheck(I->op, float, I->c + c);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    layer1/CGO.c:1220:17: warning: Dereference of null pointer
    (pc++) = (n1++); / normals @ +14 /
    ^~~~~~~
    layer1/CGO.c:1476:11: warning: Assigned value is garbage or undefined
    (pc++) = (v++);
    ^ ~~~~~~
    layer1/CGO.c:1749:10: warning: Dereference of null pointer
    (nc++) = (pc - 1);
    ~~~~~~~~^~~~~~~~~~~
    layer1/CGO.c:1763:10: warning: Dereference of null pointer
    (nc++) = (pc - 1);
    ~~~~~~~~^~~~~~~~~~~
    layer1/CGO.c:1775:10: warning: Dereference of null pointer
    (nc++) = (pc - 1);
    ~~~~~~~~^~~~~~~~~~~
    layer1/CGO.c:1787:10: warning: Dereference of null pointer
    (nc++) = (pc - 1);
    ~~~~~~~~^~~~~~~~~~~
    layer1/CGO.c:1799:10: warning: Dereference of null pointer
    (nc++) = (pc - 1);
    ~~~~~~~~^~~~~~~~~~~
    layer1/CGO.c:1809:15: warning: Dereference of null pointer
    (nc++) = (pc - 1);
    ~~~~~~~~^~~~~~~~~~~
    layer1/CGO.c:1946:23: warning: Dereference of undefined pointer value
    normalVals[pl] = pc[0]; normalVals[pl+1] = pc[1]; normalVals[pl+2] = pc[2];
    ~~~~~~~~~~~~~~~^~~~~~~
    layer1/CGO.c:1950:23: warning: Array access (from variable 'colorVals') results in a null pointer dereference
    colorVals[plc] = pc[0]; colorVals[plc+1] = pc[1]; colorVals[plc+2] = pc[2]; colorVals[plc+3] = I->alpha;
    ~~~~~~~~~ ^
    layer1/CGO.c:1955:8: warning: Dereference of null pointer
    CGO_put_int(&pickColorVals[pla * 2], CGO_get_int(pc));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    layer1/CGO.c:2577:8: warning: Function call argument is an uninitialized value
    SetVertexValuesForVBO(I->G, cgo, arrays, pl, plc, cnt, incr++,
    ^
    layer1/CGO.c:2887:8: warning: Function call argument is an uninitialized value
    SetVertexValuesForVBO(G, cgo, arrays, pl, plc, 0, incr++,
    ^
    layer1/CGO.c:4395:13: warning: Branch condition evaluates to a garbage value
    FreeP(org_colorVals);
    ^~~~~~~~~~~~~
    layer1/CGO.c:4558:10: warning: Dereference of null pointer
    (nc++) = (npc - 1);
    ~~~~~~~~^~~~~~~~~~~~
    layer1/CGO.c:5167:23: warning: Array access (from variable 'colorVals') results in a null pointer dereference
    colorVals[plc] = pc[0]; colorVals[plc+1] = pc[1];
    ~~~~~~~~~ ^
    layer1/CGO.c:5187:3: warning: Dereference of null pointer
    CGO_put_int(pickColorVals + pla * 2, cgo->current_pick_color_index);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    layer1/CGO.c:6209:8: warning: Branch condition evaluates to a garbage value
    if (vertexVals){
    ^~~~~~~~~~
    layer1/CGO.c:6522:11: warning: Branch condition evaluates to a garbage value
    if (vertexVals){
    ^~~~~~~~~~
    layer1/CGO.c:7980:13: warning: Branch condition evaluates to a garbage value
    if (normalVals_tmp){
    ^~~~~~~~~~~~~~
    layer1/CGO.c:8008:11: warning: Branch condition evaluates to a garbage value
    if (normalVals_tmp){
    ^~~~~~~~~~~~~~
    layer1/CGO.c:8047:11: warning: Branch condition evaluates to a garbage value
    if (normalVals_tmp){
    ^~~~~~~~~~~~~~
    layer1/CGO.c:9429:16: warning: Dereference of null pointer
    (nc++) = (pc - 1);
    ~~~~~~~~^~~~~~~~~~~
    layer1/CGO.c:9449:15: warning: Dereference of null pointer
    (nc++) = (pc - 1);
    ~~~~~~~~^~~~~~~~~~~
    layer1/CGO.c:9465:12: warning: Memory is never released; potential leak of memory pointed to by 'cgo'
    return NULL;
    ^~~~

     
  • Thomas Holder

    Thomas Holder - 2013-10-04
    • status: open --> closed-fixed
    • assigned_to: Thomas Holder
     

Log in to post a comment.