RE: [CDBI] Bizarre problem,semi-reproducable

[prev] [thread] [next] [Date index for 2006/01/18]

From: Dylan Vanderhoof
Subject: RE: [CDBI] Bizarre problem,semi-reproducable
Date: 02:56 on 18 Jan 2006
Running it within the debugger throws the following exception (with or =
without the breakpoint set):

Caught exception "Bizarre copy of HASH in leave at =
/usr/lib/perl5/site_perl/5.8.6/Class/DBI/Sweet.pm line 309, <DATA> line =
1."


(In case it isn't obvious, this is the first time I've needed to use =
either SQL abstraction classes, or Catalyst, so debugging is confounding =
me a bit)

-Dylan

-----Original Message-----
From: Matt S Trout [mailto:dbix-class@xxxxx.xx.xx]
Sent: Tuesday, January 17, 2006 6:30 PM
To: Dylan Vanderhoof
Cc: classdbi@xxxxx.xxxxxxxxxxxxxxxx.xxx
Subject: Re: [CDBI] Bizarre problem,semi-reproducable


On Tue, Jan 17, 2006 at 06:12:41PM -0800, Dylan Vanderhoof wrote:
> Hello all,
> 	I'm not sure the best way to describe this issue, but I'll do what I =
can.  I don't know if this is a problem with Class-DBI, or Catalyst, or =
something else, but I'm wondering if anybody has seen anything =
resembling this at all.
>=20
> The very short summary: I'm retrieving some values from a Class::DBI =
object (via a couple lookup tables as well), and pushing it in a string =
with some static text into two different arrays.  This process is then =
repeated n number of times.  On a later iteration, during one of the =
lookup instructions, the text in one of the already populated arrays is =
changed.  (A couple characters are missing, specifically).  Its more or =
less the same characters every time.  (About 3 different places I've =
seen it, but its pretty consistant)  It does not happen every time this =
is run, maybe 1 in 4 times.  There are no errors, just missing text.  =
Its not a thread issue or anything like that, as I've tried it with =
apache in single-thread mode and nothing else accessing the DB and it =
still shows this issue.
>=20
> Below is a debug log of what's happening:
>=20
> [Tue Jan 17 17:58:01 2006] [catalyst] [debug] Pre-dbi defs:
> =
DEF:ifOutDiscards=3D/srv/torrus/collector_snr/2/2/15.2.2.fakedomain.com_F=
a9_17_if-mib.rrd:ifOutDiscards:AVERAGE
> [Tue Jan 17 17:58:01 2006] [catalyst] [debug] Post-dbi defs:
> =
DEF:ifOutDiscards=3D/srv/torrus/collector_snr/2/2/15.2.2.fakedomain.com_F=
a9_17_if-mib.rrd:ifOutDiscards:AVERAGE
> [Tue Jan 17 17:58:01 2006] [catalyst] [debug] Post-path defs:
> =
DEF:ifOutDiscards=3D/srv/torrus/collector_snr/2/2.2.fakedomain.com_Fa9_17=
_if-mib.rrd:ifOutDiscards:AVERAGE
> [Tue Jan 17 17:58:01 2006] [catalyst] [debug] Pre-push defs:
> =
DEF:ifOutDiscards=3D/srv/torrus/collector_snr/2/2.2.fakedomain.com_Fa9_17=
_if-mib.rrd:ifOutDiscards:AVERAGE
>=20
> This is the second iteration through the loop.  The data being called =
"defs" here is from the first iteration.  You can see in what I'm =
calling the post-path line, the characters "2/15" were pulled from the =
string.
>=20
> Below is the code that's causing this, with debug messages.
>=20
>    my @vnames;
>     my @lines;
>=20
>     foreach my $graph (@graphs)
>     {
>         # Spin through the graphs and put together the last few =
arguments for the RRDs::graph function
>=20
>         $c->log->debug("Pre-dbi defs:\n@vnames");
>=20
>         my $rra =3D NetResponse::Model::CDBI::Rras->retrieve( $graph ) =
|| die "Unable to retrieve rra";
>         $c->log->debug("Post-dbi defs:\n@vnames");

          $DB::single =3D 1; # and load your app under the perl debugger

>         my $rrd_path =3D $rra->rrd_path_id->rrd_path;
>         $c->log->debug("Post-path defs:\n@vnames");
>         my $rra_cf =3D $rra->cf;
>         my $rra_name =3D $rra->rra_name_id->name;
>=20
>         $c->log->debug("Pre-push defs:\n@vnames");
>         push(@vnames,"DEF:$rra_name=3D$rrd_path:$rra_name:$rra_cf");
>         push(@lines,"LINE1:$rra_name\#00FF00:$rra_name\\c");
>         $c->log->debug("DEF:$rra_name=3D$rrd_path:$rra_name:$rra_cf");
>         $c->log->debug("defs:\n@vnames");
>     }
>=20
>=20
>=20
> You can see from the debugging that the change to the array is =
happening during the line "my $rrd_path =3D =
$rra->rrd_path_id->rrd_path;"
> $rra is an instance of NetResponse::Model::CDBI::Rras, which has a =
base class of NetResponse::Model::CDBI, which has a base class of =
Catalyst::Model::CDBI and uses Catalyst::Model::CDBI::Sweet.
>=20
> Has anybody seen anything like this before, or have even the slightest =
idea what might be going on?  I have tried to troubleshoot this in every =
way I know how, but I am at a total loss, since during the line where =
the array is changed, the array should not even be being accessed.
>=20
> Thanks,
> Dylan
>=20
> _______________________________________________
> ClassDBI mailing list
> ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
> http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

--=20
     Matt S Trout       Offering custom development, consultancy and =
support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. =
Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more =
information

 + Help us build a better perl ORM: =
http://dbix-class.shadowcatsystems.co.uk/ +

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Bizarre problem,semi-reproducable
Dylan Vanderhoof 02:12 on 18 Jan 2006

Re: [CDBI] Bizarre problem,semi-reproducable
Matt S Trout 02:29 on 18 Jan 2006

RE: [CDBI] Bizarre problem,semi-reproducable
Dylan Vanderhoof 02:56 on 18 Jan 2006

RE: [CDBI] Bizarre problem,semi-reproducable
Dylan Vanderhoof 06:07 on 18 Jan 2006

Generated at 20:45 on 01 Mar 2006 by mariachi v0.52