473,404 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

How to find cause for Python/Pythonwin crash only on Dual Core Machines?

There is a strange freeze/crash only on dual core machines:

I have a python app (Python 2.3.5 /Pythonwin build 203 / Windows)
running with no stability problems on normal machines (Or a crash is so
rare, that absolutely nobody obverses it, though the overall majority of
users uses single core machines). Threads, network & pythonwin/win32ui
all in use.

Yet, from 3 users, _all_ using a Dual Processor System (XEON, amd x2
3800+) computer, I have reports, that the application freezes hard
and/or crashes with a kind of random stack dump (operating system). I
cannot experiment with those machines.

I found no hints other than:

http://groups.google.de/group/comp.l...9b147e870bd5e6

http://sourceforge.net/tracker/?grou...ail&aid=480325

... both discussions remaining in uncertainty.

Are there (known) problems with Python/Pythonwin specific for dual
core's (py2.3.5 / pywin203) ?

What could I do to find the problem?

Robert
--------------

PS: there is very little C extension-code (SWIG) involved, yet I looked
over that so often, I guess its save:
//

#include "stdafx.h"
#include "commctrl.h"
#include "ext.h"

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}

class CAllowThreads {
public:
PyThreadState *_save; \
CAllowThreads() {
_save = PyEval_SaveThread();
}
~CAllowThreads() {
PyEval_RestoreThread(_save);
}
};

PyObject* PyListView_GetSubItemRect(
HWND hwndLV,
int iItem,
int iSubItem,
int code
// LPRECT lpRect
)
{
RECT r;
{
CAllowThreads _t;
ListView_GetSubItemRect(
hwndLV,
iItem,
iSubItem,
code,
&r );
}
return Py_BuildValue("iiii", r.left,r.top,r.right,r.bottom);

}

int GetStringAddr(const char* s) {
return (int)s;
}

int PlaySoundResource(int resid, HMODULE hmod)
{
CAllowThreads _t;
return PlaySound(MAKEINTRESOURCE(resid), hmod, SND_RESOURCE);
}

int PlaySoundFile(const char* fname, int flag)
{
CAllowThreads _t;
return PlaySound(fname, NULL, flag);
}

PyObject* py_ToolTipRelayMsg( PyObject* self, PyObject* args )
{
MSG msg;
HWND hwTT;
if(!PyArg_ParseTuple(args,"i(iiiii(ii)):ToolTipRel ayMsg",
&hwTT,

&msg.hwnd,&msg.message,&msg.wParam,&msg.lParam,&ms g.time,
&msg.pt, ((int*)&msg.pt)+1) )
return NULL;
{
CAllowThreads _t;
SendMessage(hwTT,TTM_RELAYEVENT,0,(LPARAM)&msg);
}

Py_INCREF( Py_None );
return Py_None;
}

---

"GetStringAddress" is used only once like this (leades to correct NUL
termination I think):

self.sb.SendMessage(commctrl.SB_SETTEXT,iPane,exte nsion.GetStringAddr(text))

--- swig:
static PyObject *_wrap_GetStringAddr(PyObject *self, PyObject *args) {
PyObject *resultobj;
char *arg0 ;
int result ;

if(!PyArg_ParseTuple(args,(char *)"s:GetStringAddr",&arg0)) return
NULL;
result = (int )GetStringAddr((char const *)arg0);
resultobj = PyInt_FromLong((long)result);
return resultobj;
}
Mar 2 '06 #1
2 2303
robert wrote:
There is a strange freeze/crash only on dual core machines:

I have a python app (Python 2.3.5 /Pythonwin build 203 / Windows)
running with no stability problems on normal machines (Or a crash is so
rare, that absolutely nobody obverses it, though the overall majority of
users uses single core machines). Threads, network & pythonwin/win32ui
all in use.

Yet, from 3 users, _all_ using a Dual Processor System (XEON, amd x2
3800+) computer, I have reports, that the application freezes hard
and/or crashes with a kind of random stack dump (operating system). I
cannot experiment with those machines.

I found no hints other than:

http://groups.google.de/group/comp.l...9b147e870bd5e6
http://sourceforge.net/tracker/?grou...ail&aid=480325
.. both discussions remaining in uncertainty.

Are there (known) problems with Python/Pythonwin specific for dual
core's (py2.3.5 / pywin203) ?

What could I do to find the problem?

Robert
--------------

PS: there is very little C extension-code (SWIG) involved, yet I looked
over that so often, I guess its save:
//

#include "stdafx.h"
#include "commctrl.h"
#include "ext.h"

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}

class CAllowThreads {
public:
PyThreadState *_save; \
CAllowThreads() {
_save = PyEval_SaveThread();
}
~CAllowThreads() {
PyEval_RestoreThread(_save);
}
};

