473,385 Members | 1,492 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,385 software developers and data experts.

need help with bizarre error caught in debugger. execution is hanging

Any advice on the following would be much appreciated. I have thrown
everything I have at it and am completely stumped. I apologize for the
length, I have tried to be as succint as possible.

I have a pythoncard/wxPython application. The application works well
except that users were reporting occasional crashes. The application
would simply stop and just hang. I was able to reproduce the bug
faithfully and ran the application in the python debugger pdb.py.
The trace is below and I simply cannot understand why it is hanging
where it is. The application gets stuck executing

return len(self.data[0])

This works many many times during the applications execution, indeed
several successful runs of this line are visible immediatley above the
hang. I have also printed out the value of self.data. This is a list
containing 12 inner lists each of length 3 at the point of the hang and
is never larger than that.
What on earth could cause this to stop the interpreter cold in its
tracks without an exception being thrown? CPU usage on the machine is
high throughout the application's execution and stays as such after the
"hang" begins. I eventually kill the app although I have let it run for
a long time and it never leaves this line.
For what its worth, I am using python 2.3 on windows2k.

Anyone have idea what could be happening?

c:\python23\lib\site-packages\wxpython\grid.py(664)_setOORInfo()->None
-> return val
(Pdb) s
--Return--
c:\python23\lib\site-packages\wxpython\grid.py(850)__init__()->None
-> self._setOORInfo(self)
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(17)__init

__()
-> self.data = data
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(18)__init

__()
-> self.colLabels = headings
(Pdb) s
--Return--
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(18)__init

__()->None
-> self.colLabels = headings
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtablegrid.py(15)__

init__()
-> self.colsizes = colsizes
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtablegrid.py(16)__

init__()
-> self.SetTable(table, True)
(Pdb) s
--Call--
c:\python23\lib\site-packages\wxpython\grid.py(993)SetTable()
-> def SetTable(self, *_args, **_kwargs):
(Pdb) s
c:\python23\lib\site-packages\wxpython\grid.py(994)SetTable()

-> val = gridc.wxGrid_SetTable(self, *_args, **_kwargs)
(Pdb) s
--Call--
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(27)GetNumberRows()
-> def GetNumberRows(self):
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(28)GetNumberRows()
-> return len(self.data)
(Pdb) s
--Return--
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(28)GetNumberRows()->12
-> return len(self.data)
(Pdb) s
--Call--
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(30)GetNumberCols()
-> def GetNumberCols(self):
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(31)GetNumberCols()
-> if len(self.data) <= 0:
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(34)GetNumberCols()
-> return len(self.data[0])
(Pdb) s
--Return--
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(34)GetNumberCols()->3
-> return len(self.data[0])
(Pdb) s

Jul 18 '05 #1
3 1478
Why do you do

if len(self.data) <= 0:
return len(self.data[0])

Isn't that a sure IndexError exception?
Maybe you catch it somewhere up the stack and so you keep it silent.

Nir

"omission9" <om*******@invalid.email.info> wrote in message
news:vf*******************@nwrddc01.gnilink.net...
Any advice on the following would be much appreciated. I have thrown
everything I have at it and am completely stumped. I apologize for the
length, I have tried to be as succint as possible.

I have a pythoncard/wxPython application. The application works well
except that users were reporting occasional crashes. The application
would simply stop and just hang. I was able to reproduce the bug
faithfully and ran the application in the python debugger pdb.py.
The trace is below and I simply cannot understand why it is hanging
where it is. The application gets stuck executing

return len(self.data[0])

This works many many times during the applications execution, indeed
several successful runs of this line are visible immediatley above the
hang. I have also printed out the value of self.data. This is a list
containing 12 inner lists each of length 3 at the point of the hang and
is never larger than that.
What on earth could cause this to stop the interpreter cold in its
tracks without an exception being thrown? CPU usage on the machine is
high throughout the application's execution and stays as such after the
"hang" begins. I eventually kill the app although I have let it run for
a long time and it never leaves this line.
For what its worth, I am using python 2.3 on windows2k.

Anyone have idea what could be happening?

c:\python23\lib\site-packages\wxpython\grid.py(664)_setOORInfo()->None
-> return val
(Pdb) s
--Return--
c:\python23\lib\site-packages\wxpython\grid.py(850)__init__()->None
-> self._setOORInfo(self)
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(17)__init
__()
-> self.data = data
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(18)__init
__()
-> self.colLabels = headings
(Pdb) s
--Return--
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(18)__init
__()->None
-> self.colLabels = headings
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtablegrid.py(15)__
init__()
-> self.colsizes = colsizes
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtablegrid.py(16)__
init__()
-> self.SetTable(table, True)
(Pdb) s
--Call--
c:\python23\lib\site-packages\wxpython\grid.py(993)SetTable()
-> def SetTable(self, *_args, **_kwargs):
(Pdb) s
> c:\python23\lib\site-packages\wxpython\grid.py(994)SetTable() -> val = gridc.wxGrid_SetTable(self, *_args, **_kwargs)
(Pdb) s
--Call--

