Ruby Issue Tracking System: Issues
https://redmine.ruby-lang.org/
https://redmine.ruby-lang.org/favicon.ico?1711330511
2019-06-17T07:20:39Z
Ruby Issue Tracking System
Redmine
Ruby master - Feature #15931 (Open): encoding for CESU-8
https://redmine.ruby-lang.org/issues/15931
2019-06-17T07:20:39Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>RubyとJavaのブリッジを開発していて、文字列の変換処理で困っています。<br>
現象)<br>
JavaのUTF-8は非標準的な形式 (<a href="https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/types.html#modified_utf_8_strings" class="external">https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/types.html#modified_utf_8_strings</a>) なので、Ruby側の文字列をそのままUTF-8にエンコードして与えると、Java側ではサロゲートペアに相当する文字を正しく認識できません。<br>
お願い)<br>
Java固有の拡張UTF-8は一般性が欠けていると考えられますが、ほぼ互換のCESU-8 (<a href="https://www.unicode.org/reports/tr26/tr26-4.html" class="external">https://www.unicode.org/reports/tr26/tr26-4.html</a>) は、IANAの文字セットにも登録されていて通信などでそれなりに利用されているようなので、RubyのEncodingでサポートしていただきたいと思います。</p>
<p>よろしくご検討ください。</p>
Ruby master - Bug #12587 (Rejected): ruby released tarball require ruby
https://redmine.ruby-lang.org/issues/12587
2016-07-15T11:04:21Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>I downloaded ruby-2.3.1.tar.bz2 into my brand new bash on windows.<br>
I prepared gcc, autoconf etc but ruby itself because I know that ruby release tarball does not require ruby.<br>
However, after hitting 'make', it stops while generating known_errors.inc because of 'executable host ruby is required. use --with-baseruby option.'.</p>
<pre><code>arton@WIN10PRODEV:/mnt/c/Users/Akio/linux/231build$ make
CC = gcc
LD = ld
LDSHARED = gcc -shared
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-par
entheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-ari
th -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdepr
ecated-declarations -Wno-packed-bitfield-compat -std=iso9899:1999
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibili
ty=hidden -DRUBY_EXPORT -fPIE
CPPFLAGS = -I. -I.ext/include/x86_64-linux -I../ruby-2.3.1/include -I../ruby-
2.3.1
DLDFLAGS = -fstack-protector -pie
SOLIBS =
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3'
--with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,g
o,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-l
inker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysro
ot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable
-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-br
owser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/jav
a-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.
0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with
-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc -
-enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-l
ist=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
generating known_errors.inc
executable host ruby is required. use --with-baseruby option.
make: *** [known_errors.inc] Error 1
</code></pre>
Ruby master - Bug #12520 (Closed): CIFS raises Errno::EACCES for chown while UID not found in rem...
https://redmine.ruby-lang.org/issues/12520
2016-06-26T11:43:33Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p><code>FileUtils</code>を利用した<code>:preserve => true</code>の<code>cp_r</code>中に例外となります。(題名が真の原因かは不明。それ以外に思い当たる点がない)<br>
システムはDebian jessieです。</p>
<pre><code>Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08)
</code></pre>
<p>具体的には以下のようになりました。</p>
<pre><code>/usr/local/lib/ruby/2.3.0/fileutils.rb:1411:in `chown': Permission denied @ chown_internal - /mnt/media/Music2/iTunes/iTunes Music/Jeanette/Porque Te Vas/02 Porqué Te Vas_.m4a (Errno::EACCES)
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1411:in `copy_metadata'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:475:in `block in copy_entry'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1504:in `wrap_traverse'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:469:in `copy_entry'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:444:in `block in cp_r'
from /usr/local/lib/ruby/2.3.0/fileutils.rb:1571:in `block in fu_each_src_dest'
</code></pre>
<p>やりたいことはmtimeのコピーですが、<code>FileUtils.cp_r</code>では<code>:mtime</code>を個々のファイルごとに指定できないので<code>:preserve</code>を利用する以外に方法がありません(ここに別解があればそれでも良いのでBUGではなくMiscにしています)。<br>
リファレンスによれば、<code>:preserve</code>は、</p>
<blockquote>
<pre><code></code></pre>
</blockquote>
<p>:preserve<br>
真を指定すると更新時刻と、可能なら所有ユーザ・所有グループもコピーします。</p>
<pre><code>
と、`chown`については努力目標となっています。
というわけで、以下のように`Errno::EACCES`も救済したいです。
~~~diff
--- devl/ruby-2.3.1/lib/fileutils.rb 2015-12-16 14:07:31.000000000 +0900
+++ /usr/local/lib/ruby/2.3.0/fileutils.rb 2016-06-26 20:24:57.552398812 +0900
@@ -1410,7 +1410,7 @@ module FileUtils
else
File.chown st.uid, st.gid, path
end
- rescue Errno::EPERM
+ rescue Errno::EPERM, Errno::EACCES
# clear setuid/setgid
if st.symlink?
begin
</code></pre>
<p>よろしくお願いします。</p>
Ruby master - Bug #11880 (Closed): blank string makes Win32ole crush
https://redmine.ruby-lang.org/issues/11880
2015-12-26T15:01:52Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>Win32OLEのオブジェクトに空文字列を与えるとクラッシュします。</p>
<p>再現スクリプト(method_missing側)</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require</span> <span class="s1">'win32ole'</span>
<span class="n">shell</span> <span class="o">=</span> <span class="no">WIN32OLE</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="s1">'WScript.Shell'</span><span class="p">)</span>
<span class="n">shell</span><span class="o">.</span><span class="no">Popup</span><span class="p">(</span><span class="s1">''</span><span class="p">)</span>
</code></pre>
<p>逆方向(COMコンポーネント側からの空文字列==<code>SysAllocStringLen(0)</code>のBSTRについても同様です。</p>
<p>添付のパッチで双方向とも修正できていると思います。</p>
Ruby master - Bug #11685 (Closed): rbinstall does not set Gem specification permission correctly
https://redmine.ruby-lang.org/issues/11685
2015-11-14T18:05:31Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>rbinstall.rb does not set Gem specification permission while installing rubygems.<br>
It seems line751 - 756 and 763 - are conflicting and it skips lines after 762.</p>
Ruby master - Bug #10819 (Closed): can't glob win32 short pathname
https://redmine.ruby-lang.org/issues/10819
2015-02-02T18:34:57Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>I used to install ruby under the "c:/program files" and use to apply windows short pathname such as "c:/progra~1" and it worked fine.<br>
However, rubygems on ruby 2.2.0 failed to look up gemspec. After some investigation, I found that ruby 2.2.0 failed to glob with short pathname.</p>
<p>for ex) <code>ruby -e 'p Dir.glob("c:/progra~1/*")' #=> []</code></p>
<p>Also I found that the inter glob string with shortname+wildcard also failed both Ruby 2.1.0 and 2.2.0.</p>
<p>for ex) <code>ruby -e 'p Dir.glob("C:/progra~*/*")' #=> []</code></p>
<p>The testcase is below.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">assert_equal</span> <span class="no">Dir</span><span class="p">.</span><span class="nf">glob</span><span class="p">(</span><span class="s1">'C:/Program Files*/m*'</span><span class="p">).</span><span class="nf">size</span><span class="p">,</span> <span class="no">Dir</span><span class="p">.</span><span class="nf">glob</span><span class="p">(</span><span class="s1">'c:/Progra~*/m*'</span><span class="p">).</span><span class="nf">size</span>
</code></pre>
Ruby master - Bug #9688 (Closed): Ruby's child process inherits parent's sockets (mswin)
https://redmine.ruby-lang.org/issues/9688
2014-03-29T15:16:23Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>When Ruby application creates child process, sockets are inherited from the parent process.<br>
This causes severe troubles.<br>
In my situation, I have some web services using WEBrick and Sinatra. They invoke child process as a batch file using kernel.system method. And in the batch file I launch some long running applications by 'start'.<br>
If these type of long running applications stay in running state, I never restart the services because the children grab server sockets while running. What is worse that Windows never report EADDRINUSE so I have no clue to judge its condition. Indeed 'netstat /b' reports the port is occupied by System not the child app.</p>
<p>Below is the reproduction script.</p>
<pre><code>require 'socket'
require 'timeout'
exit unless RUBY_PLATFORM =~ /mswin/
BAT = "#{ENV['TMP']}#{File::SEPARATOR}test_inheritsock.bat"
File.open(BAT, 'w') do |fout|
fout.puts 'start ruby -e "sleep(10)"'
end
port = nil
TCPServer.open(0) do |gs|
port = gs.addr[1]
system(BAT)
end
File.delete BAT
gs = TCPServer.open(port)
running = true
client = false
begin
timeout(20) do
while running
Thread.start do
s = gs.accept
s.gets
s.close
running = false
end
unless client
client = true
Thread.start do
TCPSocket.open('localhost', port) do |sock|
sock.puts('')
end
end
else
sleep(1)
end
end
end
puts 'no problem'
rescue Timeout::Error
puts 'failed'
end
gs.close
</code></pre>
<p>The second opend TCPServer can not receive a connection request.</p>
<p>Unak already made no inheritance patch (<a href="https://gist.github.com/unak/9825743" class="external">https://gist.github.com/unak/9825743</a>) and I tested it with Windowds7(x86) and Windows8.1(x64) and in both environments the above script runs completely.</p>
<p>So I wonder if the patch is applied to the trunk.</p>
<p>Thanks in advance.</p>
Ruby master - Bug #9333 (Closed): win32/Makefile.sub malconfiguration
https://redmine.ruby-lang.org/issues/9333
2013-12-31T21:53:58Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>win32/Makefile.sub defines HAVE_FSEEKO because win32/win32.c defined the function.<br>
However since r40661 the function was removed from win32/win32.c.<br>
It must be removed from Makfile.sub too.</p>
Ruby master - Bug #9332 (Closed): win32/Makefile.sub malconfiguration
https://redmine.ruby-lang.org/issues/9332
2013-12-31T21:53:04Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>win32/Makefile.sub defines HAVE_FSEEKO because win32/win32.c defined the function.<br>
However since r40661 the function was removed from win32/win32.c.</p>
Ruby master - Bug #9213 (Closed): mkmf.rb emits invalid destination directory name for mswin32/64
https://redmine.ruby-lang.org/issues/9213
2013-12-05T01:25:36Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>The install process of traditional extended library (=non gem) uses extconf.rb for creating Makefile and install the library by (n)make install.<br>
However it does not work correctly because of FileUtil.mkdir met bad directory name as 'c:c:/...'.</p>
<p>This is caused by DESTDIR and prefix combination.<br>
When one does not specify DESTDIR, rbconfig.rb create it as 'DESTDIR = TOPDIR && TOPDIR[/\A[a-z]:/i] || '' unless defined? DESTDIR' #=> 'C:' or 'D:'.<br>
By the other hand CONFIG['prefix'] is (TOPDIR || DESTDIR + '/usr') so the prefixdir also contains 'c:' or 'd:' ...</p>
<p>The definition for install directories in mkmf.rb is defined as both DESTDIR and CONFIG['prefix'] directory for example '$(DESTDIR)$(vendorarchdir)$(target_prefix)'.<br>
It causes the double drive letter name 'c:c:...'.</p>
<p>While there are some workarounds as using setup.rb or gem, it's harmful for the testing phase of extended libraries.</p>
Ruby master - Bug #9199 (Closed): win32.h is not installed by '(n)make install)
https://redmine.ruby-lang.org/issues/9199
2013-12-03T02:18:20Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>I try to install ruby-2.0.0-p353 (also rubytrunk) using 'nmake install' but ruby/win32.h does not include in include directory.</p>
<p>cause: tool/rbinstall.rb checks that it's required win32.h by 'unless RUBY_PLATFORM =~ /mswin|mingw|bccwin/.<br>
It's ok but current common.mk invokes rbinstall.rb with -r./$(arch)-fake and it only rests 'i386' in RUBY_PLATFORM.</p>
<p>I'm not certain the reason of $(arch)-fake, so don't know how to fix it.</p>
Ruby master - Feature #8601 (Closed): Win32API.rb long life plan
https://redmine.ruby-lang.org/issues/8601
2013-07-05T03:29:58Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>Win32API.rb sits on ext/dl/win32/lib in the source tree.<br>
But DL is deprecated on Ruby 2.0.1, so I'd like to move it from ext/dl/win32/lib to ext/win32/lib because the library is fundamental for Win32 platform.<br>
Also it's required to fit Fiddler.</p>
<p>Attachment is the patched version of Win32API.rb for both DL and Fiddle based on mirich (<a href="http://d.hatena.ne.jp/mirichi/20130629/p1" class="external">http://d.hatena.ne.jp/mirichi/20130629/p1</a>).</p>
Ruby master - Bug #8446 (Closed): sdbm fails to fetch existing key if many elements in it
https://redmine.ruby-lang.org/issues/8446
2013-05-24T23:22:23Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
When I store many keys in SDBM, it may fail to fetch the value and returns nil.<br>
The maximum number of all readable keys is varied by the value size.<br>
I believe it's best to be able to store and restore as many as disk size is not full, and it's better to raise an exception while storing time if it can't handle the key.</p>
<p>((|Below is the output of the attached test.|))</p>
<p>Run options:</p>
<a name="Running-tests"></a>
<h1 >Running tests:<a href="#Running-tests" class="wiki-anchor">¶</a></h1>
<p>[1/1] TestManyValues#test_many = 0.08 s</p>
<ol>
<li>Failure:<br>
TestManyValues#test_many [test_sdbm_many.rb:38]:<br>
<"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@1878"> expected but was<br>
.</li>
</ol>
<p>Finished tests in 0.089022s, 11.2332 tests/s, 21095.8954 assertions/s.<br>
1 tests, 1878 assertions, 1 failures, 0 errors, 0 skips</p>
<p>=end</p>
Ruby master - Bug #8255 (Closed): File#each_line omits last byte (==\0) if encoding is utf-16
https://redmine.ruby-lang.org/issues/8255
2013-04-11T22:11:53Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>If File#each_line was given utf-16 encoded file with 'rb:utf-16', each line lacks the last one byte.<br>
For example if the line is "a\0\r\0\n\0" in binary, the read line contains "a\0\r\0\r".</p>
<p>See the attchement.<br>
This issue is appear both current 2.1.0 and 2.0.0.</p>
Ruby master - Bug #7823 (Closed): sitelibへのsoのコピー (2.0.0)
https://redmine.ruby-lang.org/issues/7823
2013-02-10T21:55:21Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>artonです。</p>
<p>ruby-2.0.0-rc2を試していて気付いたのですが、setup.rbで拡張ライブラリをコ<br>
ピーするとrequireに失敗します。<br>
それが2.0.0で導入される非互換によるもの(=setup.rbを直すべきもの)か、バ<br>
グなのか判断がつかないので質問です。<br>
現象)<br>
setup.rbは、$sitearchdirにコピーしますが、rbconfig.rbを読むとsitearchdirは、<br>
$(sitelibdir)/$(arch)となっています(=site_ruby/2.0.0/i386-mswin32_100)。<br>
ところが、$:にはsite_ruby/2.0.0/i386-mswin32_100は含まれず、<br>
site_ruby/2.0.0/i386-msvcr100のみが含まれています。これはrbconfig.rbでは<br>
sitearchlibdirです。</p>
<p>これは、拡張ライブラリは2.0.0以降は、$sitearchdirではなく$sitearchlibidr<br>
へコピーしろ、ということでしょうか。<br>
ただし、ruby本体のライブラリについては、ruby/2.0.0/i386-mswin32_100と<br>
ruby/2.0.0/i386-msvcr100 の両方が$:に含まれています。<br>
希望としては、sitearchdirを$:に含めて欲しいです(setup.rbを使っているラ<br>
イブラリをいくつも持っているので全部直すのは面倒)。</p>
<p>--<br>
arton <a href="mailto:artonx@yahoo.co.jp" class="email">artonx@yahoo.co.jp</a></p>
Backport193 - Backport #5592 (Closed): ruby-1.9.3-p0 mswin IO#write still slower than 1.9.2
https://redmine.ruby-lang.org/issues/5592
2011-11-08T20:49:26Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>In spite of Backport <a class="issue tracker-4 status-5 priority-4 priority-default closed parent" title="Backport: windowsでファイルへの書き込みが異様に遅い (Closed)" href="https://redmine.ruby-lang.org/issues/5585">#5585</a>, ruby-1.9.3-p0 is 10 times slower than 1.9.2.</p>
<p>#-test script<br>
t=Time.new<br>
str = '0123456789'*10<br>
open('test.txt','wb') do |f|<br>
100000.times do<br>
f.write str<br>
end<br>
end<br>
puts "Write:#{Time.new-t}(s)"</p>
<p>ruby 1.9.2p290 (2011-07-09) [i386-mswin32_100]<br>
Write:0.068004(s)</p>
<p>ruby 1.9.3p0 (2011-10-30) [i386-mswin32_100] # after <a class="issue tracker-4 status-5 priority-4 priority-default closed parent" title="Backport: windowsでファイルへの書き込みが異様に遅い (Closed)" href="https://redmine.ruby-lang.org/issues/5585">#5585</a> applied<br>
Write:0.914052(s)</p>
<p>I've reviewd r33667(trunk) and accepted its effectiveness. Thanks usa for your good job.<br>
After the patch was applied, the test result:</p>
<p>ruby 1.9.3p0 (2011-10-30) [i386-mswin32_100]<br>
Write:0.069004(s)</p>
<p>ruby 1.9.3p0 (2011-10-30) [x64-mswin64_100]<br>
Write:0.066004(s)</p>
<p>Please backport the patch. Thanks.</p>
Backport193 - Backport #5585 (Closed): windowsでファイルへの書き込みが異様に遅い
https://redmine.ruby-lang.org/issues/5585
2011-11-07T19:46:25Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>r31901の修正により、io_binwriteの呼び出しの都度呼び出されるio_fflush内でfsyncがかかり、ファイルへの書き込みが極度に遅くなります。<br>
(ruby-1.9.3-p0も同様)</p>
Backport193 - Backport #5580 (Closed): Ruby can't pass test-all (x86_64-darwin11.2.0 built by Xco...
https://redmine.ruby-lang.org/issues/5580
2011-11-07T01:47:24Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>With Xcode 4.2 configured by './configure --with-gcc=clang', 'make test-all' fails at "lib/minitest/unit.rb:780: [BUG] cfp consistency error - send" .<br>
I also tried to make test-all using 'ruby-2.0.0dev (2011-11-06 trunk 33646)', it passed all tests on '9771 tests, 2208930 assertions, 0 failures, 0 errors, 46 skips'.<br>
So backports are required for ruby-1.9.3, but I can't figure out.</p>
Backport193 - Backport #5573 (Closed): Please backport r33556 (win32/Makefile.sub: have stdint.h ...
https://redmine.ruby-lang.org/issues/5573
2011-11-05T23:38:42Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>The latest version of Visual C++ has stdint.h, so if building external library that includes stdint.h fails to compile because stdint.h and Makefile.sub produced config.h are conflicted.<br>
So r33556 is required for building Ruby by Visual C++ 2010 and building some extensions (for example tiny-tds.so the tds middleware for SQL Server).</p>
<p>Thanks in advance.</p>
Ruby master - Bug #4879 (Closed): test_new(OpenSSL::TestPKeyRSA) fails on Win32
https://redmine.ruby-lang.org/issues/4879
2011-06-14T02:11:10Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>こんばんは。<br>
opensslのtest_pkey_rsa.rb:48 がfailします。Visual C++10 を利用しています。</p>
<ol>
<li>Failure:<br>
test_new(OpenSSL::TestPKeyRSA) [C:/Users/arton/Documents/ruby/trunk/test/openssl/test_pkey_rsa.rb:48]:<br>
<[]> expected but was<br>
<["error:0906D06C:PEM routines:PEM_read_bio:no start line"]>.</li>
</ol>
<p>このエラーは数回試しましたが常に発生します。<br>
ところが、ここでテストしているRubyをインストールして同じ処理を実行すると期待している結果が得られます。<br>
irb(main):001:0> require 'openssl'<br>
=> true<br>
irb(main):002:0> key = OpenSSL::PKey::RSA.new 512<br>
=> -----BEGIN RSA PRIVATE KEY-----<br>
MIIBOgIBAAJBAMuc7mPnOVmPweq1XMZrOZaOMVoTCX88fsU4460qF0me4S+yGL90<br>
(省略)<br>
-----END RSA PRIVATE KEY-----</p>
<p>irb(main):003:0> pem = key.public_key.to_pem<br>
=> "-----BEGIN PUBLIC KEY-----\nMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMuc7mPnOVmPweq1<br>
XMZrOZaOMVoTCX88\nfsU4460qF0me4S+yGL902+yR5Gv2R6B4QvE5EnxGY5zD9t355+IKaQMCAwEAAQ<br>
==\n-----END PUBLIC KEY-----\n"<br>
irb(main):004:0> OpenSSL::PKey::RSA.new pem<br>
=> -----BEGIN PUBLIC KEY-----<br>
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMuc7mPnOVmPweq1XMZrOZaOMVoTCX88<br>
fsU4460qF0me4S+yGL902+yR5Gv2R6B4QvE5EnxGY5zD9t355+IKaQMCAwEAAQ==<br>
-----END PUBLIC KEY-----</p>
<p>irb(main):005:0> OpenSSL.errors<br>
=> []</p>
<p>もしかすると、test_newの前にエラーが設定されていてそれが読まれているのかと思って、次のようにtest_newを変えて実行したところ、<br>
def test_new<br>
$stderr.puts OpenSSL.errors.inspect<br>
$stderr.flush<br>
key = OpenSSL::PKey::RSA.new 512<br>
pem = key.public_key.to_pem<br>
OpenSSL::PKey::RSA.new pem<br>
assert_equal([], OpenSSL.errors)<br>
end</p>
<p>上のように修正するとfailしなくなりましたが、取得されるエラーは以下でした。これも数回試しましたが常に同じメッセージです。<br>
.........................................................["error:0D07803A:asn1 e<br>
ncoding routines:ASN1_ITEM_EX_D2I:nested asn1 error"]...(省略)</p>
<p>OpenSSLは1.0.0aです。</p>
<p>irb(main):001:0> require 'openssl'<br>
=> true<br>
irb(main):002:0> OpenSSL::OPENSSL_VERSION<br>
=> "OpenSSL 1.0.0a 1 Jun 2010"</p>
<p>よろしくお願いします。</p>
Ruby master - Bug #4813 (Closed): test_minitest.rb failed on win32-x64
https://redmine.ruby-lang.org/issues/4813
2011-06-02T00:56:25Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>minitest.rb with external command 'diff' may fail on (at least on my) win32-x64 ruby.<br>
Above patch fixed this.</p>
<p>--- lib/minitest/unit.rb~ 2011-06-01 22:09:05.000000000 +0900<br>
+++ lib/minitest/unit.rb 2011-06-02 00:44:19.000000000 +0900<br>
@@ -121,9 +121,11 @@ module MiniTest</p>
<pre><code> Tempfile.open("expect") do |a|
a.puts expect
</code></pre>
<ul>
<li>
<pre><code> a.flush
a.rewind
Tempfile.open("butwas") do |b|
b.puts butwas
</code></pre>
</li>
<li>
<pre><code> b.flush
b.rewind
</code></pre>
</li>
</ul>
Ruby master - Feature #4602 (Closed): naming ruby dll (win32/64)
https://redmine.ruby-lang.org/issues/4602
2011-04-24T03:35:48Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
同一ディレクトリへwin32版rubyとwin64版rubyをインストールしようとしてdll名が競合したので気付いたのですが、<br>
MSWin版Rubyは、本体がDLLで、かつ、DLL名にconfigureで指定したprogram-suffixやprogram-prefixが反映されない<br>
ため、同一ディレクトリへのインストールができません。<br>
Windows版ではファイルは分離しているものの、exeとdllは不可分なので(dllへの分離は組み込み用の利便性と理解<br>
しています)exe同様にdllに対してもconfigreで指定したprogram-suffixやprogram-prefixを反映させたほうが良い<br>
と思います。</p>
<p>--- win32/Makefile.sub~ 2011-04-12 00:47:07.000000000 +0900<br>
+++ win32/Makefile.sub 2011-04-24 03:12:39.000000000 +0900<br>
@@ -129,7 +129,7 @@ ruby_version = $(MAJOR).$(MINOR).$(TEENY<br>
!endif</p>
<p>!ifndef RUBY_SO_NAME<br>
-RUBY_SO_NAME = $(RT)-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)$(TEENY)<br>
+RUBY_SO_NAME = $(RT)-$(PROGRAM_PREFIX)$(RUBY_BASE_NAME)$(PROGRAM_SUFFIX)$(MAJOR)$(MINOR)$(TEENY)<br>
!endif<br>
!ifndef RUBY_PLATFORM<br>
RUBY_PLATFORM = $(arch)<br>
=end</p>
Ruby master - Bug #4596 (Closed): Process.kill doesn't accept pid 0 (win32)
https://redmine.ruby-lang.org/issues/4596
2011-04-22T21:52:21Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
MSWin32版Rubyで、Process.killにpidとして0を指定するとEINVALとなります。<br>
この動作は、以下の理由からバグだと思いますが、何か事情があるのでしょうか?<br>
バグと考える理由)</p>
<ol>
<li>Process.killにpidとして0を指定することは認められている。<br>
るりま(<a href="http://doc.okkez.net/static/192/class/Process.html%EF%BC%89%E3%81%A7%E3%82%82%E3%81%8A%E3%81%9D%E3%82%89%E3%81%8FAPI%E3%81%AE%E5%85%83%E3%81%A8%E3%81%AA%E3%81%A3%E3%81%9Fkill(2)%E3%81%A7%E3%82%82%E3%80%81pid%E3%81%A8%E3%81%97%E3%81%A60%E3%82%92%E6%8C%87%E5%AE%9A%E3%81%97%E3%81%9F%E5%A0%B4%E5%90%88%E3%80%81%E3%82%AB%E3%83%AC%E3%83%B3%E3%83%88%E3%83%97%E3%83%AD%E3%82%BB%E3%82%B9%E3%81%AE%E3%83%97%E3%83%AD%E3%82%BB%E3%82%B9%E3%82%B0%E3%83%AB%E3%83%BC%E3%83%97%E3%81%AB%E3%82%B7%E3%82%B0%E3%83%8A%E3%83%AB%E3%82%92%E9%80%81%E3%82%8B%E3%81%A8%E3%81%AA%E3%81%A3%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82" class="external">http://doc.okkez.net/static/192/class/Process.html)でもおそらくAPIの元となったkill(2)でも、pidとして0を指定した場合、カレントプロセスのプロセスグループにシグナルを送るとなっています。</a>
</li>
<li>win32/win32.cのkillの実装でSIGINTの送信をエミュレートするために利用しているGenerateConsoleCtrlEventは、pidとして0を指定した場合、MSDNによれば「dwProcessGroupId パラメータに 0 を指定すると、呼び出し側プロセスのコンソールを共有するすべてのプロセスに信号が送信されます。」と、所定の効果が得られる。</li>
</ol>
<p>以下がパッチです。</p>
<p>--- win32.c~ 2011-04-17 00:02:49.000000000 +0900<br>
+++ win32.c 2011-04-22 20:53:36.000000000 +0900<br>
@@ -3727,7 +3727,7 @@ kill(int pid, int sig)<br>
int ret = 0;<br>
DWORD err;</p>
<ul>
<li>if (pid <= 0) {</li>
</ul>
<ul>
<li>if (pid < 0) {<br>
errno = EINVAL;<br>
return -1;<br>
}</li>
</ul>
<p>=end</p>
Ruby master - Bug #4518 (Closed): (win32) waitpid returns exit code while the child process still...
https://redmine.ruby-lang.org/issues/4518
2011-03-22T23:57:29Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
以下のスクリプトを実行すると2~4回目の繰り返しでエラーとなります(test/test_process.rbから抽出して加工)。</p>
<a name="coding-utf-8"></a>
<h1 >coding: utf-8<a href="#coding-utf-8" class="wiki-anchor">¶</a></h1>
<p>require 'tmpdir'<br>
require 'pathname'<br>
def with_tmpchdir<br>
Dir.mktmpdir {|d|<br>
p d<br>
d = Pathname.new(d).realpath.to_s<br>
Dir.chdir(d) { yield d }<br>
}<br>
end<br>
def write_file(filename, content)<br>
File.open(filename, "w") {|f| f << content }<br>
end<br>
10.times do<br>
with_tmpchdir do<br>
write_file("foo", "sleep 0.1")<br>
ps = (0...3).map { spawn("ruby", "foo") }.sort<br>
ss = Process.waitall<br>
end<br>
end</p>
<p>エラー:<br>
C:/Users/arton/Documents/ruby/src/rubytrunk/lib/fileutils.rb:1308:in <code>rmdir': Permission denied - :/Users/arton/AppData/Local/Temp/d20110322-7200-dxjpnx (Errno::EACCES) from C:/Users/arton/Documents/ruby/src/rubytrunk/lib/fileutils.rb:1308:in </code>block in remove_dir1'<br>
...</p>
<p>WIN32APIのGetExitCodeProcessがアプリケーションの終了ステータスを返した時点では、まだプロセスが終了していないことがあるため、子プロセスがテンポラリディレクトリを利用していてEACCESとなるようです。<br>
(実行環境が、4コア Xeonというのが利いているとは思います)<br>
=end</p>
Ruby 1.8 - Backport #4206 (Closed): failed to set ext option for win32/configure.bat
https://redmine.ruby-lang.org/issues/4206
2010-12-26T07:36:42Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
win32/configure.bat に対して --enable-tcltk-stubsを与えると以下のエラーになります。<br>
NMAKE : fatal error U1065: オプション '-' は無効です。</p>
<p>次のパッチで修正できます。<br>
--- setup.mak~ Wed Nov 24 16:38:35 2010<br>
+++ setup.mak Sun Dec 26 07:24:13 2010<br>
@@ -24,6 +24,7 @@<br>
CPU = PROCESSOR_LEVEL<br>
CC = cl -nologo<br>
CPP = $(CC) -EP<br>
+CONFIGARG = configure_args</p>
<p>all: -prologue- -generic- -epilogue-<br>
i386-$(OS): -prologue- -i386- -epilogue-<br>
@@ -138,6 +139,7 @@<br>
<<</p>
<p>-generic-: nul</p>
<ul>
<li>
<pre><code> @echo $(CONFIGARG) = $(CONFIGURE_ARGS)>>$(MAKEFILE)
</code></pre>
</li>
</ul>
<p>!if defined($(ARCH)) || defined($(CPU))<br>
@type << >>$(MAKEFILE)<br>
!if defined($(ARCH))</p>
<p>--- configure.bat~ Fri Jan 25 10:40:46 2008<br>
+++ configure.bat Sun Dec 26 07:22:29 2010<br>
@@ -8,6 +8,7 @@<br>
echo>> ~tmp~.mak $(conf:=/): nul<br>
echo>> ~tmp~.mak @del ~tmp~.mak<br>
echo>> ~tmp~.mak @-$(MAKE) -l$(MAKEFLAGS) -f $(@D)/setup.mak <br>
+set CONFIGURE_ARGS=<br>
:loop<br>
if "%1" == "" goto :end<br>
if "%1" == "--prefix" goto :prefix<br>
@@ -26,7 +27,7 @@<br>
if "%1" == "--extout" goto :extout<br>
if "%1" == "-h" goto :help<br>
if "%1" == "--help" goto :help</p>
<ul>
<li>echo>> ~tmp~.mak "%1" \</li>
</ul>
<ul>
<li>set CONFIGURE_ARGS=%1 %CONFIGURE_ARGS%<br>
shift<br>
goto :loop<br>
:srcdir<br>
@@ -95,6 +96,7 @@<br>
del ~tmp~.mak<br>
goto :exit<br>
:end<br>
+echo>> ~tmp~.mak "CONFIGURE_ARGS=%CONFIGURE_ARGS%" <br>
echo>> ~tmp~.mak WIN32DIR=$(@D)<br>
nmake -alf ~tmp~.mak<br>
:exit<br>
=end</li>
</ul>
Ruby master - Bug #4013 (Closed): rake/test_tasks.rb fails if ENV assined test value
https://redmine.ruby-lang.org/issues/4013
2010-11-02T02:04:57Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
Rakeはtaskの引数に与えた名前が見つからない場合、環境変数から値を取得します。<br>
test_extra_parameters_are_ignoredでは、未指定の変数bがnilかをテストしますが、環境変数bが定義されているとnilとはならないため、テストがfailします。事前に環境変数bをnilに設定してからテストすべきです。</p>
<p>--- test_tasks.rb~ 2010-07-27 00:00:55.113509000 +0900<br>
+++ test_tasks.rb 2010-11-02 02:01:37.319635100 +0900<br>
@@ -305,6 +305,7 @@ class Rake::TestTaskWithArguments < Test<br>
end</p>
<pre><code>def test_extra_parameters_are_ignored
</code></pre>
<ul>
<li>ENV['b'] = nil<br>
t = task(:t, :a) { |tt, args|<br>
assert_equal 1, args.a<br>
assert_nil args.b<br>
=end</li>
</ul>
Ruby master - Bug #3926 (Closed): Errno#message encoding is right ?
https://redmine.ruby-lang.org/issues/3926
2010-10-11T13:10:41Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
Errno::*#messageは、strerrで取ってきたメッセージなので、encodingは、localeに合わせたものを設定すべきと思うのですがどうでしょうか?</p>
<p>irb(main):001:0> Errno::EINVAL.new.message<br>
=> "Invalid argument"<br>
irb(main):002:0> Errno::EINVAL.new.message.encoding<br>
=> #<a href="Encoding:ASCII-8BIT" class="external">Encoding:ASCII-8BIT</a> # ……まあ良いとして<br>
irb(main):003:0> Errno::EWOULDBLOCK.new.message<br>
=> "\x83u\x83\x8D\x83b\x83N\x95s\x89\xC2\x82\xCC\x83\\x83P\x83b\x83g\x91\x80\x8<br>
D\xEC\x82\xF0\x82\xB7\x82\xAE\x82\xC9\x8A\xAE\x97\xB9\x82\xC5\x82\xAB\x82\xDC\x8<br>
2\xB9\x82\xF1\x82\xC5\x82\xB5\x82\xBD\x81B"<br>
irb(main):004:0> Errno::EWOULDBLOCK.new.message.encoding<br>
=> #<a href="Encoding:ASCII-8BIT" class="external">Encoding:ASCII-8BIT</a> # …… CP932 であって欲しい<br>
=end</p>
Ruby master - Bug #3925 (Closed): setting Tempfile/StringIO to $std* before startup causes [BUG] ...
https://redmine.ruby-lang.org/issues/3925
2010-10-11T04:03:45Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
$stdout, in, errにTempfileやStringIOをセットするライブラリを-rで読み込むと[BUG]となります。<br>
例)<br>
#d.rb<br>
require 'stringio'<br>
$stdout = StringIO.new<br>
#---------------------------------<br>
を作って</p>
<p>$ruby -r./d -e 'puts "hello"'<br>
-e: [BUG] Segmentation fault<br>
ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-mswin32_100]</p>
<h2>-- control frame ----------<br>
c:0001 p:0000 s:0002 b:0002 l:00122c d:00122c TOP</h2>
<p>以下のパッチで少なくともTempfileは救えます。StringIOについてはset_encodingが無いので無理ですが。</p>
<p>--- io.c.org Sat Jul 24 19:38:33 2010<br>
+++ io.c Mon Oct 11 03:47:30 2010<br>
@@ -8652,9 +8652,9 @@ rb_stdio_set_default_encoding(void)<br>
extern VALUE rb_stdin, rb_stdout, rb_stderr;<br>
VALUE val = Qnil;</p>
<ul>
<li>rb_io_set_encoding(1, &val, rb_stdin);</li>
<li>rb_io_set_encoding(1, &val, rb_stdout);</li>
<li>rb_io_set_encoding(1, &val, rb_stderr);</li>
</ul>
<ul>
<li>rb_funcall3(rb_stdin, rb_intern("set_encoding"), 1, &val);</li>
<li>rb_funcall3(rb_stdout, rb_intern("set_encoding"), 1, &val);</li>
<li>rb_funcall3(rb_stderr, rb_intern("set_encoding"), 1, &val);<br>
}</li>
</ul>
<p>/*</p>
<p>-rで読み込むと自動的にデバッガ付き状態で動く(ターゲットにrequireを埋め込みたくない)ライブラリを開発していて気づきました。<br>
=end</p>
Ruby master - Bug #3923 (Closed): bad error messages for Winsock (on Win32)
https://redmine.ruby-lang.org/issues/3923
2010-10-10T01:31:31Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
Winsock関係のErrnoのメッセージが異常です。<br>
例)Errno::EWOULDBLOCK -> 既にパスが置き換えられているドライブ上のディレクトリにドライブを接続しようとしました。<br>
この場合、正しくは「ブロック不可のソケット操作をすぐに完了できませんでした。」です。<br>
理由)WinSock固有のエラーコードをerrnoに変換したまま、strerrorを呼び出しているため。<br>
パッチとテストを添付します。<br>
=end</p>
Ruby master - Bug #3907 (Closed): WIN32OLE_TYPELIB Can't load while envvar in the pathname .
https://redmine.ruby-lang.org/issues/3907
2010-10-05T23:14:57Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
WIN32OLE_TYPELIB.newで、TypeLibのパス名に環境変数が含まれているとロードに失敗します。<br>
以下のパッチで修正します。(REG_EXPAND_SZだった場合にExpnadEnvironmentStringsで展開)<br>
添付のtest_win32ole_typelib.rbのパッチは、ADO 2.0のロードを試すものです。<br>
ただし、ADO 2.0はWindows7ではREG_EXPAND_SZを使っていますが、Windows XPでは使っていないためテストとしてはいまいちです。<br>
=end</p>
Ruby master - Feature #3901 (Closed): WIN32OLE_VARIANT.new method lacks consistency
https://redmine.ruby-lang.org/issues/3901
2010-10-03T21:44:34Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
WIN32OLE_VARIANT.newの引数が配列かどうかで変換可否が変わります。<br>
一貫性が無いので気になりました。</p>
<p>詳細:<br>
WIN32OLE_VARIANT.new(Kernel)はTypeError: can not convert WIN32OLE_VARIANT from type Moduleとなります。<br>
WIN32OLE_VARIANT.new([Kernel])は、KernelにIDispatchをラップしたWIN32OLEオブジェクトを生成します。</p>
<p>あるべき姿:<br>
配列を指定した場合と同様、Rubyのオブジェクトでスカラ型に変換できないものはIDispatchのラッパーにするのが良いと思います。<br>
ただし元々WIN32OLE_VARIANTが必要な事例が少ないので、修正する必要性については不明です。<br>
=end</p>
Ruby master - Bug #3827 (Closed): ext/readline can't handle cursor keys and cp932 chars
https://redmine.ruby-lang.org/issues/3827
2010-09-14T20:54:50Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
Ruby-1.9.2-p0のext/readlineと、GNU libreadline-4.3.2 (<a href="http://jarp.does.notwork.org/win32/)%E3%81%AE%E7%B5%84%E3%81%BF%E5%90%88%E3%82%8F%E3%81%9B%E3%81%A7%E3%82%AB%E3%83%BC%E3%82%BD%E3%83%AB%E3%82%AD%E3%83%BC%E3%80%81Home/End%E3%82%AD%E3%83%BC%E3%81%AA%E3%81%A9%E3%81%AE%E7%89%B9%E6%AE%8A%E3%82%AD%E3%83%BC%E3%81%AE%E5%85%A5%E5%8A%9B%E3%81%8C%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%E3%81%BE%E3%81%9F%E3%80%812%E3%83%90%E3%82%A4%E3%83%88%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E3%81%86%E3%81%A1MSB%E3%81%8C%E3%82%AA%E3%83%95%E3%81%AE%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E3%81%BF%E3%81%8C%E9%80%9A%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%E4%BE%8B%EF%BC%89%E3%80%8C%E8%A1%A8%E3%80%8D%E3%81%A7%E3%81%82%E3%82%8C%E3%81%B02%E3%83%90%E3%82%A4%E3%83%88%E7%9B%AE%E3%81%AE%E3%80%8C%5C%E3%80%8D%E3%81%AE%E3%81%BF%E3%81%8C%E9%80%9A%E3%82%8B%E3%80%82%EF%BC%89" class="external">http://jarp.does.notwork.org/win32/)の組み合わせでカーソルキー、Home/Endキーなどの特殊キーの入力ができません。また、2バイトコードのうちMSBがオフのコードのみが通ります。例)「表」であれば2バイト目の「\」のみが通る。)</a><br>
原因は、複合的です。<br>
・1.9.2のext/readlineはIO.getbyteを呼び出していますが、win32の1.9.2の実装ではカーソルキーなどの特殊キーを読めません。そのため無視されています。<br>
・MBCSが符号拡張されてlibreadlineに渡されているので、無視されています。</p>
<p>添付のパッチは、win32の場合は、IO.getbyteではなくlibreadlineのrl_getcを呼び出すようにしたものです。この中で入力の有無を判断してwait_eventsを呼び出すようにしています。<br>
=end</p>
Backport192 - Backport #3794 (Closed): test/openssl/test_ssl.rb hungs on mswin32_100
https://redmine.ruby-lang.org/issues/3794
2010-09-06T19:57:25Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
opensslがWinSockのerrnoを変換していないため、rb_io_wait_readableがEWOULDBLOCKと認識せずスレッドの切り替えが行われません。<br>
パッチです。</p>
<p>--- ossl_ssl.c.org 2010-09-06 19:45:34.000000000 +0900<br>
+++ ossl_ssl.c 2010-09-06 19:46:27.000000000 +0900<br>
@@ -1018,7 +1018,7 @@ ossl_ssl_setup(VALUE self)<br>
}</p>
<p>#ifdef _WIN32<br>
-#define ssl_get_error(ssl, ret) (errno = WSAGetLastError(), SSL_get_error(ssl, ret))<br>
+#define ssl_get_error(ssl, ret) (errno = rb_w32_map_errno(WSAGetLastError()), SSL_get_error(ssl, ret))<br>
#else<br>
#define ssl_get_error(ssl, ret) SSL_get_error(ssl, ret)<br>
#endif<br>
=end</p>
Ruby master - Bug #3771 (Closed): VC++ can't make ext/tk with enabling stubs
https://redmine.ruby-lang.org/issues/3771
2010-08-31T16:28:35Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
VC++で<br>
--enable-tcltk-stubs を有効にしてmakeすると、tkのmakeに失敗します。<br>
以下、パッチです。</p>
<p>--- stubs.c.org Tue Aug 31 16:21:44 2010<br>
+++ stubs.c Tue Aug 31 16:21:55 2010<br>
@@ -72,7 +72,7 @@<br>
#if defined USE_TCL_STUBS && defined USE_TK_STUBS</p>
<p>#if defined _WIN32 || defined <strong>CYGWIN</strong><br>
-# include "util.h"<br>
+# include "ruby/util.h"</p>
<a name="include-ltwindowshgt"></a>
<h1 >include <windows.h><a href="#include-ltwindowshgt" class="wiki-anchor">¶</a></h1>
<pre><code>typedef HINSTANCE DL_HANDLE;
</code></pre>
<a name="define-DL_OPEN-LoadLibrary"></a>
<h1 >define DL_OPEN LoadLibrary<a href="#define-DL_OPEN-LoadLibrary" class="wiki-anchor">¶</a></h1>
<p>=end</p>
Ruby master - Bug #3632 (Closed): win32 (MSVC)でsnapshotをmakeできない
https://redmine.ruby-lang.org/issues/3632
2010-07-31T00:36:25Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
snapshotをwin32(VC++6)でnmakeしようとすると、以下のエラーとなります。理由はsize_tが未定義だからです。</p>
<pre><code> cl -nologo -MD -Zi -W2 -O2b2xg- -G6 -Zm600 -DRUBY_EXPORT -I. -I.ext/incl
</code></pre>
<p>ude/i386-mswin32 -I./include -I. -I./missing -Focbrt.obj -c -Tc./missing/cbr<br>
t.c<br>
cbrt.c<br>
./include\ruby/missing.h(172) : error C2061: 構文エラー : 識別子 'strlcpy' がシンタックス<br>
エラーを起こしました。<br>
./include\ruby/missing.h(172) : error C2059: 構文エラー : ';'<br>
./include\ruby/missing.h(172) : error C2059: 構文エラー : 'type'<br>
./include\ruby/missing.h(176) : error C2061: 構文エラー : 識別子 'strlcat' がシンタックス<br>
エラーを起こしました。<br>
./include\ruby/missing.h(176) : error C2059: 構文エラー : ';'<br>
./include\ruby/missing.h(176) : error C2059: 構文エラー : 'type'<br>
NMAKE : fatal error U1077: 'cl' : リターン コード '0x2'<br>
Stop.</p>
<p>cbrt.cがmissing.hをincludeして(1.9.2-preview3ではincludeしていません)、かつstddef.hのincludeがmissing.hによって行われているのですが、しかしmissing.hでstddef.hをincludeするかをHAVE_STDDEF_Hでチェックしていて、かつwin32/Makefile.subにHAVE_STDDEF_Hが未定義なのが原因です。</p>
<p>--- Makefile.sub~ Mon Jul 26 18:18:21 2010<br>
+++ Makefile.sub Sat Jul 31 00:22:37 2010<br>
@@ -409,6 +409,7 @@<br>
#define HAVE_SYS_TYPES_H 1<br>
#define HAVE_SYS_STAT_H 1<br>
#define HAVE_STDLIB_H 1<br>
+#define HAVE_STDDEF_H 1<br>
#define HAVE_STRING_H 1<br>
#define HAVE_MEMORY_H 1<br>
!if $(MSC_VER) >= 1400<br>
=end</p>
Ruby master - Bug #1150 (Closed): calling instance_eval in extended library cause exception
https://redmine.ruby-lang.org/issues/1150
2009-02-13T01:16:48Z
arton (Akio Tajima)
artonx@yahoo.co.jp
<p>=begin<br>
拡張ライブラリ内のメソッドでinstance_evalを呼び出すと、Can't eval on top of Fiber or Thread (RuntimeError)になります。<br>
再現コードを以下に示します。<br>
// cmodev.c<br>
#include "ruby.h"<br>
#include "extconf.h"<br>
static VALUE cmodev;<br>
static VALUE xtest_func(VALUE self, VALUE s)<br>
{<br>
return rb_funcall2(self, rb_intern("instance_eval"), 1, &s);<br>
}<br>
void Init_cmodev()<br>
{<br>
cmodev = rb_define_class("XTest", rb_cObject);<br>
rb_define_method(cmodev, "xtest", xtest_func, 1);<br>
}</p>
<p>#t.rb<br>
require 'cmodev'<br>
x = XTest.new<br>
x.xtest("puts 'hello'")</p>
<p>実行例<br>
c:\test\modev\test>ruby t.rb<br>
t.rb:3:in <code>instance_eval': Can't eval on top of Fiber or Thread (RuntimeError) from t.rb:3:in </code>xtest'<br>
from t.rb:3:in `'<br>
=end</p>