Crash in a py2exe'd version

I thought my fix of including msvcp71.dll in the dist would fix it everywhere, but there is a user on Windows XP (Danish) who gets this error:

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

Anyone can explain what this is about and what could cause it?

Note that this is only shown in the "console" version of the py2exe'd application, the "windows" version just crashes "quietly" :frowning: .

Werner

The full error the user sees is this:

Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x0000007h (there is not enough memory to execute this command) [Wotans remark: The contents of the last parenthesis is translated from Danish]

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

The first one in helpers.cpp I see on my XP machine too, however not the second one.

If I read the following C++ correctly:
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/tags/WX_2_8_10/src/msw/control.cpp?revision=59585&view=markup

There is a class "Edit" which can not create the Window, but I don't have such a class in my code and I can't find anything in wxPython either.

Can anyone shed some light on this what might be the cause of this.

Werner

···

On 22/03/2010 20:13, werner wrote:

I thought my fix of including msvcp71.dll in the dist would fix it everywhere, but there is a user on Windows XP (Danish) who gets this error:

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

Anyone can explain what this is about and what could cause it?

Note that this is only shown in the "console" version of the py2exe'd application, the "windows" version just crashes "quietly" :frowning: .

Hi Werner,

can you post an example code which explains how reproduce the problem ?

···

2010/3/23 werner <wbruhin@free.fr>:

On 22/03/2010 20:13, werner wrote:

I thought my fix of including msvcp71.dll in the dist would fix it
everywhere, but there is a user on Windows XP (Danish) who gets this error:

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in
control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

Anyone can explain what this is about and what could cause it?

Note that this is only shown in the "console" version of the py2exe'd
application, the "windows" version just crashes "quietly" :frowning: .

The full error the user sees is this:

Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x0000007h
(there is not enough memory to execute this command) [Wotans remark: The
contents of the last parenthesis is translated from Danish]

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in
control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

The first one in helpers.cpp I see on my XP machine too, however not the
second one.

If I read the following C++ correctly:
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/tags/WX_2_8_10/src/msw/control.cpp?revision=59585&view=markup

There is a class "Edit" which can not create the Window, but I don't have
such a class in my code and I can't find anything in wxPython either.

Can anyone shed some light on this what might be the cause of this.

Werner

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

To unsubscribe from this group, send email to
wxpython-users+unsubscribegooglegroups.com or reply to this email with the
words "REMOVE ME" as the subject.

--
EXPO - Hardware solution, Software revolution

Esposti Daniele
Via Aldo Moro, 14/h
20085 - Locate di Triulzi (MI)
Cell +39 347 0748470

Hi Daniele,

Hi Werner,

can you post an example code which explains how reproduce the problem ?
   

