SEGFAULT. Bug in interpreter?

Rob W. W. Hooft rob at hooft.net
Wed Jul 19 08:35:35 EDT 2000


I am running the current CVS version of python on a redhat 6.2 box and
see the following:

--------------------------------
no203[394]~%3% python x.py
zsh: segmentation fault  python x.py
no203[394]~%3% gdb =python
GNU gdb 19991004
Copyright 1998 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 "i386-redhat-linux"...
(gdb) run x.py
Starting program: /usr/local/nonius/bin/python x.py

Program received signal SIGSEGV, Segmentation fault.
PyErr_NormalizeException (exc=0xbffff73c, val=0xbffff740, tb=0xbffff744) at errors.c:166
166             if (PyClass_Check(type)) {
(gdb) where
#0  PyErr_NormalizeException (exc=0xbffff73c, val=0xbffff740, tb=0xbffff744) at errors.c:166
#1  0x8063931 in PyErr_PrintEx (set_sys_last_vars=1) at pythonrun.c:690
#2  0x8063906 in PyErr_Print () at pythonrun.c:680
#3  0x80636bb in PyRun_SimpleFile (fp=0x80f3ae8, filename=0xbffff9a1 "x.py") at pythonrun.c:585
#4  0x806338d in PyRun_AnyFile (fp=0x80f3ae8, filename=0xbffff9a1 "x.py") at pythonrun.c:463
#5  0x80513f7 in Py_Main (argc=2, argv=0xbffff824) at main.c:271
#6  0x8050f86 in main (argc=2, argv=0xbffff824) at python.c:10
(gdb) 
-----------------------------------------

On the script below. I have undressed it as much as possible, but
anything I change further in the "genkappa" routine changes the crash
into an error message either in "gentheta" or in "genkappa": 
SyntaxError: 'continue' not properly in loop (line 4)

---------------------------------------
def gentheta():
    while 1:
        try:
            continue
        finally:
            pass

def genkappa():
    if whatsmounted!='crystal':
        mountcrystal()
    while 1:
        if not inhibitmake:
            projtls.moveoutofway('kappa',dirok=1)
            os.mkdir('kappa')
        os.chdir('kappa')
        try:
            announce("Testing Kappa zero-point")
            # Use the detalign.vic produced by the dx calibration
            dal=os.path.join('..','dx','detalign.vic')
            if os.path.exists(dal):
                print "NOTE: Using detalign.vic from dx calibration"
                filecopy(dal,'detalign.vic')
            if not inhibitmake:
                status=os.system('calkappa make')
            else:
                status=os.system('calkappa')
            if status!=0:
                beeper.on()
                answer=command.question(root,'Calkappa Warnings',text='Calkappa issued some warnings and/or errors.\nPlease check what they are, and tell me what to do',
                                        strings=("Ignore them","Retry calkappa","Cancel and quit"))
                beeper.off()
                if answer==2:
                    cancel()
                if answer==1:
                    continue
            if os.path.exists('instruct.txt'):
                beeper.on()
                answer=command.fixedfontquestion(
                    root,'Kappa missetting needs correction',
                    text=open('instruct.txt').read(),
                    strings=("I have now done this","I'm ignoring this for now","Cancel and quit"))
                beeper.off()
                if answer==2:
                    cancel()
                if answer==1:
                    break
            else:
                # No instructions means no correction required
                break
        finally:
            os.chdir('..')




More information about the Python-list mailing list