This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Random core dumps
Type: Stage:
Components: Interpreter Core Versions: Python 2.2
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: georg.brandl, munder12, mwh, ncoghlan, nnorwitz, tim.peters
Priority: normal Keywords:

Created on 2004-11-10 16:50 by munder12, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Pyth.txt munder12, 2004-11-10 16:50 Python scripts and gdb core analysis
pytest2.py munder12, 2004-11-11 15:21 Python driver script
pytest.py munder12, 2004-11-11 15:22 Python script that randomly cores
2.4b2.txt munder12, 2004-11-11 16:08 gdb core analysis for Python 2.4b2
Messages (14)
msg23086 - (view) Author: munder12 (munder12) Date: 2004-11-10 16:50
I have narrowed it down as far as I can by continuing
to make the problem simpler and simpler but where it
still core dumps.

The way this is set up is the following:

pytest2.py and pytest.py are in the same directory.

pytest3.py is in PYTHONPATH where PYTHONPATH is
<abs_path>/BASE:<abs_path>/SUP  (pytest3.py is in BASE).


Run ./pytest2.py several times.
This current problem core dumps on average about 2
times every 5 runs.

I have attached a file that has the Python listings as
well as the gdb traceback.

This is running under Fedora Core 1 with:

Python 2.2.3 (#1, Oct 15 2003, 23:33:35)
[GCC 3.3.1 20030930 (Red Hat Linux 3.3.1-6)] on linux2

Thank you,
Mark

PS  Strangely enough the comments in pytest.py seem to
actually increase the frequency of core dumps.
msg23087 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-11-11 14:47
Logged In: YES 
user_id=6656

Have you tried a more recent Python?

I'm finding decoding your report (attempting to reproduce) a
little challenging.  Could you upload a tarball containing a
shell script driver or something?
msg23088 - (view) Author: munder12 (munder12) Date: 2004-11-11 15:25
Logged In: YES 
user_id=1156202

I have played some more with the setup.  Now only pytest2.py
and pytest.py need to be present in same directory.

Running pytest2.py will randomly cause core dumps coming
from pytest.py.

If you run pytest.py enough times directly it also will
randomly core.

I have attached pytest.py and pytest2.py.

I have not tried with any other version of Python yet.
msg23089 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-11-11 15:34
Logged In: YES 
user_id=6656

Uh, if that tiny thing cores, I'm very much inclined to
believe there's something flaky in your setup.
msg23090 - (view) Author: munder12 (munder12) Date: 2004-11-11 16:05
Logged In: YES 
user_id=1156202

I have checked out and built Python 2.4b2.  It still core
dumps on these same files but it now takes on average about
8 runs to get 2 cores.

I will attach the 2.4b2 core traceback.
msg23091 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-11-16 08:38
Logged In: YES 
user_id=6656

Hmm.  The traceback shows that it's dumping core while loading 
the site.pyc file from the disk.  This happens before Python begins 
executing whatever code you've asked it to.  You could try 
deleting the site.pyc file and see if that makes any difference, or 
running python -S.

I still think there must be something odd about your setup.  If 
Python 2.4b2 cored 25% of the time it was launched, someone 
else would have noticed by now :)
msg23092 - (view) Author: munder12 (munder12) Date: 2004-11-17 00:47
Logged In: YES 
user_id=1156202

It is 2 times out of 8 runs of the main script.  Actually, that is 
2 cores out of 1600 runs of the script that really cores.  It 
does seem to be localized to Fedora Core 1.  Fedora Core 2, 
Win 2000, Win XP, and Mandrake 9 on similar hardware do not 
have the problem with these scripts.

The Python 2.4b2 is straight out of the tarball (compiled and 
installed cleanly).  The core dumps occur randomly with 
posixpath.py, site.py, etc. and at different stages (robject() 
and within fstat() (from /usr/include/sys/stat.h)).
msg23093 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-11-17 00:54
Logged In: YES 
user_id=31435

At this point, it would be prudent to write the same kind of 
program in straight C, and test that.  The more you find out, 
the less it appears that Python has something to do with 
what you're seeing.  Note that it's not unusual to discover 
OS, compiler, and platform C library bugs by running Python 
programs, simply because Python builds on all of them.
msg23094 - (view) Author: munder12 (munder12) Date: 2004-11-17 17:00
Logged In: YES 
user_id=1156202

I have written a program in C that just opens and closes a
file repeatedly.  It appears to work fine.  But, there
appears to be much more that Python is doing behind the
scenes than what my script is explicitly directing (open and
close the file).  Since I'm not sure what all OS related
calls Python is making when opening, say, "site.py," I'm not
quite sure how I can write a C code that mimics what Python
is doing.

It may well be that the OS is the culprit.  However, it also
could be that, in the Python code itself, some error
checking is not being performed on all OS calls as they
should be since they so rarely fail on a mjority of OS's. 
Or, extra try...catch blocks maybe could be added to retry
the OS call(s) that is "incorrectly" failing on Fedora Core
1 so that Python maintains its portability with (hopefully)
minimal speed impact.
msg23095 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2004-11-23 09:15
Logged In: YES 
user_id=1038590

I'm not sure it's relevant, but I once had a similar problem
with Python flakiness that turned out to be due to some old
.pyc files lying around (this was Fedora Core 3-test 1, and
the offending files were in my Python CVS build directory).

For whatever reason, Python wasn't picking up the version
mismatch and was trying to use the old .pyc files. Seg
faults abounded as a result.

One thought: could root ownership of pre-generated .pyc's
have that effect? (I don't know how Python reacts if it
can't delete the .pyc's)
msg23096 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-10-03 06:42
Logged In: YES 
user_id=33168

I can't reproduce on current CVS (2.5).  Can anyone
reproduce this now?  Should this be closed?
msg23097 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-10-03 09:15
Logged In: YES 
user_id=1188172

I'd say that it can be closed. As mwh says: "If Python 2.4b2
cored 25% of the time it was launched, someone else would
have noticed by now :)"
msg23098 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-11-15 06:55
Logged In: YES 
user_id=33168

munder12, if you are still having problems let us know.  I'm
closing this as not reproducible.
msg23099 - (view) Author: munder12 (munder12) Date: 2005-11-16 00:09
Logged In: YES 
user_id=1156202

I'm no longer on Fedora Core 1 and cannot tell if this has 
been fixed on that system or not.  I do not have the 
problem on Fedora Core 3.
History
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41162
2004-11-10 16:50:34munder12create