I wish I could :frowning: , this is happening only on a customer machine (actually it is even worse, he is trying out my shareware application - http://thewinecellarbook.com/enigma/dls/setup-twcb_3.1.697.9.exe - and can't get it to run on his computer) and I assume he is in Denmark (Danish).

Werner

···

On 23/03/2010 12:58, Daniele Esposti wrote:

2010/3/23 werner<wbruhin@free.fr>:
   

On 22/03/2010 20:13, werner wrote:
     

I thought my fix of including msvcp71.dll in the dist would fix it
everywhere, but there is a user on Windows XP (Danish) who gets this error:

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in
control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

Anyone can explain what this is about and what could cause it?

Note that this is only shown in the "console" version of the py2exe'd
application, the "windows" version just crashes "quietly" :frowning: .

The full error the user sees is this:

Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x0000007h
(there is not enough memory to execute this command) [Wotans remark: The
contents of the last parenthesis is translated from Danish]

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in
control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

The first one in helpers.cpp I see on my XP machine too, however not the
second one.

If I read the following C++ correctly:
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/tags/WX_2_8_10/src/msw/control.cpp?revision=59585&view=markup

There is a class "Edit" which can not create the Window, but I don't have
such a class in my code and I can't find anything in wxPython either.

Can anyone shed some light on this what might be the cause of this.

Werner

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

To unsubscribe from this group, send email to
wxpython-users+unsubscribegooglegroups.com or reply to this email with the
words "REMOVE ME" as the subject.

I thought my fix of including msvcp71.dll in the dist would fix it
everywhere, but there is a user on Windows XP (Danish) who gets this
error:

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in
control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

Anyone can explain what this is about and what could cause it?

Note that this is only shown in the "console" version of the py2exe'd
application, the "windows" version just crashes "quietly" :frowning: .

The full error the user sees is this:

Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x0000007h
(there is not enough memory to execute this command) [Wotans remark: The
contents of the last parenthesis is translated from Danish]

This is a separate issue from below, and it isn't as critical. The app should continue fine with it, but perhaps without themed controls.

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in
control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

The first one in helpers.cpp I see on my XP machine too, however not the
second one.

If I read the following C++ correctly:
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/tags/WX_2_8_10/src/msw/control.cpp?revision=59585&view=markup

There is a class "Edit" which can not create the Window, but I don't
have such a class in my code and I can't find anything in wxPython either.

"Edit" means it's a wx.TextCtrl. That's the widget's window class in the win32 API sense of the word, not C++ or Python. "wxWindowClassNR" is one of the names that wx registers as a window class as well, and it is used to "subclass" the stock window classes so the wx code can catch the window messages and turn them into events, etc.

That said, I'm not sure what would cause it to fail.

···

On 3/23/10 4:43 AM, werner wrote:

On 22/03/2010 20:13, werner wrote:

--
Robin Dunn
Software Craftsman

Hi Robin,

...

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in
control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

The first one in helpers.cpp I see on my XP machine too, however not the
second one.

If I read the following C++ correctly:
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/tags/WX_2_8_10/src/msw/control.cpp?revision=59585&view=markup

There is a class "Edit" which can not create the Window, but I don't
have such a class in my code and I can't find anything in wxPython either.

"Edit" means it's a wx.TextCtrl. That's the widget's window class in the win32 API sense of the word, not C++ or Python. "wxWindowClassNR" is one of the names that wx registers as a window class as well, and it is used to "subclass" the stock window classes so the wx code can catch the window messages and turn them into events, etc.

That at least explains why it crashes so early on.

That said, I'm not sure what would cause it to fail.

Could it have to do with some msvcXX.dll or gdiplus.dll issue? I.e. one not found or an incorrect version found?

BTW, when and for what is gdiplus.dll used?

Werner

···

On 25/03/2010 08:15, Robin Dunn wrote:

Hi Robin,

...

Error: Can't create window of class wxWindowsClass NR
Debug: ..\..\src\control.cpp(159): assert"wxAssertFailures" failed in
control::MSWCreateControl():Create
WindowEX("Edit", flags=52211844,ex=00000200) failed.

The first one in helpers.cpp I see on my XP machine too, however not the
second one.

If I read the following C++ correctly:
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/tags/WX_2_8_10/src/msw/control.cpp?revision=59585&view=markup

There is a class "Edit" which can not create the Window, but I don't
have such a class in my code and I can't find anything in wxPython
either.

"Edit" means it's a wx.TextCtrl. That's the widget's window class in
the win32 API sense of the word, not C++ or Python. "wxWindowClassNR"
is one of the names that wx registers as a window class as well, and
it is used to "subclass" the stock window classes so the wx code can
catch the window messages and turn them into events, etc.

That at least explains why it crashes so early on.

That said, I'm not sure what would cause it to fail.

Could it have to do with some msvcXX.dll or gdiplus.dll issue?

Probably not, this is lower-level than those libraries. It's part of the core of how Windows works, but I don't know enough to know what to do about it. Perhaps there is some resource problem on the system and so it's not able to allocate additional window handles or something?

BTW, after looking at the code a bit more I realized that there are actually two errors above, not just one. The "wxWindowClassNR" is probably a frame or panel, and the "Edit" is a wx.TextCtrl as I said before. But it's the same basic failure under the covers, the CreateWindowEx API is failing.

BTW, when and for what is gdiplus.dll used?

It provides the GDI+ library which is what wx.GraphicsContext and the related classes are built upon on Windows.

···

On 3/25/10 2:11 AM, werner wrote:

On 25/03/2010 08:15, Robin Dunn wrote:

--
Robin Dunn
Software Craftsman

Robin,

Hi Robin,

...

Probably not, this is lower-level than those libraries. It's part of the core of how Windows works, but I don't know enough to know what to do about it. Perhaps there is some resource problem on the system and so it's not able to allocate additional window handles or something?

BTW, after looking at the code a bit more I realized that there are actually two errors above, not just one. The "wxWindowClassNR" is probably a frame or panel, and the "Edit" is a wx.TextCtrl as I said before. But it's the same basic failure under the covers, the CreateWindowEx API is failing.

googled a bit on resource issues with XP and came accross the "application verifier" (AV) tool from Microsoft.

http://www.microsoft.com/downloads/details.aspx?FamilyID=c4a25ab9-649d-4a1b-b4a7-c9d8b095df18&displaylang=en

This is usable on XP and higher (tried it on XP and Win 7).

It has a setting to test an application with "Low resources simulation", so I did a few tests.

- Python command line is fine
- Python and Idle crashes (hard, no exception shown)
- wxPython demo crashes (hard, no exception shown)
- my own application crashes - exception MemoryError during the import/initialization of model.py (SQLAlchemy)

After using AV don't forget to remove whatever .exe you monitor with it from it's list otherwise it keeps on monitoring the .exe even if AV is not running.

It would be nice if the crashes would be a bit "more user friendly", but this is probably so low down in the system that this is more an MS Windows issue then anything else.

Anyhow all this is just FYI - find it interesting and it confirms/points to a resource problem on the users machine.

Werner

···

On 25/03/2010 22:44, Robin Dunn wrote:

On 3/25/10 2:11 AM, werner wrote: