Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong line number for FILEHANDLE reported by Xref (Xref.pm V1.01) #7947

Open
p5pRT opened this issue Jun 2, 2005 · 4 comments
Open

Wrong line number for FILEHANDLE reported by Xref (Xref.pm V1.01) #7947

p5pRT opened this issue Jun 2, 2005 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 2, 2005

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

Searchable as RT36094$

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2005

From root@millenium.ro

This is a bug report for perl from g.badoi@​millenium.ro,
generated with the help of perlbug 1.34 running under perl v5.8.2.


Xref.pm (v 1.01) detects wrong line number for filehandles is some circumstances,
as below​:

__________________________________________

#!/usr/bin/perl -w

my $a = 1;

if ($a) {
  print STDOUT "This line is misreported\n";
}
__________________________________________

"perl -MO=Xref bug.pl >buf.xref" generates​:

__________________________________________

File t.pl
  Subroutine (definitions)
  Package Internals
  &HvREHASH s0
  &SvREADONLY s0
  &SvREFCNT s0
  &hash_seed s0
  &hv_clear_placeholders s0
  &rehash_seed s0
  Package PerlIO
  &get_layers s0
  Package Regexp
  &DESTROY s0
  Package UNIVERSAL
  &VERSION s0
  &can s0
  &isa s0
  Subroutine (main)
  Package (lexical)
  $a i3, 5
  Package main
  *STDOUT 5
___________________________________________

reporting STDOUT as used at line 5 instead of line 6.



Flags​:
  category=core
  severity=high


Site configuration information for perl v5.8.2​:

Configured by root at Mon Mar 29 10​:07​:54 MST 2004.

Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration​:
  Platform​:
  osname=openbsd, osvers=3.5, archname=i386-openbsd
  uname='openbsd'
  config_args='-dsE -Dopenbsd_distribution=defined'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
  useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=undef use64bitall=undef uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
  optimize='-O2',
  cppflags='-fno-strict-aliasing -I/usr/local/include'
  ccversion='', gccversion='2.95.3 20010125 (prerelease, propolice)', gccosandvers='openbsd3.5'
  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, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags ='-Wl,-E '
  libpth=/usr/lib
  libs=-lm -lutil -lc
  perllibs=-lm -lutil -lc
  libc=/usr/lib/libc.a, so=so, useshrplib=true, libperl=libperl.so.8.1
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-R/usr/libdata/perl5/i386-openbsd/5.8.2/CORE'
  cccdlflags='-DPIC -fPIC ', lddlflags='-shared -fPIC '

Locally applied patches​:
 


@​INC for perl v5.8.2​:
  /usr/libdata/perl5/i386-openbsd/5.8.2
  /usr/local/libdata/perl5/i386-openbsd/5.8.2
  /usr/libdata/perl5
  /usr/local/libdata/perl5
  /usr/local/libdata/perl5/site_perl/i386-openbsd
  /usr/libdata/perl5/site_perl/i386-openbsd
  /usr/local/libdata/perl5/site_perl
  /usr/libdata/perl5/site_perl
  /usr/local/lib/perl5/site_perl
  .


Environment for perl v5.8.2​:
  HOME=/root
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/sbin​:/usr/sbin​:/bin​:/usr/bin​:/usr/local/bin​:/usr/local/sbin​:/root/bin​:/usr/libexec​:/usr/local/libexec​:/usr/X11R6/bin
  PERL_BADLANG (unset)
  SHELL=/bin/csh

@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2011

From @jkeenan

On Thu Jun 02 09​:44​:48 2005, root@​millenium.ro wrote​:

This is a bug report for perl from g.badoi@​millenium.ro,
generated with the help of perlbug 1.34 running under perl v5.8.2.

-----------------------------------------------------------------
Xref.pm (v 1.01) detects wrong line number for filehandles is some
circumstances,
as below​:

__________________________________________

#!/usr/bin/perl -w

my $a = 1;

if ($a) {
print STDOUT "This line is misreported\n";
}
__________________________________________

"perl -MO=Xref bug.pl >buf.xref" generates​:

__________________________________________

File t.pl
...
Subroutine (main)
Package (lexical)
$a i3, 5
Package main
*STDOUT 5
___________________________________________

reporting STDOUT as used at line 5 instead of line 6.

I'm not sure this should be considered to be a bug. My (limited)
understanding of the B​::* is that they're not necessarily expected to
account for all possible variations of whitespace. Absent whitespace,

  if ($alpha) {
  print STDOUT "This line is misreported\n";
  }

... is equivalent to​:

  if ($alpha) { print STDOUT "This line is misreported\n"; }

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2011

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

@p5pRT
Copy link
Author

p5pRT commented Jul 8, 2016

From @cpansprout

On Sat Nov 12 06​:54​:33 2011, jkeenan wrote​:

On Thu Jun 02 09​:44​:48 2005, root@​millenium.ro wrote​:

This is a bug report for perl from g.badoi@​millenium.ro,
generated with the help of perlbug 1.34 running under perl v5.8.2.

-----------------------------------------------------------------
Xref.pm (v 1.01) detects wrong line number for filehandles is some
circumstances,
as below​:

__________________________________________

#!/usr/bin/perl -w

my $a = 1;

if ($a) {
print STDOUT "This line is misreported\n";
}
__________________________________________

"perl -MO=Xref bug.pl >buf.xref" generates​:

__________________________________________

File t.pl
...
Subroutine (main)
Package (lexical)
$a i3, 5
Package main
*STDOUT 5
___________________________________________

reporting STDOUT as used at line 5 instead of line 6.

I'm not sure this should be considered to be a bug. My (limited)
understanding of the B​::* is that they're not necessarily expected to
account for all possible variations of whitespace. Absent whitespace,

if ($alpha) {
print STDOUT "This line is misreported\n";
}

... is equivalent to​:

if ($alpha) { print STDOUT "This line is misreported\n"; }

What’s actually happening is that B​::Xref is ignoring nulled cops, which is not terribly surprising, as B did not provide the cop fields for those until I added the feature, in 5.22 iirc.

So yes, this is fixable.

--

Father Chrysostomos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants