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

Polling non-blocking socket for POLLOUT after receiving RST results in null pointer dereference #3449

Closed
rkojedzinszky opened this issue Nov 21, 2017 · 2 comments

Comments

@rkojedzinszky
Copy link

Please run the attached script in a esp8266 board with modifying the target address/port to a reachable host and closed port.

poll.py

@robert-hh
Copy link
Contributor

Just fo rconvenience: this is the script:

import usocket
import uselect
import time

poller = uselect.poll()

s = usocket.socket()

s.setblocking(False)

ai = usocket.getaddrinfo('10.0.0.10', 5001)[0][-1]
try:
    s.connect(ai)
except Exception as e:
    print('{!r}'.format(e))

time.sleep_ms(100)

poller.register(s, uselect.POLLOUT)
print (poller.poll(1000))
poller.unregister(s)

s.close()

poller.register(s, uselect.POLLIN)
print (poller.poll(1000))

rkojedzinszky pushed a commit to rkojedzinszky/micropython that referenced this issue Nov 22, 2017
rkojedzinszky pushed a commit to rkojedzinszky/micropython that referenced this issue Nov 25, 2017
This adds support for returning POLLHUP and POLLERR flags. Also, for
listening sockets, also returns POLLIN when a client is connected.

Fixes micropython#3449
@dpgeorge
Copy link
Member

This is fixed by 318f874

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants