# Ruby 1.8.7 segmentation faults

**URL:** <https://www.ruby-forum.com/t/ruby-1-8-7-segmentation-faults/178298>\
**Category:** Ruby\
**Created:** [November 2, 2009, 1:27pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-segmentation-faults/178298 "2009-11-02T13:27:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [November 2, 2009, 1:27pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-segmentation-faults/178298/1 "2009-11-02T13:27:55Z")

</div>

Hi everyone!

I am getting segmentation faults in several innocuous looking places  
in ruby programs since running them  
on Ubuntu 9.10 (Karmic).

This simple program:

require ‘dbi’  
c = DBI.connect(‘dbi:ODBC:axon-insight’, ‘sa’, ‘fl3nd3r^’)  
p c.select\_all(‘select top 15 \* from log\_device\_healths’)

Produces:

/usr/lib/ruby/gems/1.8/gems/dbd-odbc-0.2.4/lib/dbd/odbc/statement.rb:41:  
[BUG] Segmentation fault  
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]  
Aborted

…running exactly the same code, I also have also once gotten:  
/usr/lib/ruby/gems/1.8/gems/dbd-odbc-0.2.4/lib/dbd/odbc/database.rb:79:  
[BUG] Segmentation fault

What should I do?  
Where do I report this bug?  
Is there any way I can enable a debug mode and help with a more  
detailed bug report (or fix it myself)?

---

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [November 2, 2009, 1:41pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-segmentation-faults/178298/2 "2009-11-02T13:41:23Z")

</div>

On 02/11/09 at 21:27 +0900, Leslie V. wrote:

> Hi everyone!
> 
> I am getting segmentation faults in several innocuous looking places  
> in ruby programs since running them  
> on Ubuntu 9.10 (Karmic).
> 
> […]
> 
> What should I do?  
> Where do I report this bug?

[https://bugs.launchpad.net/ubuntu/+source/ruby1.8/+filebug](https://bugs.launchpad.net/ubuntu/+source/ruby1.8/+filebug)

---

<div class="post-metadata">

**Author:** ![leslieviljoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3d9bf3/32.png) [@leslieviljoen](https://www.ruby-forum.com/u/leslieviljoen)\
**Post date:** [November 2, 2009, 2:51pm UTC](https://www.ruby-forum.com/t/ruby-1-8-7-segmentation-faults/178298/3 "2009-11-02T14:51:02Z")

</div>

On Mon, Nov 2, 2009 at 2:41 PM, Lucas N.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Where do I report this bug?
> 
> [OpenID transaction in progress](https://bugs.launchpad.net/ubuntu/+source/ruby1.8/+filebug)

For anyone else who might run into this…

I was running into this error when trying to use RubyODBC  
(ActiveRecord connecting to mssql server):  
DBI::DatabaseError : INTERN (0) [RubyODBC] Cannot allocate SQLHENV

…to fix that I followed the steps here:

> <https://stackoverflow.com/questions/1419397/rubyodbc-cannot-allocate-sqlhenv>

…which are:  
wget [http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz](http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz)  
tar xzvf ruby-odbc-0.9997.tar.gz  
cd ruby-odbc-0.9997  
ruby extconf.rb --with-dlopen  
make  
sudo make install

…to compile, this requires either libiodbc2-dev or unixodbc-dev, and  
I had tried libiodbc2-dev.  
I went back and removed iodbc and installed unixodbc-dev, recompiled  
rubyodbc and now it works!

I will try and figure out the right people to report this issue to.
