#941707 ruby-odbc: [RubyODBC]Cannot allocate SQLHENV (ODBC::Error)

Package:
ruby-odbc
Source:
ruby-odbc
Description:
ODBC Binding for Ruby
Submitter:
Martin Dorey
Date:
2026-02-18 22:01:02 UTC
Severity:
normal
Tags:
#941707#5
Date:
2019-10-04 01:20:34 UTC
From:
To:
Dear Maintainer,

ruby-odbc does this, at least for me, on Buster:

martind@neutrino:~$ ruby -we 'require "odbc"; ODBC.drivers()'
Traceback (most recent call last):
	1: from -e:1:in `<main>'
-e:1:in `drivers': INTERN (0) [RubyODBC]Cannot allocate SQLHENV (ODBC::Error)
martind@neutrino:~$

The same test on the same configuration on Stretch is silent:

martind@scoot:~$ ruby -we 'require "odbc"; ODBC.drivers()'
martind@scoot:~$

I do have non-default /etc/odbc{,inst}.ini files but removing them doesn't affect this test.

Buoyed by a mention of Stretch here:

https://bugs.launchpad.net/raspbian/+bug/1832778

... I thought that maybe this blast from the past could have come back:

http://opensysblog.directorioc.net/2013/07/rubyodbccannot-allocate-sqlhenv.html

The change log in:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=889025

... included:

   * Refresh 001extconf_dlopen.patch

Reverting that fixed the problem.
These are the steps I took:

aptitude source ruby-odbc
sudo aptitude install gem2deb
tar --xz -xf ruby-odbc_0.99998-1.debian.tar.xz
debian/patches/ext_enable_dlopen.patch
cd ruby-odbc-0.99998/
patch -p1 -R < ../debian/patches/ext_enable_dlopen.patch
dpkg-buildpackage -b -nc -uc
sudo dpkg -i ../ruby-odbc_0.99998-1_amd64.deb

I can't say I understand why Debian would have to disable dlopen here.
But the package appears unusuable without that, for me.

#941707#10
Date:
2023-04-16 19:19:27 UTC
From:
To:
The reproducer I gave here, which still seems reliable for me on Buster,
doesn't reproduce the problem for me on Bullseye with 0.99998-2,
despite nothing in the change log at
https://metadata.ftp-master.debian.org/changelogs//main/r/ruby-odbc/ruby-odbc_0.99998-2_changelog
appearing relevant.  The Bullseye version won't install on Buster, with a
dependency on Bullseye's version of Ruby and won't easily build on Buster,
with a debhelper-compat change and:

dwz:
debian/ruby-odbc/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/odbc.so:
DWARF version 0 unhandled

... which perhaps is avoided on Bullseye by its newer binutils, per eg
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967005#39.  Using
ruby-odbc under Bullseye's Ruby has its own problem - warnings of the
deprecation of tainting - but that deserves its own bug report.

#941707#17
Date:
2026-02-18 21:57:51 UTC
From:
To:
It went in Bullseye, but it's back in Bookworm and Trixie :-(.