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

B module with -MO=Xref reports Can't locate object method "xref" via package... #1939

Closed
p5pRT opened this issue May 5, 2000 · 7 comments
Closed

Comments

@p5pRT
Copy link

p5pRT commented May 5, 2000

Migrated from rt.perl.org#3209 (status was 'resolved')

Searchable as RT3209$

@p5pRT
Copy link
Author

p5pRT commented May 5, 2000

From jmilton@fundsxpress.com

Created by jmilton@fundsxpress.com

I found this problem with the B.pm in perl 5.005_03 and was surprised
to find it in 5.6.0

When I do this "myperl -MO=Xref -e 'print time;", it works fine.

When I do this "myperl -MO=Xref Report.pm", I get​:

Can't locate object method "xref" via package "B​::SPECIAL" at /mesa/devtrees/jmilton-cvs/mainline/me/perl5.6/lib/5.6.0/alpha-dec_osf/B.pm line 191.
CHECK failed--call queue aborted.

That Report.pm is connected to miles of legacy code, but I found the
problem and it must have something to do with one of PERL's weird $
variables. I fixed it like this​:

Inline Patch
--- B.pm.org	Thu May  4 19:26:34 2000
+++ B.pm	Fri May  5 13:19:55 2000
@@ -182,7 +182,7 @@
     $prefix = '' unless defined $prefix;
     while (($sym, $ref) = each %$symref) {
 	*glob = "*main::".$prefix.$sym;
-	if ($sym =~ /::$/) {
+	if ($sym =~ /::\$/) {
 	    $sym = $prefix . $sym;
 	    if ($sym ne "main::" && &$recurse($sym)) {
 		walksymtable(\%glob, $method, $recurse, $sym);
Perl Info

Flags:
    category=library
    severity=medium

Site configuration information for perl v5.6.0:

Configured by jmilton at Thu May  4 18:05:43 CDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=dec_osf, osvers=4.0, archname=alpha-dec_osf
    uname='osf1 aus-mongoose-a05 v4.0 1229 alpha '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=define use64bitall=define uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O4', gccversion=
    cppflags='-std -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C'
    ccflags ='-std -fprm d -ieee -D_INTRINSICS -I/usr/local/include -DLANGUAGE_C'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=8, ptrsize=8, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /var/shlib
    libs=-ldbm -ldb -lm -liconv
    libc=/usr/shlib/libc.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -Wl,-rpath,/mesa/devtrees/jmilton-cvs/mainline/me/perl5.6/lib/5.6.0/alpha-dec_osf/CORE'
    cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O4 -msym -std -s -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.6.0:
    /mesa/devtrees/jmilton-cvs/mainline/me/perl5.6/lib/5.6.0/alpha-dec_osf
    /mesa/devtrees/jmilton-cvs/mainline/me/perl5.6/lib/5.6.0
    /mesa/devtrees/jmilton-cvs/mainline/me/perl5.6/lib/site_perl/5.6.0/alpha-dec_osf
    /mesa/devtrees/jmilton-cvs/mainline/me/perl5.6/lib/site_perl/5.6.0
    /mesa/devtrees/jmilton-cvs/mainline/me/perl5.6/lib/site_perl
    .


Environment for perl v5.6.0:
    HOME=/home/jmilton
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/home/jmilton/base-alpha/lib:/prod/oracle/app/oracle/product/7.3.3/lib
    LOGDIR (unset)
    PATH=/home/jmilton/base/bin:/usr/local/bin:/mesa/bin:/usr/krb5/bin:/usr/bin:.:/usr/bin/X11:/bin:/mesa/oracle/current/bin:/home/jmilton/base-alpha/bin:/usr/local/samba/bin:/mesa/devtrees/jmilton-cvs/mainline/bin:/sbin:/usr/sbin:/etc
    PERL_BADLANG (unset)
    SHELL=/bin/bash


@p5pRT
Copy link
Author

p5pRT commented May 6, 2000

From @gsar

On Fri, 05 May 2000 13​:35​:16 CDT, John Milton wrote​:

I found this problem with the B.pm in perl 5.005_03 and was surprised
to find it in 5.6.0

When I do this "myperl -MO=Xref -e 'print time;", it works fine.

When I do this "myperl -MO=Xref Report.pm", I get​:

Can't locate object method "xref" via package "B​::SPECIAL" at /mesa/devtrees/jmilton-cvs
/mainline/me/perl5.6/lib/5.6.0/alpha-dec_osf/B.pm line 191.
CHECK failed--call queue aborted.

That Report.pm is connected to miles of legacy code, but I found the
problem and it must have something to do with one of PERL's weird $
variables. I fixed it like this​:

--- B.pm.org Thu May 4 19​:26​:34 2000
+++ B.pm Fri May 5 13​:19​:55 2000
@​@​ -182,7 +182,7 @​@​
$prefix = '' unless defined $prefix;
while (($sym, $ref) = each %$symref) {
*glob = "*main​::".$prefix.$sym;
- if ($sym =~ /​::$/) {
+ if ($sym =~ /​::\$/) {
$sym = $prefix . $sym;
if ($sym ne "main​::" && &$recurse($sym)) {
walksymtable(\%glob, $method, $recurse, $sym);

Thanks, but that doesn't appear to be the right fix. I'd say a
B​::SPECIAL​::xref() is needed instead.

Sarathy
gsar@​ActiveState.com

@p5pRT
Copy link
Author

p5pRT commented May 6, 2000

From [Unknown Contact. See original ticket]

Gurusamy Sarathy (lists.p5p)​:

When I do this "myperl -MO=Xref Report.pm", I get​:
Can't locate object method "xref" via package "B​::SPECIAL" at /mesa/devtrees/jmilton-cvs
/mainline/me/perl5.6/lib/5.6.0/alpha-dec_osf/B.pm line 191.
CHECK failed--call queue aborted.

Firstly, I can't reproduce this at all. I went throught the whole Perl
module library and ran Xref on each one of them - no problems. Even
weird stuff like CGI, POSIX, CPAN and B itself.

I'll contact the original poster and try and see if I can reproduce
with his code.

    walksymtable\(\\%glob\, $method\, $recurse\, $sym\);

Thanks, but that doesn't appear to be the right fix. I'd say a
B​::SPECIAL​::xref() is needed instead.

But anyway, B​::Xref doesn't want to look at special pads​:

sub load_pad {
  my $padlist = shift;
  my ($namelistav, $vallistav, @​namelist, $ix);
  @​pad = ();
  return if class($padlist) eq "SPECIAL";
  ...

Normally it avoids putting SPECIAL pads in its list of things to look
at. If B​::SPECIAL​::Xref is needed, I have a feeling that it shouldn't do
anything. More likely, though, Something Weird Is Happening - I can't
work out what could have caused this.

@p5pRT
Copy link
Author

p5pRT commented May 6, 2000

From [Unknown Contact. See original ticket]

Simon Cozens (lists.p5p)​:

Firstly, I can't reproduce this at all.

Not even on a substantial chunk of CPAN. Weird, weird, weird. However,
I did manage to throw up some "undefined" warnings. File​::DosGlob seems
to be an exception. Try this for a bit of comedy​:

#!perl
package File​::DosGlob;
sub doglob {
  my ($one, $two);
  ($one, $two)=();
}

Somehow, Xref is getting hold of a lexical with no name and type.
Change any line in the above and the problem goes away. Even the
name of the package. What?!

It's *very* name dependent - this will give a warning​:

perl -MO=Xref /usr/lib/perl5/site_perl/5.005/HTTP/Status.pm

This won't​:

cp /usr/lib/perl5/site_perl/5.005/HTTP/Status.pm Bar/Foo.pm
perl -MO=Xref Bar/Foo.pm

Can you say "huh?"?

@p5pRT
Copy link
Author

p5pRT commented Sep 28, 2004

From @smpeters

This bug could not be reproduced and the author of the ticket was unable
to supply code for this bug. Also, the line where the error occurs does
not seem to be valid anymore. In Perl 5.8.5, line 191 has a "}" only.
This ticket should be closed as stalled.

@p5pRT
Copy link
Author

p5pRT commented Sep 28, 2004

@smpeters - Status changed from 'open' to 'stalled'

@p5pRT
Copy link
Author

p5pRT commented Aug 2, 2008

p5p@spam.wizbit.be - Status changed from 'stalled' to 'resolved'

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

1 participant