Bug #2573: Bug with gem mysql 2.8.1 and ruby >= 1.9.0
http://redmine.ruby-lang.org/issues/show/2573

Author: Grégory Duchatelet
Status: Open, Priority: Normal
ruby -v: 1.9

On a debian lenny server, kernel 2.6.26-2-amd64, and those mysql packages:
<pre>
ii  libmysqlclient15-dev                5.0.51a-24+lenny2        MySQL database development files
ii  libmysqlclient15off                 5.0.51a-24+lenny2        MySQL database client library
ii  mysql-common                        5.0.51a-24+lenny2        MySQL database common files
</pre>

I also backport 1.9.1 packages from squeeze to lenny, and tests them, I have same bug on fetch_fields function :
<pre>
cypher-02:/var/lib/gems/1.9.1/gems/mysql-2.8.1/test# ruby1.9.1 test_mysql.rb
Loaded suite test_mysql
Started
..........................test_mysql.rb:354: [BUG] Segmentation fault
ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux]

-- control frame ----------
c:0014 p:---- s:0052 b:0052 l:000051 d:000051 CFUNC  :fetch_fields
c:0013 p:0012 s:0049 b:0049 l:000048 d:000048 METHOD test_mysql.rb:354
c:0012 p:0041 s:0045 b:0045 l:000044 d:000044 METHOD /usr/lib/ruby/1.9.1/minitest/unit.rb:436
c:0011 p:0096 s:0039 b:0039 l:000019 d:000038 BLOCK  /usr/lib/ruby/1.9.1/minitest/unit.rb:415
c:0010 p:---- s:0033 b:0033 l:000032 d:000032 FINISH
c:0009 p:---- s:0031 b:0031 l:000030 d:000030 CFUNC  :each
c:0008 p:0026 s:0028 b:0028 l:000019 d:000027 BLOCK  /usr/lib/ruby/1.9.1/minitest/unit.rb:409
c:0007 p:---- s:0025 b:0025 l:000024 d:000024 FINISH
c:0006 p:---- s:0023 b:0023 l:000022 d:000022 CFUNC  :each
c:0005 p:0080 s:0020 b:0020 l:000019 d:000019 METHOD /usr/lib/ruby/1.9.1/minitest/unit.rb:408
c:0004 p:0153 s:0015 b:0015 l:000014 d:000014 METHOD /usr/lib/ruby/1.9.1/minitest/unit.rb:388
c:0003 p:0041 s:0007 b:0007 l:000898 d:000006 BLOCK  /usr/lib/ruby/1.9.1/minitest/unit.rb:329
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001a48 d:001a48 TOP
---------------------------
-- Ruby level backtrace information-----------------------------------------
test_mysql.rb:354:in `fetch_fields'
test_mysql.rb:354:in `test_fetch_fields'
/usr/lib/ruby/1.9.1/minitest/unit.rb:436:in `run'
/usr/lib/ruby/1.9.1/minitest/unit.rb:415:in `block (2 levels) in run_test_suites'
/usr/lib/ruby/1.9.1/minitest/unit.rb:409:in `each'
/usr/lib/ruby/1.9.1/minitest/unit.rb:409:in `block in run_test_suites'
/usr/lib/ruby/1.9.1/minitest/unit.rb:408:in `each'
/usr/lib/ruby/1.9.1/minitest/unit.rb:408:in `run_test_suites'
/usr/lib/ruby/1.9.1/minitest/unit.rb:388:in `run'
/usr/lib/ruby/1.9.1/minitest/unit.rb:329:in `block in autorun'

-- C level backtrace information -------------------------------------------
0x7f603ce58cfb /usr/lib/libruby-1.9.1.so.1.9(rb_vm_bugreport+0x4b) [0x7f603ce58cfb]
0x7f603cd78514 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603cd78514]
0x7f603cd78683 /usr/lib/libruby-1.9.1.so.1.9(rb_bug+0xb3) [0x7f603cd78683]
0x7f603cdfffcc /usr/lib/libruby-1.9.1.so.1.9 [0x7f603cdfffcc]
0x7f603cb18a80 /lib/libpthread.so.0 [0x7f603cb18a80]
0x7f603bf6a030 /lib/libc.so.6(strlen+0x10) [0x7f603bf6a030]
0x7f603ce0d90e /usr/lib/libruby-1.9.1.so.1.9(rb_str_new_cstr+0xe) [0x7f603ce0d90e]
0x7f603ce0d949 /usr/lib/libruby-1.9.1.so.1.9(rb_tainted_str_new2+0x9) [0x7f603ce0d949]
0x7f603b5de3a6 /var/lib/gems/1.9.1/gems/mysql-2.8.1/lib/mysql_api.so [0x7f603b5de3a6]
0x7f603b5de4ac /var/lib/gems/1.9.1/gems/mysql-2.8.1/lib/mysql_api.so [0x7f603b5de4ac]
0x7f603ce46040 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce46040]
0x7f603ce54590 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce54590]
0x7f603ce4926f /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce4926f]
0x7f603ce4e642 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce4e642]
0x7f603ce55f18 /usr/lib/libruby-1.9.1.so.1.9(rb_yield+0x398) [0x7f603ce55f18]
0x7f603cd53e35 /usr/lib/libruby-1.9.1.so.1.9(rb_ary_each+0x45) [0x7f603cd53e35]
0x7f603ce46040 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce46040]
0x7f603ce54590 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce54590]
0x7f603ce4926f /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce4926f]
0x7f603ce4e642 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce4e642]
0x7f603ce55f18 /usr/lib/libruby-1.9.1.so.1.9(rb_yield+0x398) [0x7f603ce55f18]
0x7f603cd53e35 /usr/lib/libruby-1.9.1.so.1.9(rb_ary_each+0x45) [0x7f603cd53e35]
0x7f603ce46040 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce46040]
0x7f603ce54590 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce54590]
0x7f603ce4926f /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce4926f]
0x7f603ce4e642 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603ce4e642]
0x7f603ce51056 /usr/lib/libruby-1.9.1.so.1.9(rb_vm_invoke_proc+0x296) [0x7f603ce51056]
0x7f603cd7b8fa /usr/lib/libruby-1.9.1.so.1.9(rb_exec_end_proc+0x21a) [0x7f603cd7b8fa]
0x7f603cd7b987 /usr/lib/libruby-1.9.1.so.1.9 [0x7f603cd7b987]
0x7f603cd7bb6e /usr/lib/libruby-1.9.1.so.1.9(ruby_cleanup+0x9e) [0x7f603cd7bb6e]
0x7f603cd7bd8a /usr/lib/libruby-1.9.1.so.1.9(ruby_run_node+0x3a) [0x7f603cd7bd8a]
0x40097f ruby1.9.1(main+0x4f) [0x40097f]
0x7f603bf0d1a6 /lib/libc.so.6(__libc_start_main+0xe6) [0x7f603bf0d1a6]
0x400869 ruby1.9.1 [0x400869]

[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted
</pre>


----------------------------------------
http://redmine.ruby-lang.org