[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

mysql-ruby segmentation fault when closing connection

miklawlor

4/26/2006 4:10:00 PM

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

3 Answers

Xavier

4/27/2006 7:20:00 AM

0

On Wed, 26 Apr 2006 09:10:20 -0700, miklawlor wrote:

> 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

miklawlor

4/27/2006 2:53:00 PM

0

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

Xavier

4/27/2006 6:22:00 PM

0

On Thu, 27 Apr 2006 07:52:58 -0700, disbelief wrote:

> 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.