Segfault when requiring both mysql and mechanize

Discussion in 'Ruby' started by Rod Dik, Jun 13, 2009.

  1. Rod Dik

    Rod Dik Guest

    Hello, there's a simple script

    require 'rubygems'
    require 'mysql'
    require 'mechanize' #it works if I delete this string

    m = Mysql.new('localhost', 'h3', 'h3', 'h3')

    that fails with

    C:/Program Files/ActiveState Komodo IDE
    5/lib/support/dbgp/rubylib/rdbgp/processor.rb:370: [BUG] Segmentation
    fault
    ruby 1.8.6 (2008-08-11) [i386-mswin32]

    but, doesn't fail if I comment out the string requiring mechanize. How
    can I fix it? TIA
    --
    Posted via http://www.ruby-forum.com/.
     
    Rod Dik, Jun 13, 2009
    #1
    1. Advertising

  2. Rod Dik

    Mike West Guest

    I am having the same problem in 1.9 however I don't use mechanize. My
    script worked fine in version 1.8.6 but after the upgrade generates a
    segmentation fault:

    C:/Program
    Files/ruby-1.9.1/lib/ruby/gems/1.9.1/gems/mysql-2.7.1-x86-mswin32/ext/mysql.so:
    [BUG] Segmentation faul
    ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]

    -- control frame ----------
    c:0005 p:-2710104 s:0031 b:0031 l:000030 d:000030 TOP
    c:0004 p:---- s:0029 b:0029 l:000028 d:000028 CFUNC :require
    c:0003 p:0023 s:0025 b:0025 l:000e5c d:000168 EVAL lib/rssbuilder.rb:5
    c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
    c:0001 p:0000 s:0002 b:0002 l:000e5c d:000e5c TOP <main>:427
    ---------------------------
    -- Ruby level backtrace
    information-----------------------------------------
    lib/rssbuilder.rb:5:in `require'
    lib/rssbuilder.rb:5:in `<main>'

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

    Rod Dik wrote:
    > Hello, there's a simple script
    >
    > require 'rubygems'
    > require 'mysql'
    > require 'mechanize' #it works if I delete this string
    >
    > m = Mysql.new('localhost', 'h3', 'h3', 'h3')
    >
    > that fails with
    >
    > C:/Program Files/ActiveState Komodo IDE
    > 5/lib/support/dbgp/rubylib/rdbgp/processor.rb:370: [BUG] Segmentation
    > fault
    > ruby 1.8.6 (2008-08-11) [i386-mswin32]
    >
    > but, doesn't fail if I comment out the string requiring mechanize. How
    > can I fix it? TIA


    --
    Posted via http://www.ruby-forum.com/.
     
    Mike West, Jun 19, 2009
    #2
    1. Advertising

  3. Rod Dik

    Roger Pack Guest

    >
    > C:/Program
    > Files/ruby-1.9.1/lib/ruby/gems/1.9.1/gems/mysql-2.7.1-x86-mswin32/ext/mysql.so:
    > [BUG] Segmentation faul
    > ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]


    What about with a newer version of ruby?
    -=r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Jun 19, 2009
    #3
  4. Rod Dik

    Mike West Guest

    There are no binaries for the Windows version greater than 1.9.1.

    I tried installing 1.8.7 but the windows distribution seems incomplete.

    Other scripts work fine in 1.9.

    Roger Pack wrote:
    >>
    >> C:/Program
    >> Files/ruby-1.9.1/lib/ruby/gems/1.9.1/gems/mysql-2.7.1-x86-mswin32/ext/mysql.so:
    >> [BUG] Segmentation faul
    >> ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]

    >
    > What about with a newer version of ruby?
    > -=r


    --
    Posted via http://www.ruby-forum.com/.
     
    Mike West, Jun 19, 2009
    #4
  5. Rod Dik

    Roger Pack Guest

    Mike West wrote:
    > There are no binaries for the Windows version greater than 1.9.1.


    I was thinking more of a higher patch level.
    -=r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Jun 19, 2009
    #5
  6. Rod Dik

    Mike West Guest

    I'm getting the same problem with 1.9.1 p129

    Roger Pack wrote:
    > Mike West wrote:
    >> There are no binaries for the Windows version greater than 1.9.1.

    >
    > I was thinking more of a higher patch level.
    > -=r


    --
    Posted via http://www.ruby-forum.com/.
     
    Mike West, Jun 19, 2009
    #6
  7. Rod Dik

    Luis Lavena Guest

    On Jun 19, 3:45 pm, Mike West <> wrote:
    > I am having the same problem in 1.9 however I don't use mechanize. My
    > script worked fine in version 1.8.6 but after the upgrade generates a
    > segmentation fault:
    >
    > C:/Program
    > Files/ruby-1.9.1/lib/ruby/gems/1.9.1/gems/mysql-2.7.1-x86-mswin32/ext/mysql .so:
    > [BUG] Segmentation faul
    > ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]
    >


    How did you upgraded your Ruby? Also, did you build from source mysql
    gem?

    AFAIK the binary version of mysql gem is *only* for 1.8, and can't
    work with 1.9 without being recompiled and linked to Ruby 1.8 runtime/
    shared library.

    --
    Luis Lavena
     
    Luis Lavena, Jun 20, 2009
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ABCL
    Replies:
    0
    Views:
    567
  2. Andrey Vul
    Replies:
    8
    Views:
    698
    Richard Bos
    Jul 30, 2010
  3. Carl Bernardi
    Replies:
    8
    Views:
    223
    Marcin Raczkowski
    Feb 4, 2008
  4. Marc Weber
    Replies:
    1
    Views:
    156
    Marc Weber
    Feb 26, 2010
  5. Dave Lilley

    mysql gem segfault on line 343

    Dave Lilley, Dec 15, 2010, in forum: Ruby
    Replies:
    5
    Views:
    146
    Robert Klemme
    Dec 16, 2010
Loading...

Share This Page