[Python-bugs-list] [ python-Bugs-563598 ] Core dump with newly built Python

noreply@sourceforge.net noreply@sourceforge.net
Wed, 05 Jun 2002 09:30:44 -0700


Bugs item #563598, was opened at 2002-06-02 14:09
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=563598&group_id=5470

Category: Build
Group: Python 2.2.1
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Whit Blauvelt (whit)
Assigned to: Nobody/Anonymous (nobody)
Summary: Core dump with newly built Python

Initial Comment:
This is on what started as a Red Hat 6.0 box currently
running a 2.4.19-pre9-ac3 kernel:

# gdb ./python ./core
GNU gdb 4.17.0.11 with Linux support
...
This GDB was configured as "i386-redhat-linux"...
Core was generated by `./python -E ./setup.py build'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libdl.so.2...done.
Reading symbols from /lib/libpthread.so.0...done.
Reading symbols from /lib/libutil.so.1...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
#0  0x8075732 in eval_frame (f=0x812504c) at
Python/ceval.c:1310
1310                            Py_DECREF(u);

(gdb) bt 
#0  0x8075732 in eval_frame (f=0x812504c) at
Python/ceval.c:1310
#1  0x8077bee in PyEval_EvalCodeEx (co=0x81245c0,
globals=0x811ec6c, locals=0x811ec6c, args=0x0,
argcount=0, kws=0x0, 
    kwcount=0, defs=0x0, defcount=0, closure=0x0) at
Python/ceval.c:2585
#2  0x8079c60 in PyEval_EvalCode (co=0x81245c0,
globals=0x811ec6c, locals=0x811ec6c) at Python/ceval.c:483
#3  0x808b53d in PyImport_ExecCodeModuleEx
(name=0xbfffe4f4 "os", co=0x81245c0, 
    pathname=0xbfffdbf4
"/usr/src/Python-2.2.1/Lib/os.pyc") at Python/import.c:502
#4  0x808ba59 in load_source_module (name=0xbfffe4f4
"os", pathname=0xbfffe064
"/usr/src/Python-2.2.1/Lib/os.py", 
    fp=0x810f710) at Python/import.c:772
#5  0x808c380 in load_module (name=0xbfffe4f4 "os",
fp=0x810f710, buf=0xbfffe064
"/usr/src/Python-2.2.1/Lib/os.py", 
    type=1) at Python/import.c:1356
#6  0x808d015 in import_submodule (mod=0x80e105c,
subname=0xbfffe4f4 "os", fullname=0xbfffe4f4 "os")
    at Python/import.c:1895
#7  0x808cbbd in load_next (mod=0x80e105c,
altmod=0x80e105c, p_name=0xbfffe900, buf=0xbfffe4f4 "os", 
    p_buflen=0xbfffe4f0) at Python/import.c:1751
#8  0x808c7eb in import_module_ex (name=0x0,
globals=0x81151cc, locals=0x81151cc, fromlist=0x80e105c)
    at Python/import.c:1602
#9  0x808dd14 in PyImport_ImportModuleEx
(name=0x8110854 "os", globals=0x81151cc,
locals=0x81151cc, fromlist=0x80e105c)
    at Python/import.c:1643
#10 0x80ca8ac in builtin___import__ (self=0x0,
args=0x81153fc) at Python/bltinmodule.c:40
#11 0x80c6e7d in PyCFunction_Call (func=0x8102998,
arg=0x81153fc, kw=0x0) at Objects/methodobject.c:80
#12 0x80a956e in PyObject_Call (func=0x8102998,
arg=0x81153fc, kw=0x0) at Objects/abstract.c:1684
#13 0x80783e0 in PyEval_CallObjectWithKeywords
(func=0x8102998, arg=0x81153fc, kw=0x0) at
Python/ceval.c:3049
#14 0x8076793 in eval_frame (f=0x8115554) at
Python/ceval.c:1839
#15 0x8077bee in PyEval_EvalCodeEx (co=0x81051d0,
globals=0x81151cc, locals=0x81151cc, args=0x0,
argcount=0, kws=0x0, 
    kwcount=0, defs=0x0, defcount=0, closure=0x0) at
Python/ceval.c:2585
#16 0x8079c60 in PyEval_EvalCode (co=0x81051d0,
globals=0x81151cc, locals=0x81151cc) at Python/ceval.c:483
#17 0x808b53d in PyImport_ExecCodeModuleEx
(name=0xbffff494 "site", co=0x81051d0, 
    pathname=0xbfffeb94
"/usr/src/Python-2.2.1/Lib/site.pyc") at
Python/import.c:502
#18 0x808ba59 in load_source_module (name=0xbffff494
"site", pathname=0xbffff004
"/usr/src/Python-2.2.1/Lib/site.py", 
    fp=0x810f658) at Python/import.c:772
#19 0x808c380 in load_module (name=0xbffff494 "site",
fp=0x810f658, 
    buf=0xbffff004 "/usr/src/Python-2.2.1/Lib/site.py",
type=1) at Python/import.c:1356
#20 0x808d015 in import_submodule (mod=0x80e105c,
subname=0xbffff494 "site", fullname=0xbffff494 "site")
    at Python/import.c:1895
#21 0x808cbbd in load_next (mod=0x80e105c,
altmod=0x80e105c, p_name=0xbffff8a0, buf=0xbffff494
"site", 
    p_buflen=0xbffff490) at Python/import.c:1751
#22 0x808c7eb in import_module_ex (name=0x0,
globals=0x810f5d4, locals=0x810f5d4, fromlist=0x8107adc)
    at Python/import.c:1602
#23 0x808dd14 in PyImport_ImportModuleEx
(name=0x810f5bc "site", globals=0x810f5d4,
locals=0x810f5d4, 
    fromlist=0x8107adc) at Python/import.c:1643
#24 0x80ca8ac in builtin___import__ (self=0x0,
args=0x8107edc) at Python/bltinmodule.c:40
#25 0x80c6e7d in PyCFunction_Call (func=0x8102998,
arg=0x8107edc, kw=0x0) at Objects/methodobject.c:80
#26 0x80a956e in PyObject_Call (func=0x8102998,
arg=0x8107edc, kw=0x0) at Objects/abstract.c:1684
#27 0x80783e0 in PyEval_CallObjectWithKeywords
(func=0x8102998, arg=0x8107edc, kw=0x0) at
Python/ceval.c:3049
#28 0x80a8bee in PyObject_CallFunction
(callable=0x8102998, format=0x80d5707 "OOOO") at
Objects/abstract.c:1725
#29 0x808d4e6 in PyImport_Import
(module_name=0x810f5a8) at Python/import.c:2048
#30 0x808dc53 in PyImport_ImportModule (name=0x80d6ea3
"site") at Python/import.c:1574
#31 0x809448b in initsite () at Python/pythonrun.c:443
#32 0x8092812 in Py_Initialize () at Python/pythonrun.c:173
#33 0x8053387 in Py_Main (argc=4, argv=0xbffffb54) at
Modules/main.c:322
#34 0x8052dca in main (argc=4, argv=0xbffffb54) at
Modules/python.c:10
#35 0x400699cb in __libc_start_main (main=0x8052db4
<main>, argc=4, argv=0xbffffb54, init=0x80521e4 <_init>, 
    fini=0x80cbed4 <_fini>, rtld_fini=0x4000aea0
<_dl_fini>, stack_end=0xbffffb4c)
    at ../sysdeps/generic/libc-start.c:92
y_Initialize () at Python/pythonrun.c:173

(gdb) print u
$1 = (PyObject *) 0x0


----------------------------------------------------------------------

>Comment By: Whit Blauvelt (whit)
Date: 2002-06-05 12:30

Message:
Logged In: YES 
user_id=133413

Turns out that the bad compile was the first sign of memory
starting to fail. Swapped in other memory and Python built
well. Sorry to trouble you all on this.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-06-04 19:02

Message:
Logged In: YES 
user_id=33168

I'm really grasping here, but here are some more things to try:

Use python -S to start (since that's all that works):

Try each of these lines (if one crashes, restart and try a
different one):
    import os
    import site
    # the following 3 lines need to be done in order
    x = [1, 2, 3]
    x[1] = 5
    del x[1]

If you paste these lines into a .gdbinit file (or into gdb),
you can find out where in the python source the program
crashes:

    define ppystack
        while $pc < Py_Main || $pc > Py_GetArgcArgv
            if $pc > eval_frame && $pc < PyEval_EvalCodeEx
                set $__fn = PyString_AsString(co->co_filename)
                set $__n = PyString_AsString(co->co_name)
                printf "%s (%d): %s\n",  $__fn, f->f_lineno,
$__n
            end
            up-silently 1
        end
        select-frame 0
    end

then in gdb, type ppystack.  That may provide more info.
Good luck.


----------------------------------------------------------------------

Comment By: Whit Blauvelt (whit)
Date: 2002-06-04 11:35

Message:
Logged In: YES 
user_id=133413

Deleting .pyc files does not help.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-06-04 06:30

Message:
Logged In: YES 
user_id=6656

One thing to try is deleting .pyc files.  I don't think that'll help, 
but it might...


----------------------------------------------------------------------

Comment By: Whit Blauvelt (whit)
Date: 2002-06-03 22:39

Message:
Logged In: YES 
user_id=133413

Compiler: gcc version 2.95.3 20010315 (release) (built from tar)
Clean build: pretty much, but see closed bug 535545 (using a
slightly modified       configure file courtesy of Martin v.
Loewis)
Other packages: yes many, no problems
"python -S": yes, a prompt!
Do anything?: I don't really speak Python - something you
can suggest?
Other versions: Yes, 1.5.2 (same compiler); also 2.2.1rc
(forget which), which built fine after correcting
configure's error noted in bug 535545 - whereas this version
dumped core at the step of the make process quoted above
(/python -E ./setup.py build)

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-06-03 21:20

Message:
Logged In: YES 
user_id=33168

What compiler & version are you using?
Did you start from a clean build?
Have you used the compiler for other packages?
If you start python -S, does that get a prompt?
If so, can you do anything?
Have you successfully built any other versions of Python on
this machine?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=563598&group_id=5470