col wrote: > [x-posted to unixODBC list] > > Is not possible in this combination since many version updates now. > > I'd like to get current AND with a working configuration. > > Working tunnel: ssh u...@the.pub.ip.add -q -f -N -L 1799:192.168.243.140:1433 > (Yes, tsql works, no problems with the tunnel.) > > Very simple perl script: > > my $DSN="Server=127.0.0.1;Port=1799;Database=THEDB;UID=THEUSER;PWD=THEPWD"; > > my $dbh = DBI->connect("dbi:ODBC:$DSN",'THEUSER','THEPWD'); > > (And that's it. 'localhost' in the DSN makes no difference.) > > strace ends like: > > open("/usr/lib/gconv/CP1252.so", O_RDONLY) = 4 > read(4, > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\3\0\0004\0\0\0\320"..., > 512) = 512 > fstat64(4, {st_mode=S_IFREG|0755, st_size=9400, ...}) = 0 > mmap2(NULL, 12316, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = > 0xb7b3d000 > mmap2(0xb7b3f000, 8192, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x1) = 0xb7b3f000 > close(4) = 0 > mprotect(0xb7b3f000, 4096, PROT_READ) = 0 > --- SIGSEGV (Segmentation fault) @ 0 (0) --- > +++ killed by SIGSEGV +++ > > Following this guide: > > http://www.freetds.org/userguide/odbcinionly.htm > "An ODBC-only configuration relies solely on odbc.ini for server properties." > > [This is what is expected, then, right?] > > Checking with this: > > strace perl odbctest.pl 2>&1 |grep odbc > > execve("/usr/bin/perl", ["perl", "odbctest.pl"], [/* 47 vars */]) = 0 > open("odbctest.pl", O_RDONLY|O_LARGEFILE) = 3 > open("/usr/lib/libodbc.so.1", O_RDONLY) = 3 > open("/etc/unixODBC/odbcinst.ini", O_RDONLY) = 3 > access("/etc/unixODBC/odbc.ini", F_OK) = 0 > stat64("/etc/unixODBC/odbc.ini", {st_mode=S_IFREG|0644, st_size=365, ...}) = 0 > open("/etc/unixODBC/odbcinst.ini", O_RDONLY) = 3 > > Why is it trying to open odbcinst.ini, then? > > Something changed with unixODBC version > 2.2.11 which caused this, as > reverting to that old version is all that's required to get working again. > > Help? > > Cheers, > I see you've already posted on the unixODBC list. That list and the freeTDS list are probably the best lists to diagnose why you get a segmentation fault. An ODBC-only setup uses more than 1 file for configuration. The odbcinst.ini file is used to define ODBC drivers and the odbc.ini file defines your ODBC drivers. There is a pretty good explanation at http://www.easysoft.com/developer/interfaces/odbc/linux.html.
As Nick said on the unixODBC list, you could help diagnose where it is crashing by getting a unixODBC trace as that would show you what ODBC API in the driver or driver manager it is crashing in. You can do this by adding the following to your odbcinst.ini file: [ODBC] Trace = yes TraceFile = /tmp/unixodbc.log then running the perl again. Martin -- Martin J. Evans Easysoft Limited http://www.easysoft.com