[wx-dev] Re: WxGrid memory leak in wxpython2.7.1 and 2.8 on a dual core processor system

Without showing him the car.

Thanks Andrea,
VZ

···

On Thu, 24 Jan 2008 09:28:07 +0000 Andrea Gavana <andrea.gavana@gmail.com> wrote:

It's like going to the car rapair guy and say: "The car is broken. Fix
it." :smiley:

Hello All,

We used wxgrid of wxPython-2.8.7.1 in a GUI application we got memory
access violation error while executing. Earlier we posted the below message
specifying the issue but we couldn't send the code as it cannot be
independently executed to reproduce the error and also the error is not
repeatable.
So, in order to locate the problem, we have built debug versions of python
and wxpython. When we run the GUI using python_d.exe, after some time (this
time is varying in different runs) the application crashes displaying the
message 'Unhandled Exception in wxmsw28d_adv_vc.dll: Access Violation
reading 0xfeeeff0e'. It's breaking at
wxmsw28d_adv_vc.dll!wxGridCellAttr::HasBackgroundColour().The function
HasBackgroundColour calls m_colBack.OK() but m_defGridAttr, m_colBack are
somehow getting nullified (observed values in the watch window) and so the
call for m_colBack.OK() crashes the application. This HasBackgroundColour()
call was successful for many times before the above explained instance of
the crash.
When we observed the disassembly after the crash, a reference was made to
the location 0xFEEEFEEE which Microsoft uses to mark the storage area of a
deleted class in debug mode. We couldn't understand when and how that
m_colBack is getting deleted.
I'm also attaching ' screenshotsAndCode.zip' having the screenshots of the
callStack, watchwindows, disassembly and some pieces of code for reference.
The script 'CDTimer.py' contains the timer we use. 'SetCellValue' method of
wxGrid is used in this timer to update the grid. The script
'simulationPanel.py' contains the creation of grid which is only a part of
the GUI.
Does anyone have any idea regarding this issue?
Any help would be greatly appreciated.

Thanks,
Gayatri

screenshotsAndCode.zip (332 KB)

···

On Jan 24, 2008 5:57 AM, Gayatri wrote:

Hi,
I have been using wxpython since its 2.4 version. The GUI in our
application is implemented using wxgrid which gets updated with values
for every second with a timer. In the GUI, wxGrid is added to a
notebook, the notebook is then added to a panel and panel is then
added to a Main frame along with few other panels.

After executing for some time the application is crashing with memory
leak error in wxMsw28h_ADV_VC.dll

The error in the message dialog is "so and so instruction referenced
memory at so and so and the memory could'nt be read or write". After
debugging, the stack is showing memory problem in wxMsw28h_ADV_VC dll.

The problem remains same with wx-python2.7 and also with wx-python2.8

This error is observed on dual core processor system.

Os on my system is XP having python 2.5

I would like to know whether this is a problem due to dual core
processor or a bug in wxGrid.

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Thursday, January 24, 2008 11:30 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Re: [wx-dev] Re: [wxPython-users] WxGrid
memory leak in wxpython2.7.1 and 2.8 on a dual core processor system

Vadim Zeitlin wrote:

On Thu, 24 Jan 2008 09:28:07 +0000 Andrea Gavana <andrea.gavana@gmail.com> wrote:

> It's like going to the car rapair guy and say: "The car is broken. Fix
> it." :smiley:

Without showing him the car.

Or, "My broken car is in a garage in some other part of the world. Fix it."

:slight_smile:

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Gayatri wrote:

Hello All,

We used wxgrid of wxPython-2.8.7.1 in a GUI application we got memory
access violation error while executing. Earlier we posted the below message
specifying the issue but we couldn't send the code as it cannot be
independently executed to reproduce the error and also the error is not
repeatable.

Try approaching it from the other direction. Progressively disable, comment-out, or remove portions of the code until the problem no longer happens. That will let you know what to focus on for narrowing it down further and for reproduction. For example, you might start out by commenting out anything your code is doing with GridCellAttribute objects.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

When I am using wxgrid of wxpython 2.8.7 with python 2.5.1 my application is
crashing either
at wxGridCellWorker incRef() or at wxstringtokenizer Getnexttoken() or at
drawcell of wxgrid

We are able to get errors with our sample application too, which is more or
less similar to our application.
The application is using xmlrpc calls to get data from server server.py and
updates grid with values.
This crash is not predictable and is not happening always.

To reproduce error
  1.Keep all files in one folder
  2.Run the server.py
  3.Run SimulationGUIApp
  4.using file menu loadconfiguration option load test.pkl file.
Ignore all other menu/toolbar options.

It may/may not crash if executed only one time.

We are using python2.5.1, wxpython 2.8.7 debug versions.
The crash is observed only on dual core systems.

Thanks for any help.

Gayatri

testSimulationGui.zip (16.5 KB)

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Saturday, February 16, 2008 5:24 AM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Re: [wx-dev] Re: [wxPython-users] WxGrid
memory leak in wxpython2.7.1 and 2.8 on a dual core processor system

Gayatri wrote:

Hello All,

We used wxgrid of wxPython-2.8.7.1 in a GUI application we got memory
access violation error while executing. Earlier we posted the below

message

specifying the issue but we couldn't send the code as it cannot be
independently executed to reproduce the error and also the error is not
repeatable.

Try approaching it from the other direction. Progressively disable,
comment-out, or remove portions of the code until the problem no longer
happens. That will let you know what to focus on for narrowing it down
further and for reproduction. For example, you might start out by
commenting out anything your code is doing with GridCellAttribute objects.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Hello All,

We used wxgrid of wxPython-2.8.7.1 in a GUI application we got memory
access violation error while executing. Earlier we posted the below message
specifying the issue but we couldn't send the code as it cannot be
independently executed to reproduce the error and also the error is not
repeatable.
So, in order to locate the problem, we have built debug versions of python
and wxpython. When we run the GUI using python_d.exe, after some time (this
time is varying in different runs) the application crashes displaying the
message 'Unhandled Exception in wxmsw28d_adv_vc.dll: Access Violation
reading 0xfeeeff0e'. It's breaking at
wxmsw28d_adv_vc.dll!wxGridCellAttr::HasBackgroundColour().The function
HasBackgroundColour calls m_colBack.OK() but m_defGridAttr, m_colBack are
somehow getting nullified (observed values in the watch window) and so the
call for m_colBack.OK() crashes the application. This HasBackgroundColour()
call was successful for many times before the above explained instance of
the crash.
When we observed the disassembly after the crash, a reference was made to
the location 0xFEEEFEEE which Microsoft uses to mark the storage area of a
deleted class in debug mode. We couldn't understand when and how that
m_colBack is getting deleted.
I'm also attaching ' screenshotsAndCode.zip' having the screenshots of the
callStack, watchwindows, disassembly and some pieces of code for reference.
The script 'CDTimer.py' contains the timer we are use. 'SetCellValue' method
is used in this timer to update the grid. The script 'simulationPanel.py'
contains the creation of grid which is a part of the GUI.
Does anyone have any ideas regarding this issue?
Any help would be greatly appreciated.

Thanks,
Gayatri

screenshotsAndCode.zip (332 KB)

···

On Jan 24, 2008 5:57 AM, Gayatri wrote:

Hi,
I have been using wxpython since its 2.4 version. The GUI in our
application is implemented using wxgrid which gets updated with values
for every second with a timer. In the GUI, wxGrid is added to a
notebook, the notebook is then added to a panel and panel is then
added to a Main frame along with few other panels.

After executing for some time the application is crashing with memory
leak error in wxMsw28h_ADV_VC.dll

The error in the message dialog is "so and so instruction referenced
memory at so and so and the memory could'nt be read or write". After
debugging, the stack is showing memory problem in wxMsw28h_ADV_VC dll.

The problem remains same with wx-python2.7 and also with wx-python2.8

This error is observed on dual core processor system.

Os on my system is XP having python 2.5

I would like to know whether this is a problem due to dual core
processor or a bug in wxGrid.