c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(27)GetNumb
erRows() -> def GetNumberRows(self):
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(28)GetNumb
erRows() -> return len(self.data)
(Pdb) s
--Return--
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(28)GetNumb
erRows()->12 -> return len(self.data)
(Pdb) s
--Call--
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(30)GetNumb
erCols() -> def GetNumberCols(self):
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(31)GetNumb
erCols() -> if len(self.data) <= 0:
(Pdb) s
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(34)GetNumb
erCols() -> return len(self.data[0])
(Pdb) s
--Return--
c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(34)GetNumb
erCols()->3 -> return len(self.data[0])
(Pdb) s

Jul 18 '05 #2
Ziaran wrote:
Why do you do

if len(self.data) <= 0:
return len(self.data[0])

Isn't that a sure IndexError exception?
Maybe you catch it somewhere up the stack and so you keep it silent.

That if statement just happens to be the last line before the return.
What you have stated is not what actually happens.
The actual code is
if len(self.data) <= 0:
return 0
else:
return len(self.data[0])
I guess the "else" line doesn't appear in the stack trace for whatever
reason.
There is no doubt, however, that it is hanging on the line
return len(self.data[0])

"omission9" <om*******@invalid.email.info> wrote in message
news:vf*******************@nwrddc01.gnilink.net...
Any advice on the following would be much appreciated. I have thrown
everything I have at it and am completely stumped. I apologize for the
length, I have tried to be as succint as possible.

I have a pythoncard/wxPython application. The application works well
except that users were reporting occasional crashes. The application
would simply stop and just hang. I was able to reproduce the bug
faithfully and ran the application in the python debugger pdb.py.
The trace is below and I simply cannot understand why it is hanging
where it is. The application gets stuck executing

return len(self.data[0])

This works many many times during the applications execution, indeed
several successful runs of this line are visible immediatley above the
hang. I have also printed out the value of self.data. This is a list
containing 12 inner lists each of length 3 at the point of the hang and
is never larger than that.
What on earth could cause this to stop the interpreter cold in its
tracks without an exception being thrown? CPU usage on the machine is
high throughout the application's execution and stays as such after the
"hang" begins. I eventually kill the app although I have let it run for
a long time and it never leaves this line.
For what its worth, I am using python 2.3 on windows2k.

Anyone have idea what could be happening?

c:\python23\lib\site-packages\wxpython\grid.py(664)_setOORInfo()->None
-> return val
(Pdb) s
--Return--
c:\python23\lib\site-packages\wxpython\grid.py(850)__init__()->None
-> self._setOORInfo(self)
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(17)__init
__()
-> self.data = data
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(18)__init
__()
-> self.colLabels = headings
(Pdb) s
--Return--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(18)__init
__()->None
-> self.colLabels = headings
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtablegrid.py(15)__
init__()
-> self.colsizes = colsizes
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtablegrid.py(16)__
init__()
-> self.SetTable(table, True)
(Pdb) s
--Call--
c:\python23\lib\site-packages\wxpython\grid.py(993)SetTable()
-> def SetTable(self, *_args, **_kwargs):
(Pdb) s
> c:\python23\lib\site-packages\wxpython\grid.py(994)SetTable()

-> val = gridc.wxGrid_SetTable(self, *_args, **_kwargs)
(Pdb) s
--Call--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(27)GetNumb
erRows()
-> def GetNumberRows(self):
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(28)GetNumb
erRows()
-> return len(self.data)
(Pdb) s
--Return--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(28)GetNumb
erRows()->12
-> return len(self.data)
(Pdb) s
--Call--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(30)GetNumb
erCols()
-> def GetNumberCols(self):
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(31)GetNumb
erCols()
-> if len(self.data) <= 0:
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(34)GetNumb
erCols()
-> return len(self.data[0])
(Pdb) s
--Return--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(34)GetNumb
erCols()->3
-> return len(self.data[0])
(Pdb) s



Jul 18 '05 #3
I guess it is a thread synchronization progblem
In that case some other thread modifies self.data leaving it empty in the
time between the if statement expression is evalutaed and the time the
return statement is executed.

Can this be the case?
"omission9" <om*******@invalid.email.info> wrote in message
news:2u*******************@nwrddc01.gnilink.net...
Ziaran wrote:
Why do you do

if len(self.data) <= 0:
return len(self.data[0])

Isn't that a sure IndexError exception?
Maybe you catch it somewhere up the stack and so you keep it silent.


That if statement just happens to be the last line before the return.
What you have stated is not what actually happens.
The actual code is
if len(self.data) <= 0:
return 0
else:
return len(self.data[0])
I guess the "else" line doesn't appear in the stack trace for whatever
reason.
There is no doubt, however, that it is hanging on the line
return len(self.data[0])

