472,784 Members | 992 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,784 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 2251
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.