Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^10: Strawberry Perl 64bit on Win7 crashes on DBI-function

by mje (Curate)
on Apr 24, 2014 at 10:53 UTC ( #1083560=note: print w/ replies, xml ) Need Help??


in reply to Re^9: Strawberry Perl 64bit on Win7 crashes on DBI-function
in thread Strawberry Perl 64bit on Win7 crashes on DBI-function

If you get the full list and it segfaults (or whatever) afterwards it does sound like memory/stack corruption but assuming you are using the new version I sent you yesterday I cannot explain why.

Not sure it will really help but you can limit the number of DSNs returned by adding something like:

if (numDataSources > 100) { break; }

just after fDirection = SQL_FETCH_NEXT. If you restrict the number returned and the crash goes away you might be able to identify the entry that causes corruption.


Comment on Re^10: Strawberry Perl 64bit on Win7 crashes on DBI-function
Download Code
Re^11: Strawberry Perl 64bit on Win7 crashes on DBI-function
by theman824 (Novice) on Apr 24, 2014 at 11:48 UTC
    Ok. I'm playing with that now. It works without crash(!) for 10 and 100. I am testing further.

    I did notice that i'm getting this warning though on the "dmake"(probably have overlooked that yesterday):

    dbdimp.c: In function 'odbc_db_STORE_attrib': dbdimp.c:4677:22: warning: cast to pointer from integer of different s +ize [-Wint-to-pointer-cast] dbdimp.c:4679:22: warning: cast to pointer from integer of different s +ize [-Wint-to-pointer-cast] dbdimp.c:4937:18: warning: cast to pointer from integer of different s +ize [-Wint-to-pointer-cast] dbdimp.c:4942:18: warning: cast to pointer from integer of different s +ize [-Wint-to-pointer-cast] dbdimp.c:4962:27: warning: cast to pointer from integer of different s +ize [-Wint-to-pointer-cast]

    Could be interesting.

      You can ignore those. Could I email you a new DBD::ODBC package to try? If so msg me your email address.

        Ok. Thank you, I got the new version. I did the "perl Makefile.PL" and the "dmake" for the "DBD-ODBC-1.49_1". Then i ran
        perl -Ic:\C:\strawberry\DBD-ODBC-1.49_1\blib\lib -IC:\strawberry\DBD-O +DBC-1.49_1\blib\arch -le "use DBI; DBI->data_sources('O DBC');"
        but it complained about the higher version "1.49_1":
        install_driver(ODBC) failed: DBD::ODBC object version 1.49_1 does not +match bootstrap parameter 1.48 at C:/strawberry/perl/lib/DynaLoader.p +m line 213. Compilation failed in require at (eval 4) line 3. at -e line 1.
Re^11: Strawberry Perl 64bit on Win7 crashes on DBI-function
by theman824 (Novice) on Apr 24, 2014 at 12:02 UTC
    Ok. 280 is the magic number. It does not crash with
    if (numDataSources > 280) { break; }.
    And it does crash if i change to
    if (numDataSources > 281) { break; }.
    (The first DSN actually has numDataSources == 0).

    Update:

    There is nothing wrong with the next DSN, when i go to 281 the next one is still retrieved (like with all 310 entries) but it crashes still.

    The last lines of the output are in that case (before crashing):

    (I added "numDataSources" in the output as you can see:)
    /(276)/, /DF203BPA/ (8), /IBM DB2 ODBC DRIVER - DB2RTCL9N/ (31) /(277)/, /DF203BPE/ (8), /IBM DB2 ODBC DRIVER - DB2RTCL9N/ (31) /(278)/, /DF203BS/ (7), /IBM DB2 ODBC DRIVER - DB2RTCL9N/ (31) /(279)/, /DF203BPM/ (8), /IBM DB2 ODBC DRIVER - DB2RTCL9N/ (31) /(280)/, /DF203CEI/ (8), /IBM DB2 ODBC DRIVER - DB2RTCL9N/ (31) /(281)/, /DF203CMN/ (8), /IBM DB2 ODBC DRIVER - DB2RTCL9N/ (31)
Re^11: Strawberry Perl 64bit on Win7 crashes on DBI-function
by theman824 (Novice) on Apr 24, 2014 at 13:34 UTC

    I am now thinking hard about this line in "ODBC.xs":

    ST(numDataSources++) = newSVpv(dsn, dsn_length+9 /* strlen("dbi:ODBC:") */ );

    Not sure if this always does what one expects on first glance. I am refering to the left side of the "=".

      That puts the scalars on the stack. I've rewritten data_sources to not use the stack. See my other comment.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1083560]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-12-27 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls