#443 win32ui crash in embedded app (212 -> 213 & 214 regression)

open
nobody
win32 (141)
5
2010-09-30
2009-08-29
Farshid Lashkari
No

I have an application that embeds python and uses the win32ui module. Everything worked fine until I upgraded from 212 to 214. After the upgrade my application crashes on exit. The Visual Studio debugger is showing that the crash is occurring after my application calls CoUninitialize. Here is a rough outline of what my app does:

CoInitialize(NULL)
InitPython()
RunPythonCode() //This code will import win32ui
ClosePython()
CoUninitialize()

Simply importing the win32ui module causes the crash. I don't even need to call any of the modules functions. If I don't import win32ui then my application exits cleanly. I tried downgrading to version 213 but the crash still occurs. Version 212 seems to be the last version that was stable with my application.

Discussion

1 2 > >> (Page 1 of 2)
  • Forgot to mention that I'm using Python 2.4 & 2.6, and both exhibit the same behavior.

     
  • Mark Hammond
    Mark Hammond
    2010-08-30

    • status: open --> pending
     
  • Mark Hammond
    Mark Hammond
    2010-08-30

    I'm going to need either a repo or more details information on the crash.

     
  • Sample program to reproduce error

     
    Attachments
  • I just attached a simple console app that reproduces the issue for me using Python 2.7.

     
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
    • status: pending --> closed
     
  • Mark Hammond
    Mark Hammond
    2010-09-30

    I tried to reproduce this but hit manifest related issues trying python 2.6 - what python version are you using?

     
  • Mark Hammond
    Mark Hammond
    2010-09-30

    • status: closed --> open
     
  • I can reproduce the crash with pywin32-214.win-amd64-py2.6 and main.cpp.

    The following code worked for me when compiled with msvc9 "cl.exe main.cpp /MD /link python26.lib ole32.lib":

    #include "Python.h"
    #include <windows.h>

    int main( int argc, char **argv )
    {
    Py_Initialize();
    CoInitialize(NULL);
    PyRun_SimpleString("import win32ui");
    CoUninitialize();
    Py_Finalize();
    return 0;
    }

     
1 2 > >> (Page 1 of 2)