threading IOError

Discussion in 'Python' started by Gabriel Genellina, Dec 13, 2005.

  1. Hi

    I'm using Python 2.4.2 on Windows 98 SE.

    In a program with several threads, sometimes (I cant determine exactly
    when or why) one thread dies with the following traceback:

    12/13/05 02:17:47 (WatchDog ) Unhandled thread exception
    Traceback (most recent call last):
    File "E:\prog\pop3\TaskScheduler.py", line 60, in run
    self.finished.wait(self.interval)
    File "C:\Apps\Python\Lib\threading.py", line 348, in wait
    self.__cond.wait(timeout)
    File "C:\Apps\Python\Lib\threading.py", line 218, in wait
    remaining = endtime - _time()
    IOError: [Errno 2] No such file or directory

    The error appears to be inside the time module, and I can't explain the
    IOError there.

    Maybe this crash is related too: sometimes, the full program crashes
    with an Invalid Page Fault with the following info:

    PYTHONW provocó un error de página no válida en el módulo
    PYTHON24.DLL de 016f:1e0ab51f.
    Registros:
    EAX=1e19d1af CS=016f EIP=1e0ab51f EFLGS=00010206
    EBX=00841f80 SS=0177 ESP=0071e6ec EBP=00000000
    ECX=73962000 DS=0177 ESI=1e06a1b0 FS=1a07
    EDX=1e19d1b0 ES=0177 EDI=00000000 GS=0000

    Any ideas?

    Gabriel Genellina
    Softlab SRL
     
    Gabriel Genellina, Dec 13, 2005
    #1
    1. Advertising

  2. Gabriel Genellina wrote:
    > Hi
    >
    > I'm using Python 2.4.2 on Windows 98 SE.
    >
    > In a program with several threads, sometimes (I cant determine exactly
    > when or why) one thread dies with the following traceback:
    >
    > 12/13/05 02:17:47 (WatchDog ) Unhandled thread exception
    > Traceback (most recent call last):
    > File "E:\prog\pop3\TaskScheduler.py", line 60, in run
    > self.finished.wait(self.interval)
    > File "C:\Apps\Python\Lib\threading.py", line 348, in wait
    > self.__cond.wait(timeout)
    > File "C:\Apps\Python\Lib\threading.py", line 218, in wait
    > remaining = endtime - _time()
    > IOError: [Errno 2] No such file or directory
    >
    > The error appears to be inside the time module, and I can't explain the
    > IOError there.
    >
    > Maybe this crash is related too: sometimes, the full program crashes
    > with an Invalid Page Fault with the following info:
    >
    > PYTHONW provocó un error de página no válida en el módulo
    > PYTHON24.DLL de 016f:1e0ab51f.
    > Registros:
    > EAX=1e19d1af CS=016f EIP=1e0ab51f EFLGS=00010206
    > EBX=00841f80 SS=0177 ESP=0071e6ec EBP=00000000
    > ECX=73962000 DS=0177 ESI=1e06a1b0 FS=1a07
    > EDX=1e19d1b0 ES=0177 EDI=00000000 GS=0000
    >
    > Any ideas?


    Quite some time ago I saw the same sort of issue - inexplicable
    exceptions from apparently benign code.

    Tim Peters prognosticated that there was a bug in an extension module,
    and indeed that proved to be the case (a 3rd party extension, which
    fortunately I had source for and was able to build).

    I doubt that any of Python's standard extension modules will be involved
    (as they are generally mature and widely used and tested) but you should
    look at the source for any others looking for unhandled error returns.
    Typically, errno is set but the failure return from the routine setting
    errno is ignored or not properly handled.

    What then happens is the next time an exception gets propagated through
    Python's internals, the errno value gets picked up and is used to
    identify the exception (incorrectly).

    The invalid page fault may well be because a garbage pointer is handed
    to a routine, possibly as a consequence of the mishandled error return.

    -------------------------------------------------------------------------
    Andrew I MacIntyre "These thoughts are mine alone..."
    E-mail: (pref) | Snail: PO Box 370
    (alt) | Belconnen ACT 2616
    Web: http://www.andymac.org/ | Australia
     
    Andrew MacIntyre, Dec 13, 2005
    #2
    1. Advertising

  3. Andrew MacIntyre ha escrito:

    > Gabriel Genellina wrote:
    > > File "C:\Apps\Python\Lib\threading.py", line 218, in wait
    > > remaining = endtime - _time()
    > > IOError: [Errno 2] No such file or directory
    > >
    > > The error appears to be inside the time module, and I can't explain the
    > > IOError there.
    > >
    > > Maybe this crash is related too: sometimes, the full program crashes
    > > with an Invalid Page Fault with the following info:

    > Quite some time ago I saw the same sort of issue - inexplicable
    > exceptions from apparently benign code.
    >
    > Tim Peters prognosticated that there was a bug in an extension module,
    > and indeed that proved to be the case (a 3rd party extension, which
    > fortunately I had source for and was able to build).
    >
    > I doubt that any of Python's standard extension modules will be involved
    > (as they are generally mature and widely used and tested) but you should
    > look at the source for any others looking for unhandled error returns.
    > Typically, errno is set but the failure return from the routine setting
    > errno is ignored or not properly handled.
    >
    > What then happens is the next time an exception gets propagated through
    > Python's internals, the errno value gets picked up and is used to
    > identify the exception (incorrectly).
    >
    > The invalid page fault may well be because a garbage pointer is handed
    > to a routine, possibly as a consequence of the mishandled error return.


    Oh, thanks, at least this gives me a starting point to investigate. But
    I can´t discard the standard modules; this is an (almost) clean python
    install. The download rate has became extremely low and maybe all of
    this is related to the recent upgrade to Python 2.4.2... (Maybe
    Win98+many threads+sockets is not a well tested combination)

    Thanks,
    Gabriel Genellina
    Softlab SRL
     
    Gabriel Genellina, Dec 15, 2005
    #3
    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. Jim Cobban

    Xerces parse aborted on IOError

    Jim Cobban, Dec 5, 2003, in forum: XML
    Replies:
    0
    Views:
    411
    Jim Cobban
    Dec 5, 2003
  2. Bart Nessux

    urllib IOError Exception

    Bart Nessux, Jun 11, 2004, in forum: Python
    Replies:
    4
    Views:
    1,590
    John J. Lee
    Jun 14, 2004
  3. Replies:
    9
    Views:
    1,125
    Mark Space
    Dec 29, 2007
  4. Steven Woody
    Replies:
    0
    Views:
    474
    Steven Woody
    Jan 9, 2009
  5. Steven Woody
    Replies:
    0
    Views:
    488
    Steven Woody
    Jan 9, 2009
Loading...

Share This Page