Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Errors #38

Open
harvimt opened this issue Jul 23, 2015 · 2 comments
Open

Windows Errors #38

harvimt opened this issue Jul 23, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@harvimt
Copy link
Owner

harvimt commented Jul 23, 2015

The PyQt4 and PyQt5 tests on appveyor are passing, but I get this:

Exception ignored in: <bound method _ProactorSocketTransport.__del__ of <_ProactorSocketTransport closing fd=-1 read=<_OverlappedFuture cancelled>>>
Traceback (most recent call last):
  File "C:\Python34\lib\asyncio\proactor_events.py", line 86, in __del__
    self.close()
  File "C:\Python34\lib\asyncio\proactor_events.py", line 74, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\projects\quamash\quamash\__init__.py", line 365, in call_soon
    return self.call_later(0, callback, *args)
  File "C:\projects\quamash\quamash\__init__.py", line 345, in call_later
    return self._add_callback(asyncio.Handle(callback, args, self), delay)
  File "C:\projects\quamash\quamash\__init__.py", line 359, in _add_callback
    self.__timers.append(timer)
AttributeError: 'NoneType' object has no attribute 'append'
Exception ignored in: <bound method _ProactorSocketTransport.__del__ of <_ProactorSocketTransport closing fd=-1 read=<_OverlappedFuture cancelled>>>
Traceback (most recent call last):
  File "C:\Python34\lib\asyncio\proactor_events.py", line 86, in __del__
    self.close()
  File "C:\Python34\lib\asyncio\proactor_events.py", line 74, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\projects\quamash\quamash\__init__.py", line 365, in call_soon
    return self.call_later(0, callback, *args)
  File "C:\projects\quamash\quamash\__init__.py", line 345, in call_later
    return self._add_callback(asyncio.Handle(callback, args, self), delay)
  File "C:\projects\quamash\quamash\__init__.py", line 359, in _add_callback
    self.__timers.append(timer)
AttributeError: 'NoneType' object has no attribute 'append'
Exception ignored in: <bound method _ProactorSocketTransport.__del__ of <_ProactorSocketTransport closing fd=-1 read=<_OverlappedFuture cancelled>>>
Traceback (most recent call last):
  File "C:\Python34\lib\asyncio\proactor_events.py", line 86, in __del__
    self.close()
  File "C:\Python34\lib\asyncio\proactor_events.py", line 74, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\projects\quamash\quamash\__init__.py", line 365, in call_soon
    return self.call_later(0, callback, *args)
  File "C:\projects\quamash\quamash\__init__.py", line 345, in call_later
    return self._add_callback(asyncio.Handle(callback, args, self), delay)
  File "C:\projects\quamash\quamash\__init__.py", line 359, in _add_callback
    self.__timers.append(timer)
AttributeError: 'NoneType' object has no attribute 'append'

may be related to #34

PySide tests give off a similar error, in addition to:

QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread

but fail, however, the PySide tests have been failing for awhile for no reason on windows (like the tests all pass, but the exit code of py.test is non-zero)

@harvimt harvimt added the bug label Jul 23, 2015
@harvimt harvimt added this to the v.6 milestone Jul 23, 2015
@harvimt harvimt self-assigned this Jul 23, 2015
@Insoleet
Copy link
Contributor

I also have these errors, in my app and in my tests, when closing the event loop :

ERROR:quamash.QEventLoop:Cancelling an overlapped future failed
future: <_OverlappedFuture pending overlapped=<pending, 0x42bde50> cb=[BaseProactorEventLoop._loop_self_reading()]>
Traceback (most recent call last):
  File "D:\Anaconda3_64\lib\asyncio\windows_events.py", line 62, in _cancel_overlapped
    self._ov.cancel()
OSError: [WinError 6] The handle is invalid

Debugging with pycharm, here is what I found.
The line https://github.com/python/asyncio/blob/master/asyncio/proactor_events.py#L455 is called the the future named "_self_reading_future" is canceled and set to None. It's descriptor address is for example "133875888".

But then, in https://github.com/python/asyncio/blob/7baef9de28bd0a8e5bb14ad962059dced9f23bb3/asyncio/windows_events.py#L718, there remains for some reason a future calling as a callback "QEventLoop._loop_self_reading" in the cache, and is pending. This future is then canceled. It's descriptor is different from the previous one ( adress : 133875744 ) but an error is present on this one : 997.
If I follow microsoft doc ( https://msdn.microsoft.com/en-us/library/windows/desktop/ms681388%28v=vs.85%29.aspx ), 997 means : ERROR_IO_PENDING, Overlapped I/O operation is in progress.

@Insoleet
Copy link
Contributor

This pull request was doing a regression. The logs in this issue are not present, but with my patch they come back.

peterazmanov added a commit to peterazmanov/quamash that referenced this issue Nov 16, 2015
`QtCore.QObject.__init__(self)` and `asyncio.ProactorEventLoop.__init__(self, _IocpProactor())` causes double initialization of asyncio.ProactorEventLoop, according to mro.
Possibly related to harvimt#38.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants