Skip to content

TCPSocket#write is failed #5943

@bamchoh

Description

@bamchoh

Hi, thank you very much for development of mruby

I found a issue. I executed below script (test.rb) by command prompt like mruby.exe test.rb

TCPServer.open("127.0.0.1", 0) { |serv|
  c = TCPSocket.new(*serv.addr.values_at(3,1))
  s = serv.accept

  c.send "foo", 4
  p s.recv(10)

  c.write "bar"
  p s.recv(10)
}

Then an below exception happens

trace (most recent call last):
        [3] test.rb:1
        [2] test.rb:1:in open
        [1] test.rb:8
test.rb:8:in write: Bad file descriptor - syswrite (Errno::EBADF)
  • I don't face this issue with 3.1.0. When I use 3.2.0, this issue occurs.

  • I'm Windows user. I'm using Windows 10 Pro or Windows 11. I found this issue with both Windows version.

  • I'm building mruby.exe by using ridk which is installed by Ruby installer for Windows (`3.1.2p20 ) like below command.

ridk exec rake all test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions