Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 92172
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: ilmari+cpan [...] ilmari.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.630
Fixed in: (no value)



err_hash() blindly calls SvCUR(DBIc_ERR(imp_xxh)), which might fail if the SV doesn't have a PV. This causes assertions with DBD::Pg and DBD::mysql on debugging perls, because they only ever sv_setiv() it. Minimal reproduction: $ perl -MDBI -e 'print DBI->install_driver("Pg")->{Version}' perl: DBI.xs:866: err_hash: Assertion `PL_valid_types_PVX[((svtype)((_svcur)->sv_flags & 0xff)) & 0xf] || ((svtype)((_svcur)->sv_flags & 0xff)) == SVt_REGEXP' failed.
Odd. I can't reproduce this using Pg. I even tried adding err_sv = newSViv(0) just before the line. Could you add sv_dump(err_sv) just before the line so we can see the details of the SV? Please also include perl -V output.
Note, you need a perl built with -DDEBUGGING to reproduce this. Here's the output with sv_dump(err_sv) added just before the failing SvCUR(err_sv): ilmari@zarquon:~/src/DBI$ perl -Mblib -MDBI -e 'print DBI->install_driver("Pg")->{Version}' SV = IV(0x207ed28) at 0x207ed38 REFCNT = 2 FLAGS = (IOK,pIOK) IV = 0 perl: DBI.xs:867: err_hash: Assertion `PL_valid_types_PVX[((svtype)((_svcur)->sv_flags & 0xff)) & 0xf] || ((svtype)((_svcur)->sv_flags & 0xff)) == SVt_REGEXP' failed. Aborted (core dumped) That is clearly an SV that has only ever been sv_setiv()'d, so SvCUR() doesn't make sense. What is this statement trying to achieve, semantically? hash |= (SvTRUE(err_sv)) ? 0x80000000 /* err, or warn, or info */ : (SvCUR(err_sv) ) ? 0x40000000 : 0x20000000;
Fixed in 1.631. Thanks!