mysql-ruby segmentation fault when closing connection

M

miklawlor

I have been having a strange issue with the mysql-ruby package and
can't seem to find any posts anywhere on the net that have been
helpful. The package makes and installs perfectly, and in-fact it even
connects to the MySQL database and can perform queries. However, any
attempt to close() the connection to the MySQL database produces a
segmentation fault. This has wreaked havoc on my application and caused
me to lose about 25% of the hair on my head trying to figure out where
this segmentation fault is coming from.

Here are the specifics of my installation:

- Fedora Core 4
- MySQL 5.0.19 (with mysql-devel installed)
- Ruby 1.8
- Rails 1.1.0
- mysql-ruby-2.7
- Apache 2.2 /w mod_fcgid (although this is irrelevant as the problem
happens via the web and when running ruby scripts on the command line)

My first attempt to install mysql-ruby was to simply use "gem install
mysql". This appeared to work, until any of my scripts tried to close()
the database connection.

My second try was to download the mysql-ruby-2.7 package and build it
myself. So I ran extconf.rb with the appropriate options without
incident, got myself a make file, and made it - again without incident.
However, when I ran the test.rb, I hit my favourite segmentation fault:

--------------
Loaded suite ./test
Started
.../test.rb:34: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i686-linux]

Aborted
--------------

Looking at the code of test.rb I can see that on line 34, the script
tries to close() the connection... same problem.

Since then, I've tried to use previous versions of mysql-ruby with
similar results and I've reached the point where I don't know what else
to try. If anyone has experienced anything similar, or has an idea
about what may be causing this, pleeeez enlighten me.

Cheers,
Mike
 
X

Xavier

I have been having a strange issue with the mysql-ruby package and
can't seem to find any posts anywhere on the net that have been
helpful. The package makes and installs perfectly, and in-fact it even
connects to the MySQL database and can perform queries. However, any
attempt to close() the connection to the MySQL database produces a
segmentation fault. This has wreaked havoc on my application and caused
me to lose about 25% of the hair on my head trying to figure out where
this segmentation fault is coming from.

Here are the specifics of my installation:

- Fedora Core 4
- MySQL 5.0.19 (with mysql-devel installed)
- Ruby 1.8
- Rails 1.1.0
- mysql-ruby-2.7
- Apache 2.2 /w mod_fcgid (although this is irrelevant as the problem
happens via the web and when running ruby scripts on the command line)

My first attempt to install mysql-ruby was to simply use "gem install
mysql". This appeared to work, until any of my scripts tried to close()
the database connection.

My second try was to download the mysql-ruby-2.7 package and build it
myself. So I ran extconf.rb with the appropriate options without
incident, got myself a make file, and made it - again without incident.
However, when I ran the test.rb, I hit my favourite segmentation fault:

--------------
Loaded suite ./test
Started
../test.rb:34: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i686-linux]


I had exactly the same issue after a mysql upgrade.
Recompiling mysql-ruby and ruby-dbi solved it for me.

FYI:
dev-ruby/mysql-ruby-2.7
dev-ruby/ruby-dbi-0.0.21-r2
dev-lang/ruby-1.8.4.20060226
dev-db/mysql-5.0.19-r1


Hth
 
D

disbelief

Xavier,

Thanks very much for your reply. I'm happy to hear that someone else
had this problem and solved it, I was beginning to lose hope.

I don't even have the ruby-dbi package installed on this box. I didn't
see any mention of it in the rails docs concerning mysql-ruby
installation. Do you know if the dbi package is a requirement for
mysql-ruby to work properly? Could it be that my problems were related
to NOT having it?

Thanks again for your help
-mike
 
X

Xavier

Xavier,

Thanks very much for your reply. I'm happy to hear that someone else
had this problem and solved it, I was beginning to lose hope.

I don't even have the ruby-dbi package installed on this box. I didn't
see any mention of it in the rails docs concerning mysql-ruby
installation. Do you know if the dbi package is a requirement for
mysql-ruby to work properly? Could it be that my problems were related
to NOT having it?

Thanks again for your help
-mike

I guess ruby-dbi is not required but as I use mysql-ruby though it, I just
recompiled both, and it just worked.

Sorry I can't be of any more assistance.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top