[ python-Bugs-1083793 ] Python 2.4 crashes

SourceForge.net noreply at sourceforge.net
Wed Dec 15 16:16:22 CET 2004


Bugs item #1083793, was opened at 2004-12-12 09:25
Message generated for change (Comment added) made by tds33
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1083793&group_id=5470

Category: Python Interpreter Core
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Axel Kaiser (axel_kaiser)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python 2.4 crashes

Initial Comment:
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
Germany

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

Comment By: Wolfgang Langner (tds33)
Date: 2004-12-15 15:16

Message:
Logged In: YES 
user_id=600792

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
      Py_XDECREF(pyFile);

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

Comment By: salyee (salyee)
Date: 2004-12-15 06:17

Message:
Logged In: YES 
user_id=1178573

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("somecode.py", "rt"); // uses msvcrt.dll
PyRun_SimpleFile(fp, "somecode.py); // 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 www.python.org.
How do I solve this problem ?  

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

Comment By: Raymond Hettinger (rhettinger)
Date: 2004-12-12 09:56

Message:
Logged In: YES 
user_id=80475

The attachment didn't make it.
Be sure to check the upload box or it won't make it.

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

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


More information about the Python-bugs-list mailing list