473,651 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_c all,
LPVOID lpReserved
)
{
return TRUE;
}

class CAllowThreads {
public:
PyThreadState *_save; \
CAllowThreads() {
_save = PyEval_SaveThre ad();
}
~CAllowThreads( ) {
PyEval_RestoreT hread(_save);
}
};

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

}

int GetStringAddr(c onst char* s) {
return (int)s;
}

int PlaySoundResour ce(int resid, HMODULE hmod)
{
CAllowThreads _t;
return PlaySound(MAKEI NTRESOURCE(resi d), hmod, SND_RESOURCE);
}

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

PyObject* py_ToolTipRelay Msg( PyObject* self, PyObject* args )
{
MSG msg;
HWND hwTT;
if(!PyArg_Parse Tuple(args,"i(i iiii(ii)):ToolT ipRelayMsg",
&hwTT,

&msg.hwnd,&msg. message,&msg.wP aram,&msg.lPara m,&msg.time,
&msg.pt, ((int*)&msg.pt) +1) )
return NULL;
{
CAllowThreads _t;
SendMessage(hwT T,TTM_RELAYEVEN T,0,(LPARAM)&ms g);
}

Py_INCREF( Py_None );
return Py_None;
}

---

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

self.sb.SendMes sage(commctrl.S B_SETTEXT,iPane ,extension.GetS tringAddr(text) )

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

if(!PyArg_Parse Tuple(args,(cha r *)"s:GetStringA ddr",&arg0)) return
NULL;
result = (int )GetStringAddr( (char const *)arg0);
resultobj = PyInt_FromLong( (long)result);
return resultobj;
}
Mar 2 '06 #1
2 2321
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_c all,
LPVOID lpReserved
)
{
return TRUE;
}

class CAllowThreads {
public:
PyThreadState *_save; \
CAllowThreads() {
_save = PyEval_SaveThre ad();
}
~CAllowThreads( ) {
PyEval_RestoreT hread(_save);
}
};

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

}

int GetStringAddr(c onst char* s) {
return (int)s;
}

int PlaySoundResour ce(int resid, HMODULE hmod)
{
CAllowThreads _t;
return PlaySound(MAKEI NTRESOURCE(resi d), hmod, SND_RESOURCE);
}

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

PyObject* py_ToolTipRelay Msg( PyObject* self, PyObject* args )
{
MSG msg;
HWND hwTT;
if(!PyArg_Parse Tuple(args,"i(i iiii(ii)):ToolT ipRelayMsg",
&hwTT,

&msg.hwnd,&msg. message,&msg.wP aram,&msg.lPara m,&msg.time,
&msg.pt, ((int*)&msg.pt) +1) )
return NULL;
{
CAllowThreads _t;
SendMessage(hwT T,TTM_RELAYEVEN T,0,(LPARAM)&ms g);
}

Py_INCREF( Py_None );
return Py_None;
}

---

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

self.sb.SendMes sage(commctrl.S B_SETTEXT,iPane ,extension.GetS tringAddr(text) )
--- swig:
static PyObject *_wrap_GetStrin gAddr(PyObject *self, PyObject *args) {
PyObject *resultobj;
char *arg0 ;
int result ;

if(!PyArg_Parse Tuple(args,(cha r *)"s:GetStringA ddr",&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
3816
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: DeprecationWarning: the FCNTL module is Deprecated; please use fcntl DeprecationWarning).
2
2679
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 conserned about the low end business market (small and medium), then they should drop their attitude on Dual Core processors.
2
2479
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 a Dell XPS dual-core machine. If I modify the chess program to use threading, will it take advantage of the dual-core machine? If so, is there any special code (besides .Net threading) that I have to implement? Thanks in advance - Bruce
16
5200
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 | win32con.MB_TOPMOST ) 2. I create 1_setup.py file for py2exe:
5
1906
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 core when using 2 (or more) Python threads? robert
43
4304
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 python interpreter uses GIL(Global Interpreter Lock) for internal bookkeeping. The later allows only one python byte-code instruction to be executed at a time even if you have a multiprocessor computer. To overcome this limitation, I've created...
15
2916
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 instances? How about other setting such as IO cleaner, Default degree etc?
3
1939
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 indicating a duplicate free). Below is the backtrace of the latest segfault. I am thinking this might be an issue related to the dual core CPU so I am now running the app with affinity to one CPU to test this hypothesis.
33
3703
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 the future of python? I know that at the moment allmost nobody in the scripting world has solved this problem, but it bites and it bites hard. Only groovy as a Java Plugin has support but i never tried it. Writing an interpreter that does MT this...
0
8357
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8277
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8803
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6158
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.