Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

[perl #20858] Random error msgs in shutdown?

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


perlbug-followup at perl

Feb 11, 2003, 4:27 PM

Post #1 of 4 (133 views)
Permalink
[perl #20858] Random error msgs in shutdown?

# New Ticket Created by Brad Bowman
# Please include the string: [perl #20858]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=20858 >


This is a bug report for perl from bsb [at] strategicdata,
generated with the help of perlbug 1.33 running under perl v5.6.1.


-----------------------------------------------------------------

Hi,
I've been trying to track this down but I'm way out of my depth and
it's not too important to me that it's fixed, so over to you...

Sample symptoms, this printed on stderr:
*Regexp::DESTROY.
Out of memory!
Out of memory!
END failed--call queue aborted at a line 36.

I've pared down my the original problem but it still uses DBI(1.21)
and Carp. I haven't delved into them for more information (sorry).

Some of the code versions from my error hunting are in
http://bowman.bs/perl/bug1.txt for anyone way too interested.

During the hunt I got "*Regexp::DESTROY.", "Out of memory!",
"*main::Regexp::." "Can't return outside a subroutine" (in a sub...),
and "Modification of a read-only value attempted" errors, seemingly
randomly.

Adding a print at various points, or even changing the printed strings
would change the behaviour and error.

Adding an exit would cover the error messages.

Errors always seemed the same on repeated runs of the same code.

At one stage I got a different result depending whether I ran
the script as 'perl a' or './a':

[14:20 sb]$ head -n 1 a
#!/usr/bin/perl -w

[14:20 sb]$ perl a
in HandleError
lalala
this print needs to be here
*Regexp::DESTROY.
Out of memory!
Out of memory!
END failed--call queue aborted at a line 36.

[14:20 sb]$ ./a
in HandleError
lalala
this print needs to be here
*Regexp::DESTROY.

Here's the code I stopped with, output after the __END__:

#!/usr/bin/perl -w
use strict;
use DBI;
use Carp;

sub create {
my ($object) = @_;
my $dbh = DBI->connect(
"DBI:mysql:test:localhost",'test','',
{ HandleError => sub { warn "in HandleError\n"; confess(shift) }, }
) or warn "Can't connect to database: $DBI::errstr" and exit;

$dbh->do('drop table if exists slot');
$dbh->do('create table
slot (name varchar(10), object text, unique (name))');
$dbh->do("insert into slot (name,object) values (?,?)",undef,
'test','');
$dbh->do("insert into slot (name,object) values (?,?)",undef,
'test',$object);
# realize that sticking a stringified object into a text field
# isn't that useful, but original test was using Storable::freeze
return 1;
}


{
eval { create({1,1}); };
qr/dup/i; # no longer used...
#print $@;
print "lalala\n"; # changing the strings contents effects errors!
}
print "this print needs to be here\n";

__END__

[14:48 sb]$ perl a
in HandleError
lalala
this print needs to be here
*Regexp::DESTROY.
Out of memory!
Out of memory!
END failed--call queue aborted at a line 22.

Thanks,

Brad

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=low
---
Site configuration information for perl v5.6.1:

Configured by bod at Fri Jan 11 04:14:18 EST 2002.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
Platform:
osname=linux, osvers=2.4.13, archname=i386-linux
uname='linux duende 2.4.13 #1 wed oct 31 19:18:07 est 2001 i686 unknown '
config_args='-Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.6.1 -Darchlib=/usr/lib/perl/5.6.1 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.6.1 -Dsitearch=/usr/local/lib/perl/5.6.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Duseshrplib -Dlibperl=libperl.so.5.6.1 -Dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
Compiler:
cc='cc', ccflags ='-DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-DDEBIAN -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.4 (Debian prerelease)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -ldb -ldl -lm -lc -lcrypt
perllibs=-ldl -lm -lc -lcrypt
libc=/lib/libc-2.2.4.so, so=so, useshrplib=true, libperl=libperl.so.5.6.1
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:


---
@INC for perl v5.6.1:
/home/bsb/japh
/usr/local/lib/perl/5.6.1
/usr/local/share/perl/5.6.1
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.6.1
/usr/share/perl/5.6.1
/usr/local/lib/site_perl
.

---
Environment for perl v5.6.1:
HOME=/home/bsb
LANG=en_AU
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:~/bin:~/Komodo-2.0
PERL5LIB=/home/bsb/japh
PERL_BADLANG (unset)
SHELL=/bin/bash


slaven at rezic

Feb 14, 2003, 3:04 PM

Post #2 of 4 (131 views)
Permalink
Re: [perl #20858] Random error msgs in shutdown? [In reply to]

Brad Bowman (via RT) <perlbug-followup [at] perl> writes:

> # New Ticket Created by Brad Bowman
> # Please include the string: [perl #20858]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=20858 >
>
>
> This is a bug report for perl from bsb [at] strategicdata,
> generated with the help of perlbug 1.33 running under perl v5.6.1.
>
>
> -----------------------------------------------------------------
>
> Hi,
> I've been trying to track this down but I'm way out of my depth and
> it's not too important to me that it's fixed, so over to you...
>
> Sample symptoms, this printed on stderr:
> *Regexp::DESTROY.
> Out of memory!
> Out of memory!
> END failed--call queue aborted at a line 36.
>
> I've pared down my the original problem but it still uses DBI(1.21)
> and Carp. I haven't delved into them for more information (sorry).
>
> Some of the code versions from my error hunting are in
> http://bowman.bs/perl/bug1.txt for anyone way too interested.
>
> During the hunt I got "*Regexp::DESTROY.", "Out of memory!",
> "*main::Regexp::." "Can't return outside a subroutine" (in a sub...),
> and "Modification of a read-only value attempted" errors, seemingly
> randomly.
>
> Adding a print at various points, or even changing the printed strings
> would change the behaviour and error.
>
> Adding an exit would cover the error messages.
>
> Errors always seemed the same on repeated runs of the same code.
>
> At one stage I got a different result depending whether I ran
> the script as 'perl a' or './a':
>
> [14:20 sb]$ head -n 1 a
> #!/usr/bin/perl -w
>
> [14:20 sb]$ perl a
> in HandleError
> lalala
> this print needs to be here
> *Regexp::DESTROY.
> Out of memory!
> Out of memory!
> END failed--call queue aborted at a line 36.
>
> [14:20 sb]$ ./a
> in HandleError
> lalala
> this print needs to be here
> *Regexp::DESTROY.
>
> Here's the code I stopped with, output after the __END__:
>
> #!/usr/bin/perl -w
> use strict;
> use DBI;
> use Carp;
>
> sub create {
> my ($object) = @_;
> my $dbh = DBI->connect(
> "DBI:mysql:test:localhost",'test','',
> { HandleError => sub { warn "in HandleError\n"; confess(shift) }, }
> ) or warn "Can't connect to database: $DBI::errstr" and exit;
>
> $dbh->do('drop table if exists slot');
> $dbh->do('create table
> slot (name varchar(10), object text, unique (name))');
> $dbh->do("insert into slot (name,object) values (?,?)",undef,
> 'test','');
> $dbh->do("insert into slot (name,object) values (?,?)",undef,
> 'test',$object);
> # realize that sticking a stringified object into a text field
> # isn't that useful, but original test was using Storable::freeze
> return 1;
> }
>
>
> {
> eval { create({1,1}); };
> qr/dup/i; # no longer used...
> #print $@;
> print "lalala\n"; # changing the strings contents effects errors!
> }
> print "this print needs to be here\n";
>
> __END__
>
> [14:48 sb]$ perl a
> in HandleError
> lalala
> this print needs to be here
> *Regexp::DESTROY.
> Out of memory!
> Out of memory!
> END failed--call queue aborted at a line 22.
>

With 5.6.1 I get the following output:

$ perl5.6.1 x.pl
in HandleError
lalala
this print needs to be here
*Regexp::DESTROY.
Can't return outside a subroutine at x.pl line 22.

With 5.8.0 there is no problem:

$ perl5.8.0 x.pl
in HandleError
lalala
this print needs to be here

Regards,
Slaven

>
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
> category=core
> severity=low
> ---
> Site configuration information for perl v5.6.1:
>
> Configured by bod at Fri Jan 11 04:14:18 EST 2002.
>
> Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
> Platform:
> osname=linux, osvers=2.4.13, archname=i386-linux
> uname='linux duende 2.4.13 #1 wed oct 31 19:18:07 est 2001 i686 unknown '
> config_args='-Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.6.1 -Darchlib=/usr/lib/perl/5.6.1 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.6.1 -Dsitearch=/usr/local/lib/perl/5.6.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Duseshrplib -Dlibperl=libperl.so.5.6.1 -Dd_dosuid -des'
> hint=recommended, useposix=true, d_sigaction=define
> usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
> useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
> use64bitint=undef use64bitall=undef uselongdouble=undef
> Compiler:
> cc='cc', ccflags ='-DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
> optimize='-O2',
> cppflags='-DDEBIAN -fno-strict-aliasing -I/usr/local/include'
> ccversion='', gccversion='2.95.4 (Debian prerelease)', gccosandvers=''
> intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
> d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
> ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
> alignbytes=4, usemymalloc=n, prototype=define
> Linker and Libraries:
> ld='cc', ldflags =' -L/usr/local/lib'
> libpth=/usr/local/lib /lib /usr/lib
> libs=-lgdbm -ldb -ldl -lm -lc -lcrypt
> perllibs=-ldl -lm -lc -lcrypt
> libc=/lib/libc-2.2.4.so, so=so, useshrplib=true, libperl=libperl.so.5.6.1
> Dynamic Linking:
> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
> cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
>
> Locally applied patches:
>
>
> ---
> @INC for perl v5.6.1:
> /home/bsb/japh
> /usr/local/lib/perl/5.6.1
> /usr/local/share/perl/5.6.1
> /usr/lib/perl5
> /usr/share/perl5
> /usr/lib/perl/5.6.1
> /usr/share/perl/5.6.1
> /usr/local/lib/site_perl
> .
>
> ---
> Environment for perl v5.6.1:
> HOME=/home/bsb
> LANG=en_AU
> LANGUAGE (unset)
> LD_LIBRARY_PATH (unset)
> LOGDIR (unset)
> PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:~/bin:~/Komodo-2.0
> PERL5LIB=/home/bsb/japh
> PERL_BADLANG (unset)
> SHELL=/bin/bash
>
>
>
>
>
>
>

--
Slaven Rezic - slaven [at] rezic

tktimex - project time manager
http://sourceforge.net/projects/ptktools/


bsb at strategicdata

Feb 24, 2003, 9:01 PM

Post #3 of 4 (131 views)
Permalink
Re: [perl #20858] Random error msgs in shutdown? [In reply to]

Here's a still simpler test script.

Using HandleError + confess was crashing and looping
under mod_perl. Output follows.

#!/usr/bin/perl -wl
use Carp;
use DBI;
my $dbh = DBI->connect( 'dbi:CSV:', '','',
{HandleError => sub { confess(shift) }},
) or die $DBI::errstr;

eval {
$dbh->do("syntax error");
};
print $@ if $@;

__END__

$ ./carp_bug.pl
DBD::CSV::db do failed: Parse error near syntax error at
/usr/share/perl5/DBD/File.pm line 174.
main::__ANON__('DBD::CSV::db do failed: Parse error near syntax
error at /usr/sh...', 'DBI::db=HASH(0x817ddc8)', undef) called at
./carp_bug.pl line 9
eval {...} called at ./carp_bug.pl line 8

Use of uninitialized value in subroutine entry.
.
Segmentation fault


h.m.brand at xs4all

Apr 30, 2012, 3:07 AM

Post #4 of 4 (130 views)
Permalink
Re: [perl #20858] Random error msgs in shutdown? [In reply to]

On Sun, 29 Apr 2012 03:41:00 -0700, "Brian Fraser via RT"
<perlbug-followup [at] perl> wrote:

> On Tue Feb 25 02:45:49 2003, bsb [at] strategicdata wrote:
> > Here's a still simpler test script.
> >
> > Using HandleError + confess was crashing and looping
> > under mod_perl. Output follows.
> >
> > #!/usr/bin/perl -wl
> > use Carp;
> > use DBI;
> > my $dbh = DBI->connect( 'dbi:CSV:', '','',
> > {HandleError => sub { confess(shift) }},
> > ) or die $DBI::errstr;
> >
> > eval {
> > $dbh->do("syntax error");
> > };
> > print $@ if $@;
> >
> > __END__
> >
> > $ ./carp_bug.pl
> > DBD::CSV::db do failed: Parse error near syntax error at
> > /usr/share/perl5/DBD/File.pm line 174.
> > main::__ANON__('DBD::CSV::db do failed: Parse error near syntax
> > error at /usr/sh...', 'DBI::db=HASH(0x817ddc8)', undef) called at
> > ./carp_bug.pl line 9
> > eval {...} called at ./carp_bug.pl line 8
> >
> > Use of uninitialized value in subroutine entry.
> > .
> > Segmentation fault
>
> I can't reproduce this on 5.14.2, DBI 1.617, DBD::CSV 0.33; And since
> Perl 5.6 is long out of support, I vote to close this.

I'd vote to first move it to the SQL::Statement queue and close it there
A lot of work has been put in all modules involved in this ticket since
which makes it very unlikely to be reproducable with current state of
affairs

--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using perl5.00307 .. 5.14 porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.