From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 251C51F4C0 for ; Fri, 25 Oct 2019 15:39:50 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 6A672120BB0; Sat, 26 Oct 2019 00:39:40 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 387F1120A8D for ; Sat, 26 Oct 2019 00:39:38 +0900 (JST) Received: by filter0161p3mdw1.sendgrid.net with SMTP id filter0161p3mdw1-2889-5DB3173B-15 2019-10-25 15:39:39.168120842 +0000 UTC m=+241971.750033235 Received: from herokuapp.com (unknown [18.208.173.77]) by ismtpd0055p1iad1.sendgrid.net (SG) with ESMTP id apq9KgPfQvyfv1XsTPdiGA for ; Fri, 25 Oct 2019 15:39:39.118 +0000 (UTC) Date: Fri, 25 Oct 2019 15:39:39 +0000 (UTC) From: Greg.mpls@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 71140 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16277 X-Redmine-Issue-Author: bradland X-Redmine-Sender: MSP-Greg X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?M4W5dkI32Qt1AHWPzmUKqncwpr1RYzW=2Fh5io+QGCFbrFXOv1bbCEmEC=2FIH3w2r?= =?us-ascii?Q?sHTwpE1hmXR2S7r1MdqO8XStNZhGimxSwZNxOkz?= =?us-ascii?Q?PsG1Wac0ZgytH31v3hNfoVgzBtQBbNhILneBIdx?= =?us-ascii?Q?ja4xd1lSwtkisaMg510=2FefCkpReP6vtZsK5J2rb?= =?us-ascii?Q?Un=2FrFzzz+fdTgu9K7r7jXjGNLrgIQ9ucOfQ=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95548 Subject: [ruby-core:95548] [Ruby master Bug#16277] UNIXServer#listen fails with Errno::EADDRINUSE error under Windows 10 / WSL Ubuntu 18.04 X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #16277 has been updated by MSP-Greg (Greg L). Would something like the following yield an equivalent object? ```ruby require 'socket' sock = Socket.new :UNIX, :STREAM sock.bind Addrinfo.unix('tmp.sock', :STREAM) sock.listen 1024 puts sock.local_address.unix? ``` ---------------------------------------- Bug #16277: UNIXServer#listen fails with Errno::EADDRINUSE error under Windows 10 / WSL Ubuntu 18.04 https://bugs.ruby-lang.org/issues/16277#change-82324 * Author: bradland (Brad Landers) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-gnu] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- When running the following script under Windows 10 / WSL Ubuntu 18.04, an Errno::EADDRINUSE error is thrown. Expected result is that the script would run and simply exit. ``` ruby #!/usr/bin/env ruby # This script establishes a UNIX server socket. # # Expected result: Script should run and immediately exit. # # Actual result: Script fails with Errno::EADDRINUSE error. # # Environment: Windows 10 Pro, WSL, Ubuntu 18.04.2, ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-gnu] # # To reproduce: Create a tmp folder, copy this script there, and execute. require 'socket' path = File.expand_path('listen.sock') backlog = 5 s = UNIXServer.new(path) if backlog s.listen backlog else s.listen end File.delete(path) if File.exists?(path) ``` The bug was discoverd as part of Puma (gem) issue #1521: https://github.com/puma/puma/issues/1521. -- https://bugs.ruby-lang.org/