Re: Patch for DBI dataloss problem



Looks fine, though the DBI.xs change (assert) isn't needed and isn't in the DBI code.

Tim.

On Tue, Jun 19, 2007 at 12:43:53AM +0200, Christian Hammers wrote:
Hello

As reported in the Debian bug tracking system. Can you comment if this
patch is OK?

bye,

-christian-



From: Tim Cutts <tjrc@xxxxxxxxxxxx>
To: ch@xxxxxxxxxx
Subject: libdbi-perl 1.55
Date: Mon, 14 May 2007 11:48:26 +0100
X-Mailer: Apple Mail (2.752.2)

Hi Christian,

One of the changes introduced in DBI 1.55 is a very small fix which
fixes a bug which can really cause data loss (a problem with
selectall_arrayref). The bug was spotted by one of my colleagues
here (Rob Davies, whom Tim Bunce credits in the changelog). We have
actually seen it cause real data loss here, so it's not just a
theoretical problem.

What I was wondering was whether there is any way we can get that fix
into Debian on etch's next point release? The patch to fix that
particular issue is as follows:

diff -Naur DBI-1.54/DBI.xs DBI-1.54.patched/DBI.xs
--- DBI-1.54/DBI.xs 2007-02-22 01:36:15.000000000 +0000
+++ DBI-1.54.patched/DBI.xs 2007-04-26 09:38:00.667000000 +0100
@@ -9,7 +9,7 @@

#define IN_DBI_XS 1 /* see DBIXS.h */
#define PERL_NO_GET_CONTEXT
-
+#include <assert.h>
#include "DBIXS.h" /* DBI public interface for DBD's written in C
*/

# if (defined(_WIN32) && (! defined(HAS_GETTIMEOFDAY)))
@@ -3104,6 +3104,9 @@
outitems = perl_call_sv(isGV(imp_msv) ? (SV*)GvCV(imp_msv) :
imp_msv,
(is_DESTROY ? gimme | G_EVAL | G_KEEPERR : gimme) );
}
+
+ assert(outitems >= 0);
+
SPAGAIN;

/* XXX restore local vars so ST(n) works below */
diff -Naur DBI-1.54/Driver.xst DBI-1.54.patched/Driver.xst
--- DBI-1.54/Driver.xst 2007-02-22 01:36:15.000000000 +0000
+++ DBI-1.54.patched/Driver.xst 2007-04-26 15:15:47.084000000 +0100
@@ -121,6 +121,7 @@
}
else {
sth = dbixst_bounce_method("prepare", 3);
+ SPAGAIN; SP -= items; /* because stack might have been realloc'd */
if (!SvROK(sth))
XSRETURN_UNDEF;
}
@@ -157,6 +158,7 @@
else {
/* --- prepare --- */
sth = dbixst_bounce_method("prepare", 3);
+ SPAGAIN; SP -= items; /* because stack might have been realloc'd */
if (!SvROK(sth)) {
if (is_selectrow_array) { XSRETURN_EMPTY; } else { XSRETURN_UNDEF; }
}
.



Relevant Pages

  • Patch for DBI dataloss problem
    ... As reported in the Debian bug tracking system. ... patch is OK? ... What I was wondering was whether there is any way we can get that fix ...
    (perl.dbi.users)
  • [Un] Unangband 0.6.3 released
    ... Allow player to assemble friendly monsters and carry eggs to hatch ... Updated druidic spells to use new region code. ... Fix lockup bugs generating the Old Forest. ... Fix bug where items dropped by monster death would infinitely ...
    (rec.games.roguelike.announce)
  • please pull from the trivial tree
    ... Fix spelling in E1000_DISABLE_PACKET_SPLIT Kconfig description ... +- Finding patch that caused a bug ... +Always try the latest kernel from kernel.org and build from source. ... Length of input string in bytes ...
    (Linux-Kernel)
  • Subterrane v0.194 Alpha Released
    ... system, a character sheet, a ton of new spells, new monsters, item ... Added a character sheet that displays your character's ... Fix: Fixed a bug in the encumbrance calculation and status display ...
    (rec.games.roguelike.announce)
  • Re: Larkin, Power BASIC cannot be THAT good:
    ... If they did not produce a product with *adequate* quality then customers would not buy it and the company would not make a profit. ... it is to change a product in the field, and Y axis is bug density. ... but when the in service fix is almost free to the supplier then they will exploit that to their advantage. ... On-screen programming is pretty much type and ignite and see what ...
    (sci.electronics.design)