"omission9" <om*******@invalid.email.info> wrote in message
news:vf*******************@nwrddc01.gnilink.net...
Any advice on the following would be much appreciated. I have thrown
everything I have at it and am completely stumped. I apologize for the
length, I have tried to be as succint as possible.

I have a pythoncard/wxPython application. The application works well
except that users were reporting occasional crashes. The application
would simply stop and just hang. I was able to reproduce the bug
faithfully and ran the application in the python debugger pdb.py.
The trace is below and I simply cannot understand why it is hanging
where it is. The application gets stuck executing

return len(self.data[0])

This works many many times during the applications execution, indeed
several successful runs of this line are visible immediatley above the
hang. I have also printed out the value of self.data. This is a list
containing 12 inner lists each of length 3 at the point of the hang and
is never larger than that.
What on earth could cause this to stop the interpreter cold in its
tracks without an exception being thrown? CPU usage on the machine is
high throughout the application's execution and stays as such after the
"hang" begins. I eventually kill the app although I have let it run for
a long time and it never leaves this line.
For what its worth, I am using python 2.3 on windows2k.

Anyone have idea what could be happening?

c:\python23\lib\site-packages\wxpython\grid.py(664)_setOORInfo()->None
-> return val
(Pdb) s
--Return--
c:\python23\lib\site-packages\wxpython\grid.py(850)__init__()->None
-> self._setOORInfo(self)
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(17)__init
__()
-> self.data = data
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(18)__init
__()
-> self.colLabels = headings
(Pdb) s
--Return--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(18)__init
__()->None
-> self.colLabels = headings
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtablegrid.py(15)__
init__()
-> self.colsizes = colsizes
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtablegrid.py(16)__
init__()
-> self.SetTable(table, True)
(Pdb) s
--Call--
c:\python23\lib\site-packages\wxpython\grid.py(993)SetTable()
-> def SetTable(self, *_args, **_kwargs):
(Pdb) s
> c:\python23\lib\site-packages\wxpython\grid.py(994)SetTable()
-> val = gridc.wxGrid_SetTable(self, *_args, **_kwargs)
(Pdb) s
--Call--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(27)GetNumb erRows()
-> def GetNumberRows(self):
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(28)GetNumb erRows()
-> return len(self.data)
(Pdb) s
--Return--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(28)GetNumb erRows()->12
-> return len(self.data)
(Pdb) s
--Call--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(30)GetNumb erCols()
-> def GetNumberCols(self):
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(31)GetNumb erCols()
-> if len(self.data) <= 0:
(Pdb) s


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(34)GetNumb erCols()
-> return len(self.data[0])
(Pdb) s
--Return--


c:\cygwin\home\ar881\development\bt_analysis\conso le\ndbbtable.py(34)GetNumb erCols()->3
-> return len(self.data[0])
(Pdb) s


Jul 18 '05 #4

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

Similar topics

4
by: muser | last post by:
Can anyone run this program through their compiler or if they can see a logical error please point it out. I have my tutor working on it at the moment but I would rather a less ambigious response...
4
by: Chris | last post by:
Hi, I followed the the aricle http://support.microsoft.com/default.aspx?scid=kb;en-us;321525 and was able to execute a dts package in vb.net. I replaced all the "Console.WriteLine" with "msgbox"....
11
by: Frances Del Rio | last post by:
this is so bizarre, and don't even know if this is right place to ask, but don't know where else: about two days I changed webhosting, changed DNS for my domain, francesdelrio.com, now when I...
4
by: Aaron W. LaFramboise | last post by:
I'm seeking a solution to my C++-life long dilemma of how to deal with errors when exceptions aren't appropriate. Below I highlight two error cases, which mainly occur when trying to handle...
10
by: jeff regoord | last post by:
A user inputs a float value. The scanf() function gets the value. However, I need to create an error handler with an if else statement saying invalid input if the input is not a number. Does...
10
by: RepStat | last post by:
If I have code such a SqConnection cndb = new SqlConnection(connstr) SqlDataReader dr = null tr cndb.Open() SqlCommand cmd = new SqlCommand("exec mysp", cndb) dr = cmd.ExecuteReader()
0
by: prakash | last post by:
Hi all. I am developing a vb.net project .After complete the Execution some times it gives an error like that A Message Box shown title : "DDE Server Window : MyProgarm.exe - Application Error"...
160
by: RG | last post by:
Greetings friends, This semester I have started a course in C programming. I was moving along fine until I reached to the topic of loops (feeling embarrassed among you elite programmers). My...
11
by: minishilpi | last post by:
I have a question - I have this code below to send an email and I have referenced the Microsoft CDO Library 2000. It doesn't throw any exception in the console window. It goes throughout the code...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.