Overview
| Artifact ID: | 79731ca4787f003f4deee643b53c3e35cfa64b80a06eb51a8948e3b12a6cfb3c |
|---|---|
| Ticket: | 75d525d37c931812e9b00a80f6f43ac062598d54
Memory corruption transferring server (listening) sockets between threads |
| User & Date: | apnadkarni on 2020-01-31 12:23:59 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
Working on a generic IOCP framework for Windows, I noticed the following issue while trying to grok the Windows socket code. Note it appears the same issue will also exist on Unix. The socket implementation stores the user supplied script argument to [socket -server] in the AcceptCallback structure along with a pointer to the current interp. If the socket is then transferred to a different thread using thread::transfer, when a connection comes in the callback is run in the context of the owning thread but using the original interp belonging to the original thread with obviously catastrophic results. There needs to be mechanism to either switch the interp stored in the AcceptCallback structure to the appropriate one in the receiving thread (this seems hard to me given the current implementation), or disallow transfer of server sockets. I'll try to provide a proof script later.
- foundin changed to: "8.6.10"
- is_private changed to: "0"
- login: "apnadkarni"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "apnadkarni"
- subsystem changed to: "25. Channel System"
- title changed to:
Memory corruption transferring server (listening) sockets between threads
- type changed to: "Bug"