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

Discussion in 'Python' started by omission9, Feb 21, 2004.

  1. omission9

    omission9 Guest

    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\console\ndbbtable.py(17)__init

    __()
    -> self.data = data
    (Pdb) s


    c:\cygwin\home\ar881\development\bt_analysis\console\ndbbtable.py(18)__init

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

    __()->None
    -> self.colLabels = headings
    (Pdb) s


    c:\cygwin\home\ar881\development\bt_analysis\console\ndbbtablegrid.py(15)__

    init__()
    -> self.colsizes = colsizes
    (Pdb) s


    c:\cygwin\home\ar881\development\bt_analysis\console\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\console\ndbbtable.py(27)GetNumberRows()
    -> def GetNumberRows(self):
    (Pdb) s
    c:\cygwin\home\ar881\development\bt_analysis\console\ndbbtable.py(28)GetNumberRows()
    -> return len(self.data)
    (Pdb) s
    --Return--
    c:\cygwin\home\ar881\development\bt_analysis\console\ndbbtable.py(28)GetNumberRows()->12
    -> return len(self.data)
    (Pdb) s
    --Call--
    c:\cygwin\home\ar881\development\bt_analysis\console\ndbbtable.py(30)GetNumberCols()
    -> def GetNumberCols(self):
    (Pdb) s
    c:\cygwin\home\ar881\development\bt_analysis\console\ndbbtable.py(31)GetNumberCols()
    -> if len(self.data) <= 0:
    (Pdb) s
    c:\cygwin\home\ar881\development\bt_analysis\console\ndbbtable.py(34)GetNumberCols()
    -> return len(self.data[0])
    (Pdb) s
    --Return--


    c:\cygwin\home\ar881\development\bt_analysis\console\ndbbtable.py(34)GetNumberCols()->3
    -> return len(self.data[0])
    (Pdb) s
     
    omission9, Feb 21, 2004
    #1
    1. Advertising

  2. omission9

    Ziaran Guest

    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" <> wrote in message
    news:vfBZb.57526$...
    > 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\console\ndbbtable.py(17)__init
    >
    > __()
    > -> self.data = data
    > (Pdb) s
    >
    >
    >

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

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

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

    c:\cygwin\home\ar881\development\bt_analysis\console\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\console\ndbbtable.py(27)GetNumb
    erRows()
    > -> def GetNumberRows(self):
    > (Pdb) s
    >

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

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

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

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

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

    c:\cygwin\home\ar881\development\bt_analysis\console\ndbbtable.py(34)GetNumb
    erCols()->3
    > -> return len(self.data[0])
    > (Pdb) s
    >
     
    Ziaran, Feb 22, 2004
    #2
    1. Advertising

  3. omission9

    omission9 Guest

    Re: need help with bizarre error caught in debugger. execution ishanging

    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" <> wrote in message
    > news:vfBZb.57526$...
    >
    >>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\console\ndbbtable.py(17)__init
    >
    >> __()
    >> -> self.data = data
    >> (Pdb) s
    >>
    >>
    >>

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

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

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

    >
    > c:\cygwin\home\ar881\development\bt_analysis\console\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\console\ndbbtable.py(27)GetNumb
    > erRows()
    >
    >> -> def GetNumberRows(self):
    >> (Pdb) s
    >>

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

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

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

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

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

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

    >
    >
    >
     
    omission9, Feb 23, 2004
    #3
  4. omission9

    Ziaran Guest

    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" <> wrote in message
    news:2uf_b.66535$...
    > 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" <> wrote in message
    > > news:vfBZb.57526$...
    > >
    > >>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\console\ndbbtable.py(17)__init
    > >
    > >> __()
    > >> -> self.data = data
    > >> (Pdb) s
    > >>
    > >>
    > >>

    > >
    > >

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

    > >
    > >

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

    > >
    > >

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

    > >
    > >

    c:\cygwin\home\ar881\development\bt_analysis\console\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\console\ndbbtable.py(27)GetNumb
    > > erRows()
    > >
    > >> -> def GetNumberRows(self):
    > >> (Pdb) s
    > >>

    > >
    > >

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

    > >
    > >

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

    > >
    > >

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

    > >
    > >

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

    > >
    > >

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

    > >
    > >

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

    > >
    > >
    > >

    >
     
    Ziaran, Feb 23, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Um9iZXJ0IEFka2lzb24=?=

    Debugger Hanging

    =?Utf-8?B?Um9iZXJ0IEFka2lzb24=?=, Aug 25, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    683
    =?Utf-8?B?Um9iZXJ0IEFka2lzb24=?=
    Aug 25, 2005
  2. Roy Smith

    Bizarre error from help()

    Roy Smith, Aug 10, 2005, in forum: Python
    Replies:
    0
    Views:
    265
    Roy Smith
    Aug 10, 2005
  3. vj
    Replies:
    0
    Views:
    297
  4. Replies:
    12
    Views:
    206
    Anno Siegel
    Oct 6, 2005
  5. aflat362
    Replies:
    7
    Views:
    227
    naixn
    Dec 7, 2006
Loading...

Share This Page