PyObject* PyListView_GetSubItemRect(
HWND hwndLV,
int iItem,
int iSubItem,
int code
// LPRECT lpRect
)
{
RECT r;
{
CAllowThreads _t;
ListView_GetSubItemRect(
hwndLV,
iItem,
iSubItem,
code,
&r );
}
return Py_BuildValue("iiii", r.left,r.top,r.right,r.bottom);

}

int GetStringAddr(const char* s) {
return (int)s;
}

int PlaySoundResource(int resid, HMODULE hmod)
{
CAllowThreads _t;
return PlaySound(MAKEINTRESOURCE(resid), hmod, SND_RESOURCE);
}

int PlaySoundFile(const char* fname, int flag)
{
CAllowThreads _t;
return PlaySound(fname, NULL, flag);
}

PyObject* py_ToolTipRelayMsg( PyObject* self, PyObject* args )
{
MSG msg;
HWND hwTT;
if(!PyArg_ParseTuple(args,"i(iiiii(ii)):ToolTipRel ayMsg",
&hwTT,

&msg.hwnd,&msg.message,&msg.wParam,&msg.lParam,&ms g.time,
&msg.pt, ((int*)&msg.pt)+1) )
return NULL;
{
CAllowThreads _t;
SendMessage(hwTT,TTM_RELAYEVENT,0,(LPARAM)&msg);
}

Py_INCREF( Py_None );
return Py_None;
}

---

"GetStringAddress" is used only once like this (leades to correct NUL
termination I think):

self.sb.SendMessage(commctrl.SB_SETTEXT,iPane,exte nsion.GetStringAddr(text))
--- swig:
static PyObject *_wrap_GetStringAddr(PyObject *self, PyObject *args) {
PyObject *resultobj;
char *arg0 ;
int result ;

if(!PyArg_ParseTuple(args,(char *)"s:GetStringAddr",&arg0)) return
NULL;
result = (int )GetStringAddr((char const *)arg0);
resultobj = PyInt_FromLong((long)result);
return resultobj;
}


I've run on Dual 1.7, 2.4Ghz Xeon machines and a hyperthreaded
3.0Ghz machine for several years with no problems. I don't think
there is an inherent problem.

-Larry Bates
Mar 3 '06 #2
I believe the problem exists with any processor that supports
hardware-based data execution prevention (DEP).
Goto
Control Panel - System - Advanced tab - Performance Settings - DEP tab.
Turn on DEP for all ... except those I select:
Add the Pythonwin.exe to the list.

Now it should work.

-D

Larry Bates wrote:
robert wrote:
There is a strange freeze/crash only on dual core machines:


I've run on Dual 1.7, 2.4Ghz Xeon machines and a hyperthreaded
3.0Ghz machine for several years with no problems. I don't think
there is an inherent problem.

-Larry Bates


Mar 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Pierre Rouleau | last post by:
Hi all! I am using Python 2.3.1 on Win32 (NT, 2000). Whenever a file imports the standard tempfile module, Python 2.3.1 issues the following warning: C:\Python23\lib\fcntl.py:7:...
2
by: webwarrior | last post by:
Hi, Is there a reason why we have to pay more for licensing for a different kind of processor? Why are we not charged for the Hyperthreading on some processors also. If Oracle is really...
2
by: bruce_brodinsky | last post by:
Don't know whether to post this on a hardware or software board, so here goes: I wrote a c# chess program which searches for checkmate. Now, it's single-threaded. But I was thinking. I just got...
16
by: PyDenis | last post by:
Today, I found strange error while using py2exe: 1. I wrote simple program and save as 1.py: import win32ui import win32con win32ui.MessageBox('Test messageBox.' , 'Test', win32con.MB_OK |...
5
by: robert | last post by:
Simple Python code obviously cannot use the dual core by Python threads. Yet, a program drawing CPU mainly for matrix computations - preferably with Numeric/SciPy - will this profit from a dual...
43
by: parallelpython | last post by:
Has anybody tried to run parallel python applications? It appears that if your application is computation-bound using 'thread' or 'threading' modules will not get you any speedup. That is because...
15
by: Woody Ling | last post by:
I am starting to config a 64 bits DB2 in IBM 595 AIX box with 2 dual core CPU and I would like to assigned one 'processor' for one db partition. Should I config it as a 4 nodes or 2 nodes...
3
by: Paul Sijben | last post by:
I am running a multi-threaded python application in a dual core intel running Ubuntu. I am using python 2.5.1 that I compiled myself. At random points I am getting segmentation faults (sometimes...
33
by: llothar | last post by:
I'm afraid that the GIL is killing the usefullness of python for some types of applications now where 4,8 oder 64 threads on a chip are here or comming soon. What is the status about that for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.