develooper Front page | perl.perl5.porters | Postings from January 2016

[perl #127377] caller does not return right info

Thread Previous
January 27, 2016 13:44
[perl #127377] caller does not return right info
Message ID:
# New Ticket Created by  KES 
# Please include the string:  [perl #127377]
# in the subject line of all future correspondence about this issue. 
# <URL: >

Subject: caller does not return right info
Message-Id: <5.22.0_7499_1453758880@kes-desktop>

This is a bug report for perl from,
generated with the help of perlbug 1.40 running under perl 5.22.0.

[Please describe your issue here]

$ cat
#!/usr/bin/env perl

sub t1 {
    print "@{[ (caller(0))[0..3] ]}\n";
    return 7;

unless( my $x = t1() || $x < 8 ) {
elsif( my $y = t1() ) {

main ./ 8 main::t1
main ./ 11 main::t1

$ perl -d

Loading DB routines from version 1.49
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main::( unless( my $x = t1() || $x < 8 ) {
  DB<1> c
main 8 main::t1
main 8 main::t1
Debugged program terminated. Use q to quit or R to restart,
use o inhibit_exit to avoid stopping after program termination,
h q, h R or h o to get additional info.

As you can see the second call to t1 returns wrong line number 8 intead of expected 11
when the program were run with -d flag.

[Please do not change anything below this line]
Site configuration information for perl 5.22.0:

Configured by kes at Sun Nov 1 00:25:11 EET 2015.

Summary of my perl5 (revision 5 version 22 subversion 0) configuration:

    osname=linux, osvers=3.13.0-37-generic, archname=x86_64-linux
    uname='linux kes-desktop 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/localperl'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    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, so=so, useshrplib=false, libperl=libperl.a
  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:

Environment for perl 5.22.0:
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    PERL_MB_OPT=--install_base "/home/kes/localperl_libs"

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About