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.

Title: Python 2.4 crashes
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: axel_kaiser, doerwalter, loewis, rhettinger, salyee, tds333
Priority: normal Keywords:

Created on 2004-12-12 09:25 by axel_kaiser, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
drwtsn32.log axel_kaiser, 2004-12-15 20:58 Dr. Watson log file axel_kaiser, 2004-12-16 13:56 Zip with two demo files for the crash
Messages (10)
msg23661 - (view) Author: Axel Kaiser (axel_kaiser) Date: 2004-12-12 09:25
The new Python 2.4 crashes when starting some of my
programs. This happens under win xp as well as under
win nt. The crashes are reproduceble, but I didn't
succeed in finding the exact place where it happens.

In the attachment you find a Dr. Watson logfile. I hope
it helps. Otherwise I think I will be able to help with
more information.

Thanks in advance

Axel Kaiser
msg23662 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-12-12 09:56
Logged In: YES 

The attachment didn't make it.
Be sure to check the upload box or it won't make it.
msg23663 - (view) Author: salyee (salyee) Date: 2004-12-15 06:17
Logged In: YES 

I have the same or similar problem.
While python24.dll(Python 2.4 for Windows) uses msvcr71.dll 
for CRT, host C++ program embeding Python 2.4 as a script 
engine, in my project, is compiled by VC++ 6.0 (msvcrt.dll).
So, the following code snip makes a crash.

FILE* fp = fopen("", "rt"); // uses msvcrt.dll
PyRun_SimpleFile(fp, "; // uses msvcr71.dll 
inside. Cause of a crash.

In my case, I must use VC++ 6.0 and I want clients of my 
program to install Python 2.4 from
How do I solve this problem ?  
msg23664 - (view) Author: Wolfgang Langner (tds333) * Date: 2004-12-15 15:16
Logged In: YES 

The FILE pointer is specific to your c-lib.
Different versions of the ms c-lib have incompatible
implementations of this structure.

To work arround such problems use python to get the right FILE*

Example (not tested):

/* use pythons std c library to produce a FILE object
   to avoid mess with different c libs in debug or release mode
   and different versions used to compile python
      PyObject* pyFile = PyFile_FromString(fileName, "r");

      FILE* const file = PyFile_AsFile(pyFile);
      assert(0 != file);
      const int succ = PyRun_SimpleFile(file, fileName);
      // now remove py file object
msg23665 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-12-15 18:02
Logged In: YES 

Any objections to marking this as Invalid and closing the bug?
msg23666 - (view) Author: Axel Kaiser (axel_kaiser) Date: 2004-12-15 20:58
Logged In: YES 

Sorry, the attachment was not appended. By the way, the
problem  occurs without any external modules/libraries. It
just juses python-source. The problem might be connected
with the use of module array.
msg23667 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-12-15 22:39
Logged In: YES 

Can you create a small test case that demonstrates the problem?
msg23668 - (view) Author: Axel Kaiser (axel_kaiser) Date: 2004-12-16 13:56
Logged In: YES 

Okay, I finally was able to produce a small example. When I 
start python from the commandline with 
file "" python crashes. It doesn't crash 
when I remove the coding-line (1st line) of 
file "".

(The example can't run properly due to missing files, but 
these don't influence the crashes)

Best regards, Axel
msg23669 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2004-12-16 14:34
Logged In: YES 

This sounds like it might be related to bug Can you retry your 
scripts with the patch from What happens if you 
replace the "cp1252" in the encoding header with "iso-8859-

A quick workaround might be to wrap the long source lines in
msg23670 - (view) Author: Axel Kaiser (axel_kaiser) Date: 2004-12-17 12:12
Logged In: YES 

That's it!!! I applied the patch to and now it works 
without crash!

Thanks a lot!

Let's close this thread.
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41312
2004-12-12 09:25:26axel_kaisercreate