----- Original Message -----
From: "Gaul, Ken" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 16, 2002 4:02 AM
Subject: RE: core dumps after exactly 2479 query on the same table


> Things to check though not neccessarily in this order...
>
> 1. Check out DBI trace output to see if there is anything interesting
there.

End of trace output :
Got 14 rows for UPC 07777865122
Got UPC as 07777869842
    -> execute for DBD::DB2::st (DBI::st=HASH(0x2015407c)~0x20152ae0
'07777869842') thr0
bind :p1 <== '07777869842' (attribs: <no attribs>)
  bind :p1: db2_param_type=1, db2_c_type=1, db2_type=12, PRECISION=0,
SCALE=0, Maxlen=0, Described
    <- execute= -1 at check_raw_clips.pl line 37
    -> fetchrow_array for DBD::DB2::st (DBI::st=HASH(0x2015407c)~0x20152ae0)
thr0
        0: rc=0 '11'
    <- fetchrow_array= ( '11' ) [1 items] row1 at check_raw_clips.pl line 39
Printing row now ...
    -> fetchrow_array for DBD::DB2::st (DBI::st=HASH(0x2015407c)~0x20152ae0)
thr0
    <- fetchrow_array= ( ) [0 items] row1 at check_raw_clips.pl line 39
@row exists: 11 : Out of while loop

Got 11 rows for UPC 07777869842
Got UPC as 07777878452
    -> execute for DBD::DB2::st (DBI::st=HASH(0x2015407c)~0x20152ae0
'07777878452') thr0
bind :p1 <== '07777878452' (attribs: <no attribs>)
  bind :p1: db2_param_type=1, db2_c_type=1, db2_type=12, PRECISION=0,
SCALE=0, Maxlen=0, Described
    <- execute= -1 at check_raw_clips.pl line 37
    -> fetchrow_array for DBD::DB2::st (DBI::st=HASH(0x2015407c)~0x20152ae0)
thr0
        0: rc=0 '0'
    <- fetchrow_array= ( '0' ) [1 items] row1 at check_raw_clips.pl line 39
Printing row now ...
    -> fetchrow_array for DBD::DB2::st (DBI::st=HASH(0x2015407c)~0x20152ae0)
thr0
    <- fetchrow_array= ( ) [0 items] row1 at check_raw_clips.pl line 39
@row exists: 0 : Out of while loop

Got 0 rows for UPC 07777878452
Got UPC as 07777879502
    -> execute for DBD::DB2::st (DBI::st=HASH(0x2015407c)~0x20152ae0
'07777879502') thr0
bind :p1 <== '07777879502' (attribs: <no attribs>)
  bind :p1: db2_param_type=1, db2_c_type=1, db2_type=12, PRECISION=0,
SCALE=0, Maxlen=0, Described
    <- execute= -1 at check_raw_clips.pl line 37
    -> fetchrow_array for DBD::DB2::st (DBI::st=HASH(0x2015407c)~0x20152ae0)
thr0
        0: rc=0 '0'
    <- fetchrow_array= ( '0' ) [1 items] row1 at check_raw_clips.pl line 39
Printing row now ...
    -> fetchrow_array for DBD::DB2::st (DBI::st=HASH(0x2015407c)~0x20152ae0)
thr0
Segmentation fault(coredump)


Looks like the call to fetchrow_array fails when
"while ( @row = $exist_prod_raw_clipaudio->fetchrow_array )" hits the end of
array ....

But it worked 2478 times and fails during the 2479th run.....


> 2. Is it data related? What if you delete the first 3000 lines and try the
> remaining 6968 does it still fail after 2479?

Well I deleted the first 2479 lines and ran again. It again failed on 2479th
line of the input file.


> 3. Is there some bizzare DB thing going on? What if after every 500
queries
> you disconnect/reconnect and re-prepare the statement?

Haven't tried that. I donot want to do it that way .. but i shall try that
tomorrow.


>
> Other than that I can't see anything inherently wrong with the code.
>
> HTH
>
> Ken.
>
> -----Original Message-----
> From: Sumitro Chowdhury [mailto:[EMAIL PROTECTED]]
> Sent: 16 July 2002 01:27
> To: [EMAIL PROTECTED]
> Subject: core dumps after exactly 2479 query on the same table
>
>
> Hi,
> Please direct me to the correct list if the problem is too elementary ...
>
> I read data from a 9968 lines text file, one line at a time and use the
data
> to query a DB2 table (select count(*) from table_name where
> column_name=data ).
>
> The perl script core dumps after exactly 2479 queries every time
> (segmentation fault).
> The data is good and using Korn Shell script, I can query all the 9968
lines
> OK.
>
> The perl script loop is like this:
> .......
> my $exist_prod_raw_clipaudio = $dbh->prepare_cached('SELECT count(*) as
> count  from product.prod_raw_clipaudio where pm_upc = ?')
> ........
> open (UPCFILE,$filename) || die "Could not open $filename.";
> open (SRCFILE,">$scriptname") || die "Could not open $scriptname.";
>
> # Set auto flush for SRCFILE
> my $oldfh = select (SRCFILE);
> $| = 1;
> select ($oldfh);
>
> my $UPC;
> my $rows;
> my @row;
> while (<UPCFILE>) {
>     $UPC=$_;
>     print "Got UPC as $UPC";
>     chop $UPC;
>     $exist_prod_raw_clipaudio->execute($UPC) || die "Couldn't execute
> statement : " . $exist_prod_raw_clipaudio->errstr;
>     $rows=0;
>     while ( @row = $exist_prod_raw_clipaudio->fetchrow_array ) {
>         print "Printing row now ...\n";
>         print "\@row exists: " if (@row);
>         print "@row : ";
> #       print ".";
>         $rows = $row[0];
>     }
>     print "\nGot $rows rows for UPC $UPC \n";
>     print SRCFILE "rm $UPC*\n" if ($rows > 0 );
> #   $exist_prod_raw_clipaudio->finish;
> #   $update_clip_location_detail->finish;
> }
> $dbh->disconnect;
>
> -------- End of script -----
> The Output is like this :
> .........
> Got UPC as 07464375452
> Printing row now ...
> @row exists: 14 :
> Got 14 rows for UPC 07464375452
> Got UPC as 07464375512
> Printing row now ...
> @row exists: 0 :
> Got 0 rows for UPC 07464375512
> Got UPC as 07464375932
> Printing row now ...
> Segmentation fault(coredump)
>
>
> How should I diagonise this problem ?
>
>
> Sumitro Chowdhury
>

Reply via email to