Главная страница


ru.perl

 
 - RU.PERL ----------------------------------------------------------------------
 From : Michael Smirnov                      2:5020/400     07 May 2001  12:38:53
 To : All
 Subject : Attempt to free non-existent shared string
 -------------------------------------------------------------------------------- 
 
 Имеется скрипт, работающий с СУБД Firebird через модуль IBPerl 0.8p3.
 Скрипт успешно добавляет запись в таблицу, но всегда вылезает это:
 Attempt to free non-existent shared string, <STDIN> chunk 5.
 Хоть бы сказал, в какой строке!
 Однако, если закомментировать строчки
 if ($st->execute("$info[0]",$startdatestr,$stopdatestr) != 0)
   {die "Line ".__LINE__." Statement Error:\n$st->{'Error'}\n"}
 то сообщение не появляется!
 Самый прикол, глюк вылезает явно после конца работы скрипта
 (строки, которая выводит "ok!"):
 -------------------------
 ok!
 Attempt to free non-existent shared string, <STDIN> chunk 5.
 -------------------------
 Что перлу не нравится-то?
 FreeBSD 4.2, Perl 5.005_03.
 
 #!/usr/bin/perl -w
 
 use IBPerl;
 use strict;
 
 my $DBPATH='serv:/usr/interbase/database/10.gdb';
 
 my $db = new IBPerl::Connection( Path => "$DBPATH",
     User => 'sysdba', Password => 'masterkey' );
 if ($db->{Handle} < 0) {die "Line ".__LINE__." $0: Connection error:
 
 $db->{Error}\n"}
 
 my($tr,$st,@info,$str,@tmp,$startdate,$startdatestr,$stopdatestr);
 
 @info=<STDIN>;
 foreach (@info)
 {
   chomp;
   @tmp=split('=');
   if ( $tmp[0] eq 'start_time' )
   {
     $startdate=$tmp[1]; $startdatestr=DateToIBFormat($startdate)
   }
   elsif ( $tmp[0] eq 'elapsed_time' )
   {$stopdatestr=DateToIBFormat($tmp[1]+$startdate)};
 }
 print "debug|$info[0],$startdatestr,$stopdatestr|\n";
 ############Begin Transaction###########
 
 $tr = new IBPerl::Transaction( Database => $db );
 if ($tr->{Handle} < 0) {die "Line ".__LINE__." $0: Transaction error:
 
 $tr->{Error}\n"}
 
 $st = new IBPerl::Statement( Transaction => $tr,
     SQL => "insert into r (users,starttime,stoptime) values (?,?,?)");
 if ($st->{'Handle'} < 0) {die "Line ".__LINE__." Statement
 Error:\n$st->{'Error'}\n"}
 
 if ($st->execute("$info[0]",$startdatestr,$stopdatestr) != 0)
   {die "Line ".__LINE__." Statement Error:\n$st->{'Error'}\n"}
 if ($tr->commit() < 0) {die "Line ".__LINE__." Commit
 Error:\n$tr->{'Error'}\n"}
 
 ############End Transaction###########
 if ($db->disconnect() < 0) {die "Line ".__LINE__." Disconnect
 Error:\n$tr->{'Error'}\n"}
 
 print "ok!\n";
 exit 0;
 
 sub DateToIBFormat
 {
   (my $datenumber)=@_;
   my $datestr=sprintf("%02d-%s-%04d %02d:%02d",
 
 ub{( $_[3],substr(scalar(localtime($datenumber)),4,3),$_[5]+1900,$_[2],$_[1]
 )}
 
   ->(localtime($datenumber)));
 
   return $datestr;
 }
 --- ifmail v.2.15dev5
  * Origin: Demos online service (2:5020/400)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 Attempt to free non-existent shared string   Michael Smirnov   07 May 2001 12:38:53 
 Re: Attempt to free non-existent shared string   Artem Chuprina   07 May 2001 15:16:14 
 Re: Attempt to free non-existent shared string   Michael Smirnov   07 May 2001 18:26:50 
Архивное /ru.perl/27252ec69d35a.html, оценка 3 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional