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

Backdoor is not working due to changes in gevent #1234

Open
mraron opened this issue May 31, 2023 · 0 comments
Open

Backdoor is not working due to changes in gevent #1234

mraron opened this issue May 31, 2023 · 0 comments

Comments

@mraron
Copy link

mraron commented May 31, 2023

Description: When trying to netcat to the backdoor socket nothing happens. In the output of the service I see something like this:

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 854, in gevent._greenlet.Greenlet.run
  File "/usr/local/lib/python3.8/dist-packages/gevent/baseserver.py", line 34, in _handle_and_close_when_done
    return handle(*args_tuple)
  File "/usr/local/lib/python3.8/dist-packages/cms-1.5.dev0-py3.8.egg/cms/io/service.py", line 269, in handle
    BackdoorServer.handle(self, conn, _address)
  File "/usr/local/lib/python3.8/dist-packages/gevent/backdoor.py", line 168, in handle
    conn.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, True) # pylint:disable=no-member
OSError: [Errno 95] Operation not supported

Steps to reproduce:

  1. Enable backdoor
  2. Try to access it according to the documentation.

Expected: A python console is available.

Actual: Nothing happens, the netcat exits because it receives EOF.

CMS version: ioi2023's master version (https://github.com/ioi-2023/cms), but for this issue it's essentially this repo's master.
Was CMS installed: yes, using docker-compose (modified from #1228)

If we comment out the line conn.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, True) in gevent's backdoor.py, which was introduced in its gevent/gevent@9d27d26 commit, the issue is fixed. As far as I see it's a bug in gevent, but something should be done about it in cms as well.

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

No branches or pull requests

1 participant