Closed
Description
I'm running Ruby 2.0.0p0 x64 on Windows 7 x64 with DevKit 4.7.2 (x86_64-w64-mingw32).
> gem install --platform=ruby mysql2 -- --with-mysql-lib=C:\Path\To\MySQL\C\Connector\lib --with-mysql-include=C:\Path\To\MySQL\C\Connector\include
I have been able to get the gem to compile successfully and work properly using the same procedure for x86 versions of Ruby 2.0.0p0.
On x64, the gem compiles successfully, but segfaults on require.
I'm using the 64-bit version of the C Connector from MySQL (mysql-connector-c-noinstall-6.0.2-winx64.zip
) and the corresponding libmysql.dll
is in my Ruby's bin
dir.
Not sure if this is a problem with the toolchain or the extension. I'm leaning away from the toolchain as I can successfully compile and use SQLite3 with Ruby 2.0.0p0 x64.
Below is the trace I get when it segfaults:
C:\Users\Mike\Desktop\GemBuild>irb -r 'mysql2'
DL is deprecated, please use Fiddle
C:/Ruby200p0-64bit/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x64-mingw32/lib/mysql2/mysql2.so: [BUG] Segmentation fault
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]
-- Control frame information -----------------------------------------------
c:0014 p:-5890000 s:0059 e:000058 TOP [FINISH]
c:0013 p:---- s:0057 e:000056 CFUNC :require
c:0012 p:0073 s:0053 e:000052 METHOD C:/Ruby200p0-64bit/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45
c:0011 p:0091 s:0043 e:000042 TOP C:/Ruby200p0-64bit/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x64-mingw32/lib/mysql2.rb:9 [FINISH]
c:0010 p:---- s:0041 e:000040 CFUNC :require
c:0009 p:0059 s:0037 e:000036 BLOCK C:/Ruby200p0-64bit/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110
c:0008 p:0286 s:0034 e:000033 METHOD C:/Ruby200p0-64bit/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35
c:0007 p:0015 s:0024 e:000023 BLOCK C:/Ruby200p0-64bit/lib/ruby/2.0.0/irb/init.rb:286 [FINISH]
c:0006 p:---- s:0021 e:000020 CFUNC :each
c:0005 p:0013 s:0018 e:000017 METHOD C:/Ruby200p0-64bit/lib/ruby/2.0.0/irb/init.rb:284
c:0004 p:0063 s:0013 e:000012 METHOD C:/Ruby200p0-64bit/lib/ruby/2.0.0/irb/init.rb:20
c:0003 p:0039 s:0009 e:000008 METHOD C:/Ruby200p0-64bit/lib/ruby/2.0.0/irb.rb:380
c:0002 p:0031 s:0004 E:002568 EVAL C:/Ruby200p0-64bit/bin/irb:12 [FINISH]
c:0001 p:0000 s:0002 E:000018 TOP [FINISH]
C:/Ruby200p0-64bit/bin/irb:12:in `<main>'
C:/Ruby200p0-64bit/lib/ruby/2.0.0/irb.rb:380:in `start'
C:/Ruby200p0-64bit/lib/ruby/2.0.0/irb/init.rb:20:in `setup'
C:/Ruby200p0-64bit/lib/ruby/2.0.0/irb/init.rb:284:in `load_modules'
C:/Ruby200p0-64bit/lib/ruby/2.0.0/irb/init.rb:284:in `each'
C:/Ruby200p0-64bit/lib/ruby/2.0.0/irb/init.rb:286:in `block in load_modules'
C:/Ruby200p0-64bit/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
C:\Users\Mike\Desktop\GemBuild>ruby -v
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]
C:\Users\Mike\Desktop\GemBuild>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby200p0-64bit/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: C:/Ruby200p0-64bit/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby200p0-64bit/bin
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/Ruby200p0-64bit/lib/ruby/gems/2.0.0
- C:/Users/Mike/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc --env-shebang"
- REMOTE SOURCES:
- https://rubygems.org/
C:\Users\Mike\Desktop\GemBuild>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/devkit-64bit/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.2/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: /home/ruben/mingw-w64/src/gcc/configure --host=x86_64-w64-mingw32 --build=x86_64-linux-gnu --target=x86_64-w64-mingw32 --with-sysroot=/home/ruben/mingw-w64/mingw64mingw64/mingw64 --prefix=/home/ruben/mingw-w64/mingw64mingw64/mingw64 --with-gmp=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-mpfr=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-mpc=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-ppl=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-cloog=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --disable-ppl-version-check --disable-cloog-version-check --enable-cloog-backend=isl --with-host-libstdcxx='-static -lstdc++ -lm' --enable-shared --enable-static --enable-threads=win32 --enable-plugins --disable-multilib --enable-languages=c,lto,c++,objc,obj-c++,fortran,java --enable-libgomp --enable-fully-dynamic-string --enable-libstdcxx-time --disable-nls --disable-werror --enable-checking=release --with-gnu-as --with-gnu-ld --disable-win32-registry --disable-rpath --disable-werror --with-libiconv-prefix=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-pkgversion=rubenvb-4.7.2-release [email protected] CC= CFLAGS='-O2 -march=nocona -mtune=core2 -fomit-frame-pointer -momit-leaf-frame-pointer' LDFLAGS=
Thread model: win32
gcc version 4.7.2 (rubenvb-4.7.2-release)
Metadata
Metadata
Assignees
Labels
No labels