Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.98k stars 560 forks source link

unexpected die #15127

Open p5pRT opened 8 years ago

p5pRT commented 8 years ago

Migrated from rt.perl.org#127249 (status was 'open')

Searchable as RT127249$

p5pRT commented 8 years ago

From @KES777

Created by @KES777

For next code

sub file {   my $filename = shift // $DB​::file;

  return ${ "​::_\<$filename" }; }

sub DB {   ( $DB​::package\, $DB​::file\, $DB​::line ) = caller(1);

  die ">$DB​::file\< ne >" .file( $DB​::file ) ."\<"   if $DB​::file ne file( $DB​::file ); }

I get the error​: # main​::__ANON__[(eval 371)​:1]('>/home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\< ne >/home/fe # elsafe/public_html/lib/Log/Log4perl/Appender.pm\< at /home/feelsafe/tmp/perl_libs/lib/Devel/DebugHook # s.pmTue Jan 12 15​:10​:29 2016 - [uwsgi-perl error] >/home/feelsafe/public_html/lib/Log/Log4perl/Appen # der.pm\< ne >/home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\< at /home/feelsafe/tmp/perl_libs # /lib/Devel/DebugHooks.pm line 658\, \ line 46. #

Lines visually are equal​:

/home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\< /home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\<

because values exists by that key in ${ "​::_\<filename" } I do not expect this assert

Perl Info ``` Flags: category=core severity=medium Site configuration information for perl 5.22.0: Configured by kes at Tue Sep 29 16:12:55 EEST 2015. Summary of my perl5 (revision 5 version 22 subversion 0) configuration: Platform: osname=linux, osvers=3.13.0-37-generic, archname=x86_64-linux uname='linux keswork 3.13.0-37-generic #64-ubuntu smp mon sep 22 21:28:38 utc 2014 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Dprefix=/home/kes/perl' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.8.4', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.19' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' @INC for perl 5.22.0: /home/kes/work/projects/perl_libs/lib /home/kes/perl5/lib/perl5/x86_64-linux /home/kes/perl5/lib/perl5 /home/kes/perl/lib/site_perl/5.22.0/x86_64-linux /home/kes/perl/lib/site_perl/5.22.0 /home/kes/perl/lib/5.22.0/x86_64-linux /home/kes/perl/lib/5.22.0 . Environment for perl 5.22.0: HOME=/home/kes LANG=ru_UA.UTF-8 LANGUAGE=en LC_MESSAGES=en_US.UTF-8 LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/kes/perl/bin:/home/kes/perl/bin:/home/kes/perl5/bin:/home/kes/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PERL5DB=BEGIN { require "Devel/KillPrint.pm" } PERL5LIB=/home/kes/work/projects/perl_libs/lib:/home/kes/perl5/lib/perl5 PERLDB_OPTS=RemotePort=keswork:9001 PERL_BADLANG (unset) PERL_MB_OPT=--install_base "/home/kes/perl5" PERL_MM_OPT=INSTALL_BASE=/home/kes/perl5 SHELL=/bin/bash ```
p5pRT commented 8 years ago

From @jkeenan

On Tue Jan 12 08​:40​:33 2016\, kes-kes@​yandex.ru wrote​:

From​: kes-kes@​yandex.ru Subject​: unexpected die To​: perlbug@​perl.org Cc​: kes-kes@​yandex.ru Message-Id​: \5\.22\.0\_13274\_1452614980@&#8203;keswork Reply-To​: kes-kes@​yandex.ru

This is a bug report for perl from kes-kes@​yandex.ru\, generated with the help of perlbug 1.40 running under perl 5.22.0.

----------------------------------------------------------------- [Please describe your issue here]

For next code

sub file { my $filename = shift // $DB​::file;

return ${ "​::_\<$filename" }; }

sub DB { ( $DB​::package\, $DB​::file\, $DB​::line ) = caller(1);

die ">$DB​::file\< ne >" .file( $DB​::file ) ."\<" if $DB​::file ne file( $DB​::file ); }

I get the error​: # main​::__ANON__[(eval 371)​:1]('>/home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\< ne

/home/fe # elsafe/public_html/lib/Log/Log4perl/Appender.pm\< at /home/feelsafe/tmp/perl_libs/lib/Devel/DebugHook # s.pmTue Jan 12 15​:10​:29 2016 - [uwsgi-perl error] /home/feelsafe/public_html/lib/Log/Log4perl/Appen # der.pm\< ne >/home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\< at /home/feelsafe/tmp/perl_libs # /lib/Devel/DebugHooks.pm line 658\, \ line 46. #

Lines visually are equal​:

/home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\< /home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\<

because values exists by that key in ${ "​::_\<filename" } I do not expect this assert

Could you clarify how you are calling this code and getting an unexpected error?

Thank you very much.

-- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 8 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 8 years ago

From @KES777

Здравствуйте\, James.

Вы писали 12 января 2016 г.\, 21​:29​:50​:

JEKvR> On Tue Jan 12 08​:40​:33 2016\, kes-kes@​yandex.ru wrote​:

From​: kes-kes@​yandex.ru Subject​: unexpected die To​: perlbug@​perl.org Cc​: kes-kes@​yandex.ru Message-Id​: \5\.22\.0\_13274\_1452614980@&#8203;keswork Reply-To​: kes-kes@​yandex.ru

This is a bug report for perl from kes-kes@​yandex.ru\, generated with the help of perlbug 1.40 running under perl 5.22.0.

----------------------------------------------------------------- [Please describe your issue here]

For next code

sub file { my $filename = shift // $DB​::file;

return ${ "​::_\<$filename" }; }

sub DB { ( $DB​::package\, $DB​::file\, $DB​::line ) = caller(1);

die ">$DB​::file\< ne >" .file( $DB​::file ) ."\<" if $DB​::file ne file( $DB​::file ); }

I get the error​: # main​::__ANON__[(eval 371)​:1]('>/home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\< ne

/home/fe # elsafe/public_html/lib/Log/Log4perl/Appender.pm\< at /home/feelsafe/tmp/perl_libs/lib/Devel/DebugHook # s.pmTue Jan 12 15​:10​:29 2016 - [uwsgi-perl error] /home/feelsafe/public_html/lib/Log/Log4perl/Appen # der.pm\< ne >/home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\< at /home/feelsafe/tmp/perl_libs # /lib/Devel/DebugHooks.pm line 658\, \ line 46. #

Lines visually are equal​:

/home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\< /home/feelsafe/public_html/lib/Log/Log4perl/Appender.pm\<

because values exists by that key in ${ "​::_\<filename" } I do not expect this assert

JEKvR> Could you clarify how you are calling this code and getting an unexpected error?

JEKvR> Thank you very much.

$ cat Devel/DB.pm package DB; sub file {   my $filename = shift // $DB​::file;

return ${ "​::_\<$filename" }; }

sub DB {   ( $DB​::package\, $DB​::file\, $DB​::line ) = caller(1);

die ">$DB​::file\< ne >" .file( $DB​::file ) ."\<"   if $DB​::file ne file( $DB​::file ); } 1;

perl -d​:DB script.pl

or for web application set this env PERL5OPT='d​:DB' if this uwsgi you may add to the end of site.ini next​: env = PERL5OPT='d​:DB'

The application I have try was a HTML​::Mason\, this is a complex app\, about 500modules are loaded...

-- С уважением\, Eugen mailto​:kes-kes@​yandex.ru