heap corruption in DBD::Oracle
- From: hjp@xxxxxxxxx (Peter J. Holzer)
- Date: Sun, 16 Dec 2007 23:07:36 +0100
I have a perl script which updates some (large) tables from text-files,
inserting, updating and deleting records. For performance reasons the
inserts, updates and deletes are queued together and then done with an
array operation when there are "enough". Now I've added another table
and the script dies with:
*** glibc detected *** double free or corruption (fasttop): 0x0000000001450ad0 ***
in ora_execute_array (called from line 854 in Oracle.pm)
The relevant part of the script looks like this:
sub insert {
my ($self, $inserts) = @_;
my $dal = $self->{_dal};
my $sth_insert_data = $dal->{_dbh}->prepare_cached("insert into data(id, real) values(?, ?)");
my $sth_insert_datacoord =
$dal->{_dbh}->prepare_cached(
"insert into datacoords(period_start, period_end, data_id, set_id)
values(?, ?, ?, ? )"
);
my $sth_insert_fact_comext =
$dal->{_dbh}->prepare_cached(
"insert into fact_comext(period_start, reporter, partner, product, data_id, real)
values(?, ?, ?, ?, ? ? )"
);
my @values = map { $_->{real} } @$inserts;
my $data_ids = $self->seq_numbers(scalar(@$inserts));
$sth_insert_data->execute_array({}, $data_ids, \@values); # <-- WORKS
unless ($time_period_id) {
my @tp = $dal->datasets({ path => [ 'time_period']});
die "time_period not found" if @tp < 1;
die "time_period not unique" if @tp > 1;
$time_period_id = $tp[0]->id;
}
my @ps = map { $_->{period}[0] } @$inserts;
my @pe = map { $_->{period}[1] } @$inserts;
$sth_insert_datacoord->execute_array({}, \@ps, \@pe, $data_ids, $time_period_id); # <-- WORKS
my @prod_ds = map { $_->{ds}->id } @$inserts;
$sth_insert_datacoord->execute_array({}, undef, undef, $data_ids, \@prod_ds); # <-- WORKS
my @rep_ds = map { $_->{reporter}->id } @$inserts;
$sth_insert_datacoord->execute_array({}, undef, undef, $data_ids, \@rep_ds); # <-- WORKS
my @part_ds = map { $_->{partner}->id } @$inserts;
$sth_insert_datacoord->execute_array({}, undef, undef, $data_ids, \@part_ds); # <-- WORKS
{
my @ps1 = @ps;
my @rep_ds1 = @rep_ds;
my @part_ds1 = @part_ds;
my @prod_ds1 = @prod_ds;
my @values1 = @values;
$sth_insert_fact_comext->execute_array({}, \@ps1, \@rep_ds1, \@part_ds1, \@prod_ds1, $data_ids, \@values1); # <--- CRASH
}
$dal->{_dbh}->commit();
$inserted += @$inserts;
}
There are six calls to execute_array in the routine. The first five
(marked "WORKS") work fine, the sixth crashes. The copying of the arrays
before the sixth execute_array was a feeble (and unsuccessful) attempt
at a workaround.
Has anybody run into this problem before or do I need to dig deeper?
Version information:
DBD::Oracle 1.19
DBI 1.58
perl v5.8.8 built for x86_64-linux-thread-multi
Red Hat Enterprise Linux AS release 4 (Nahant Update 5)
Oracle 10.2.0.1.0
hp
--
_ | Peter J. Holzer | If I wanted to be "academically correct",
|_|_) | Sysadmin WSR | I'd be programming in Java.
| | | hjp@xxxxxxxxx | I don't, and I'm not.
__/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users
Attachment:
pgpiqeuqjORre.pgp
Description: PGP signature
- Follow-Ups:
- Re: heap corruption in DBD::Oracle
- From: Peter J. Holzer
- Re: heap corruption in DBD::Oracle
- Prev by Date: Re: ORA-12154: TNS:could not resolve the connect identifier specified
- Next by Date: Re: heap corruption in DBD::Oracle
- Previous by thread: DBI interface for Amazon SimpleDB?
- Next by thread: Re: heap corruption in DBD::Oracle
- Index(es):
Relevant Pages
|