From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 6A9471960107 for ; Tue, 14 Jul 2015 17:29:59 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 3AE78B5D945 for ; Tue, 14 Jul 2015 17:58:18 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 49E5797A839 for ; Tue, 14 Jul 2015 17:58:20 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Y_CXEuOzYRX for ; Tue, 14 Jul 2015 17:58:19 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id C1ED697A832 for ; Tue, 14 Jul 2015 17:58:19 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 90D3F95243E for ; Tue, 14 Jul 2015 17:58:17 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4F7D6120462; Tue, 14 Jul 2015 17:58:16 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id CF81D120419 for ; Tue, 14 Jul 2015 17:58:12 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=wWmC2kOaiR1OGirNjfmuGTO9PX4=; b=TnRyV6yzG7whFNDYQJ 77oF/kEY0+SBkz1z38+zHSsK1FNTQNV9YAsz3gkWjRlQktVDPvVGtogNbXbqKeLz zwern49KUDH2yP+MV7odaa4mnbhlyfxxUkhUH3y2t7O7QcoBFFNMQhBbagGocM2D 8W+M6uMzbWCzCkjo1o3ij1aWo= Received: by filter0534p1mdw1.sendgrid.net with SMTP id filter0534p1mdw1.30741.55A4CF1CF 2015-07-14 08:58:07.763307742 +0000 UTC Received: from herokuapp.com (ec2-54-146-158-192.compute-1.amazonaws.com [54.146.158.192]) by ismtpd-014 (SG) with ESMTP id 14e8bc91412.391f.ca3b6c for ; Tue, 14 Jul 2015 08:58:07 +0000 (UTC) Date: Tue, 14 Jul 2015 08:58:07 +0000 From: ngotogenome@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 44585 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11350 X-Redmine-Issue-Author: ngoto X-Redmine-Sender: ngoto 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS53F9/Rq1cD2BizFuiYgU2pcF+TsBFZRmgVlN 2TjDjLQ7n5F/2xxGKSoeuN2iT38FdkKtqpOiCOYj4mke6+p/9jomuaOxcKoh/KGxpAdJq7+er72hNL Xt3U7UEKVPzuQEBhBCy8OfLQfLKvVdIZmkf1 X-ML-Name: ruby-core X-Mail-Count: 69964 Subject: [ruby-core:69964] [Ruby trunk - Bug #11350] When Process.exec failed, redirections were still changed and not restored 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: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11350 has been updated by Naohisa Goto. To avoid ASYNC BUG, is it possible to close timer-thread pipe after stopping the timer thread, and when Process.exec fails, to open the timer-thread pipe again before re-starting the timer thread? ---------------------------------------- Bug #11350: When Process.exec failed, redirections were still changed and not restored https://bugs.ruby-lang.org/issues/11350#change-53396 * Author: Naohisa Goto * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- When Process.exec failed, redirections of file descriptors were changed and not restored. When redirecting fd 3 or 5, ASYNC BUG occurred as below. ~~~ $ ruby -e 'begin; Process.exec("/does_not_exist", "arg", { 3=>["/dev/null", "w"]}); rescue Errno::ENOENT => e; $stdout.print "stdout: ", e.inspect, "\n"; $stderr.print "stderr: ", e.inspect, "\n"; end' [ASYNC BUG] consume_communication_pipe: read EBADF ruby 2.3.0dev (2015-07-13) [sparc64-solaris2.10] [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html stdout: # stderr: #Abort ~~~ ~~~ $ ruby -e 'begin; Process.exec("/does_not_exist", "arg", { 5=>["/dev/null", "w"]}); rescue Errno::ENOENT => e; $stdout.print "stdout: ", e.inspect, "\n"; $stderr.print "stderr: ", e.inspect, "\n"; end' [ASYNC BUG] consume_communication_pipe: read EBADF ruby 2.3.0dev (2015-07-13) [sparc64-solaris2.10] stdout: [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html # stderr: #Abort ~~~ When redirecting fd 1 or 2 to /dev/null, stdout or stderr is still redirected to /dev/null and the printed contents are not shown. ~~~ % ruby -e 'begin; Process.exec("/does_not_exist", "arg", { 1=>["/dev/null", "w"]}); rescue Errno::ENOENT => e; $stdout.print "stdout: ", e.inspect, "\n"; $stderr.print "stderr: ", e.inspect, "\n"; end' stderr: # ~~~ ~~~ % ruby -e 'begin; Process.exec("/does_not_exist", "arg", { 2=>["/dev/null", "w"]}); rescue Errno::ENOENT => e; $stdout.print "stdout: ", e.inspect, "\n"; $stderr.print "stderr: ", e.inspect, "\n"; end' stdout: # ~~~ All of the above are observed both on x86_64 Linux and sparc Solaris. Is this spec or bug? -- https://bugs.ruby-lang.org/