Trace:

>> ping DISPATCH (DBI::db=HASH(0xce2d58) rc1/1 @1 g2 ima405 + pid#3528) at test.pl line 20 -> ping for DBD::mysql::db (DBI::db=HASH(0xce2d58)~0xcf0178) thr#9 +a1010 <- ping= ( 1 ) [1 items] at test.pl line 20 OK >> ping DISPATCH (DBI::db=HASH(0xce2d58) rc1/1 @1 g2 ima405 + pid#3528) at test.pl line 20 -> ping for DBD::mysql::db (DBI::db=HASH(0xce2d58)~0xcf0178) thr#9 +a1010 <- ping= ( 1 ) [1 items] at test.pl line 20 OK >> ping DISPATCH (DBI::db=HASH(0xce2d58) rc1/1 @1 g2 ima405 + pid#3528) at test.pl line 20 -> ping for DBD::mysql::db (DBI::db=HASH(0xce2d58)~0xcf0178) thr#9 +a1010 <- ping= ( 1 ) [1 items] at test.pl line 20 OK >> ping DISPATCH (DBI::db=HASH(0xce2d58) rc1/1 @1 g2 ima405 + pid#3528) at test.pl line 20 -> ping for DBD::mysql::db (DBI::db=HASH(0xce2d58)~0xcf0178) thr#9 +a1010 imp_dbh->pmysql: d39230 my_login IMPSET but not ACTIVE so connect not skipped imp_dbh->my_login : dbname = test, uid = root, pwd = ,host = 127.0.0.1 +, port = 3306 imp_dbh->mysql_dr_connect: host = |127.0.0.1|, port = 3306, uid = root +, pwd = imp_dbh->bind_type_guessing: 0 imp_dbh->use_server_side_prepare: 0 imp_dbh->mysql_dr_connect: client_flags = 2 imp_dbh->mysql_dr_connect: <- --> do_error Can't connect to MySQL server on '127.0.0.1' (111) error 2003 recorded +: Can't connect to MySQL server on '127.0.0.1' (111) <-- do_error !! ERROR: 2003 'Can't connect to MySQL server on '127.0.0.1' (111) +' (err#0) <- ping= ( '' ) [1 items] at test.pl line 20 DBD::mysql::db ping failed: Can't connect to MySQL server on '127.0.0. +1' (111) at test.pl line 20. FAILED >> ping DISPATCH (DBI::db=HASH(0xce2d58) rc1/1 @1 g2 ima405 + pid#3528) at test.pl line 20 -> ping for DBD::mysql::db (DBI::db=HASH(0xce2d58)~0xcf0178) thr#9 +a1010 imp_dbh->pmysql: d39230 my_login IMPSET but not ACTIVE so connect not skipped imp_dbh->my_login : dbname = test, uid = root, pwd = ,host = 127.0.0.1 +, port = 3306 imp_dbh->mysql_dr_connect: host = |127.0.0.1|, port = 3306, uid = root +, pwd = imp_dbh->bind_type_guessing: 0 imp_dbh->use_server_side_prepare: 0 imp_dbh->mysql_dr_connect: client_flags = 2 imp_dbh->mysql_dr_connect: <-*** Error in `perl': double free or corru +ption (!prev): 0x0000000000d39230 *** Aborted

Seems that when Ping is called from connection established by itself and this connection failed, memory is not handled properly inside mysql_dr_connect. Maybe i must just check if Ping returned a valid conection before calling it again.

Anyways using DBI->connect_cached instead of Ping solved my problem.

although I still curious.


In reply to Re^2: DBD::mysql Ping segmentation fault by RndNoob
in thread DBD::mysql Ping segmentation fault by RndNoob

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.