Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storable.dll causes ODBC Table name truncation in DBI #15728

Closed
p5pRT opened this issue Nov 22, 2016 · 5 comments
Closed

Storable.dll causes ODBC Table name truncation in DBI #15728

p5pRT opened this issue Nov 22, 2016 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 22, 2016

Migrated from rt.perl.org#130145 (status was 'rejected')

Searchable as RT130145$

@p5pRT
Copy link
Author

p5pRT commented Nov 22, 2016

From michael.okeefe@sdbmwmc.com

Created by michael.okeefe@sdbmwmc.com

Using DBI to access ODBC Paradox Databases works fine, unless Storable
is used anywhere.

use strict;
use DBI;

#use Storable;
#my $dsn = q(dbi​:Proxy​:hostname=localhost;port=58000;dsn=dbi​:ODBC​:);
my $dsn = q(dbi​:ODBC​:DSN=);

my $test = DBI->connect($dsn . q(Test),q(),q()) || die "Could not
connect to database​: $DBI​::errstr";
my $sql = q{SELECT ColumnField FROM LongTableName};
my $query = $test->prepare($sql);
$query->execute() or die($main​::errstr);
while (my $result = $query->fetchrow_hashref()) {
warn($result->{ColumnField}); }
$query->finish();
$test->disconnect();

This works fine.
Uncomment the "use Storable", and ODBC driver complains that
LongTableName cannot be found.
Using ProcessExplorer, I found that the filename that the driver was
then trying to open was truncated to 8 chars (ie LongTabl)
Using the dbiproxy instead of direct local access to the ODBC is fine as
well.
I found that commenting out the ...

XSLoader​::load('Storable', $Storable​::VERSION);

from Storable.pm stopped the truncation.
But then Storable was unusable.

That's as far as I got without debugging the Storable.dll

Perl Info

Flags:
     category=library
     severity=high
     module=Storable

Site configuration information for perl 5.22.0:

Configured by gecko at Mon Jul 20 18:53:42 2015.

Summary of my perl5 (revision 5 version 22 subversion 0) configuration:

   Platform:
     osname=MSWin32, osvers=5.2, archname=MSWin32-x86-multi-thread-64int
     uname=''
     config_args='undef'
     hint=recommended, useposix=true, d_sigaction=undef
     useithreads=define, usemultiplicity=define
     use64bitint=define, use64bitall=undef, uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='undef', ccflags =' -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS 
-DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv 
-fno-strict-aliasing -mms-bitfields',
     optimize='-s -O2',
     cppflags='-DWIN32'
     ccversion='', gccversion='4.6.3', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678, 
doublekind=3
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8, 
longdblkind=3
     ivtype='long long', ivsize=8, nvtype='double', nvsize=8, 
Off_t='long long', lseeksize=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='undef', ldflags ='-s -static-libgcc -static-libstdc++ 
-L"C:\Perl32-5.22.0\lib\CORE" -L"C:\MinGW\i686-w64-mingw32\lib"'
     libpth=C:\MinGW\i686-w64-mingw32\lib
     libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 
-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr 
-lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
     perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool 
-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid 
-lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
     libc=, so=dll, useshrplib=true, libperl=libperl522.a
     gnulibc_version=''
   Dynamic Linking:
     dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
     cccdlflags=' ', lddlflags='-mdll -s -static-libgcc 
-static-libstdc++ -L"C:\Perl32-5.22.0\lib\CORE" 
-L"C:\MinGW\i686-w64-mingw32\lib"'

Locally applied patches:
     ActivePerl Build 2200 [299195]


@INC for perl 5.22.0:
     C:/Perl32-5.22.0/site/lib
     C:/Perl32-5.22.0/lib
     .


Environment for perl 5.22.0:
     HOME (unset)
     LANG (unset)
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
     PATH=C:\Program Files\Windows Resource 
Kits\Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program 
Files\Microsoft SQL Server\90\Tools\binn\;D:\Program 
Files\Java\jdk1.6.0_21\bin;D:\ADP\php\
     PERL_BADLANG (unset)
     SHELL (unset)

@p5pRT
Copy link
Author

p5pRT commented Feb 2, 2017

From @tonycoz

On Mon, 21 Nov 2016 16​:27​:52 -0800, michael.okeefe@​sdbmwmc.com wrote​:

Using DBI to access ODBC Paradox Databases works fine, unless Storable
is used anywhere.

use strict;
use DBI;

#use Storable;
#my $dsn = q(dbi​:Proxy​:hostname=localhost;port=58000;dsn=dbi​:ODBC​:);
my $dsn = q(dbi​:ODBC​:DSN=);

my $test = DBI->connect($dsn . q(Test),q(),q()) || die "Could not
connect to database​: $DBI​::errstr";
my $sql = q{SELECT ColumnField FROM LongTableName};
my $query = $test->prepare($sql);
$query->execute() or die($main​::errstr);
while (my $result = $query->fetchrow_hashref()) {
warn($result->{ColumnField}); }
$query->finish();
$test->disconnect();

This works fine.
Uncomment the "use Storable", and ODBC driver complains that
LongTableName cannot be found.
Using ProcessExplorer, I found that the filename that the driver was
then trying to open was truncated to 8 chars (ie LongTabl)
Using the dbiproxy instead of direct local access to the ODBC is fine
as
well.
I found that commenting out the ...

XSLoader​::load('Storable', $Storable​::VERSION);

from Storable.pm stopped the truncation.
But then Storable was unusable.

That's as far as I got without debugging the Storable.dll

Unfortunately it's unlikely that any of us has easy access to Paradox which means we can't attempt to reproduce it, let alone debug it.

You might try running your program under DrMemory​:

http​://www.drmemory.org/

to see if it detects any issues, otherwise it's unlikely we can help you.

Tony

@p5pRT
Copy link
Author

p5pRT commented Feb 2, 2017

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Dec 7, 2017

From @tonycoz

On Wed, 01 Feb 2017 20​:19​:15 -0800, tonyc wrote​:

On Mon, 21 Nov 2016 16​:27​:52 -0800, michael.okeefe@​sdbmwmc.com wrote​:

Using DBI to access ODBC Paradox Databases works fine, unless
Storable
is used anywhere.

use strict;
use DBI;

#use Storable;
#my $dsn = q(dbi​:Proxy​:hostname=localhost;port=58000;dsn=dbi​:ODBC​:);
my $dsn = q(dbi​:ODBC​:DSN=);

my $test = DBI->connect($dsn . q(Test),q(),q()) || die "Could not
connect to database​: $DBI​::errstr";
my $sql = q{SELECT ColumnField FROM LongTableName};
my $query = $test->prepare($sql);
$query->execute() or die($main​::errstr);
while (my $result = $query->fetchrow_hashref()) {
warn($result->{ColumnField}); }
$query->finish();
$test->disconnect();

This works fine.
Uncomment the "use Storable", and ODBC driver complains that
LongTableName cannot be found.
Using ProcessExplorer, I found that the filename that the driver was
then trying to open was truncated to 8 chars (ie LongTabl)
Using the dbiproxy instead of direct local access to the ODBC is
fine
as
well.
I found that commenting out the ...

XSLoader​::load('Storable', $Storable​::VERSION);

from Storable.pm stopped the truncation.
But then Storable was unusable.

That's as far as I got without debugging the Storable.dll

Unfortunately it's unlikely that any of us has easy access to Paradox
which means we can't attempt to reproduce it, let alone debug it.

You might try running your program under DrMemory​:

http​://www.drmemory.org/

to see if it detects any issues, otherwise it's unlikely we can help
you.

No response in 11 months. Closing.

Tony

@p5pRT
Copy link
Author

p5pRT commented Dec 7, 2017

@tonycoz - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant