Multithreaded TCPServer crashes immediately
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 49
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
Was: https://github.com/mruby/mruby/issues/4949
This:
server = TCPServer.open(8000)
loop do
Thread.start(server.accept) do |client|
client.write "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nConnection: close\r\nContent-Length: 11\r\n\r\nHello world"
client.close
end
end
on Ubuntu 18.04.
At the first request, the program exits with a Segmentation fault.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the first-request crash with the TCPServer.open, server.accept, and Thread.start example on Ubuntu 18.04. Then inspect the mruby-thread implementation behind these entry points. Done means the example serves its response without a segmentation fault.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, ruby, ubuntu
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100