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

[5.8.1 BUG] corrupted package name in warnings #7013

Closed
p5pRT opened this issue Jan 5, 2004 · 5 comments
Closed

[5.8.1 BUG] corrupted package name in warnings #7013

p5pRT opened this issue Jan 5, 2004 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 5, 2004

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

Searchable as RT24811$

@p5pRT
Copy link
Author

p5pRT commented Jan 5, 2004

From sreeji_k@yahoo.com

To reproduce, on Linux, using perl-5.8.1 or .2​:

% cat A.pm
package A;
foreach my $f (qw(f1 f2 f3 f4 f5 f6 f7 f8 f9))
{
  *$f = "B​::$f";
}
1;

% perl -w -e 'use A;'
Name "B​::f8" used only once​: possible typo at 0�àq#@​o
line 4.
Name "B​::f9" used only once​: possible typo at 0�àq#@​o
line 4.
Name "B​::f5" used only once​: possible typo at 0�àq#@​o
line 4.
Name "B​::f4" used only once​: possible typo at 0�àq#@​o
line 4.
Name "B​::f1" used only once​: possible typo at 0�àq#@​o
line 4.
Name "B​::f6" used only once​: possible typo at 0�àq#@​o
line 4.
Name "B​::f3" used only once​: possible typo at 0�àq#@​o
line 4.
Name "B​::f2" used only once​: possible typo at 0�àq#@​o
line 4.
Name "B​::f7" used only once​: possible typo at 0�àq#@​o
line 4.
Name "A​::f8" used only once​: possible typo at 0�àq#@​o
line 4.
Name "A​::f9" used only once​: possible typo at 0�àq#@​o
line 4.
... and so on ...

I see corrupted characters instead of filename. This
code works fine in perl-5.6.1. I can reproduce the
issue in 5.8.1 and 5.8.2. Did not try other versions.

% perl5.6.1 -w -e 'use A;'
Name "A​::f1" used only once​: possible typo at A.pm
line 4.
Name "A​::f2" used only once​: possible typo at A.pm
line 4.
Name "A​::f3" used only once​: possible typo at A.pm
line 4.
...
...

Breakpoint 1, Perl_vmess (my_perl=0x819b748,
  pat=0x81782c0 "Name \"%s​::%s\" used only once​:
possible typo",
  args=0xbffeb634) at util.c​:963
963 if (CopLINE(cop))
(gdb) p *cop
$1 = {op_next = 0x0, op_sibling = 0x0, op_ppaddr = 0,
op_targ = 0,
  op_type = 0, op_seq = 0, op_flags = 0 '\000',
op_private = 0 '\000',
  cop_label = 0x0, cop_stashpv = 0x81acd00 "main",
  cop_file = 0x81b7830 "°|\e\bÈ\024\036@​\020", cop_seq
= 0, cop_arybase = 0,
  cop_line = 5, cop_warnings = 0x0, cop_io = 0x0}

(cop is returned by closest_cop()).

Any ideas ? My perl config. is at the end.
thx
Sreeji

Summary of my perl5 (revision 5.0 version 8 subversion
2) configuration​:
  Platform​:
  osname=linux, osvers=2.4.9-e.18smp,
archname=i686-linux-thread-multi
  uname='linux tst 2.4.9-e.18smp #1 smp fri apr 11
18​:24​:51 edt 2003 i686
unknown '
  config_args='-de -Dprefix=/ddev
-Dmake=/usr/bin/make -Dbin=/ddev/bin/ -Ui
nstallusrbinperl -Dusethreads
-Dstartperl=#!/ddev/bin/perl -Dinc_version_list=n
one -Dscriptdir=/nfs/group/ddev/arch/share/bin
-Dsitebin=/ddev/bin -Accflags=
-DNO_HASH_SEED'
  hint=recommended, useposix=true,
d_sigaction=define
  usethreads=define use5005threads=undef
useithreads=define usemultiplicity=def
ine
  useperlio=define d_sfio=undef uselargefiles=define
usesocks=undef
  use64bitint=undef use64bitall=undef
uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DNO_HASH_S
EED -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_
BITS=64 -I/usr/include/gdbm',
  optimize='-O2',
  cppflags='-D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DNO_HASH_SEED
-fno-strict-aliasing -I/usr/local/include
-I/usr/include/gdbm'
  ccversion='', gccversion='2.96 20000731 (Red Hat
Linux 7.2 2.96-108.1)', gcco
sandvers=''
  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 =' -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib
  libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil
-lpthread -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread
-lc
  libc=/lib/libc-2.2.4.so, so=so, useshrplib=false,
libperl=libperl.a
  gnulibc_version='2.2.4'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
ccdlflags='-rdynamic'
  cccdlflags='-fpic', lddlflags='-shared
-L/usr/local/lib'
Characteristics of this binary (from libperl)​:
  Compile-time options​: MULTIPLICITY USE_ITHREADS
USE_LARGE_FILES PERL_IMPLICIT_C
ONTEXT
  Built under linux
  Compiled at Dec 15 2003 02​:53​:55
  %ENV​:
  PERL5LIB="/ddev/pm"
  @​INC​:
  /ddev/lib/perl5/5.8.2/i686-linux-thread-multi
  /ddev/lib/perl5/5.8.2
 
/ddev/lib/perl5/site_perl/5.8.2/i686-linux-thread-multi
  /ddev/lib/perl5/site_perl/5.8.2
  /ddev/lib/perl5/site_perl
  .

________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http​://mail.messenger.yahoo.co.uk

@p5pRT
Copy link
Author

p5pRT commented Jan 6, 2004

From enache@rdslink.ro

On Mon, Jan 05, 2004 a.d., Sreeji wrote​:

package A;
[...]
*$f = "B​::$f";
[...]
% perl -w -e 'use A;'
Name "B​::f8" used only once​: possible typo at 0Â�àq#@​o
line 4.

The code in Perl_gv_check() uses GvFILE to set the filename to be used
when warning​:
  file = GvFILE(gv);
#ifdef USE_ITHREADS
  CopFILE(PL_curcop) = file; /* set for warning */

But GvFILE() is junk with an ithreaded perl.
For reference​:
http​://nntp.perl.org/group/perl.perl5.porters/85596
http​://nntp.perl.org/group/perl.perl5.porters/79650

and
http​://public.activestate.com/cgi-bin/perlbrowse?patch=19197
for a change that introduced a leak just to work around coredumps
caused by this (ANY constant sub declaration leaks now).

The handling of CopFILE under ithreads is interesting even without bugs​:

$ perl -MCPAN -u -e 1
Aborted (core dumped)
$ strings core.4745 | grep /opt/y/perl/5.9.0/i686-linux-thread-multi-64int-ld/lib/CPAN.pm | wc -l
  3162

For every ';', etc. perl will allocate another memory chunk from the
heap and copy the script filename into it. The same happens with
the stash name.

Regards,
Adi

@p5pRT
Copy link
Author

p5pRT commented Jan 6, 2004

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

@p5pRT
Copy link
Author

p5pRT commented Jan 6, 2004

From sreeji_k@yahoo.com

--- Adrian Enache via RT <perlbug-followup@​perl.org>
wrote​: > On Mon, Jan 05, 2004 a.d., Sreeji wrote​:

For every ';', etc. perl will allocate another
memory chunk from the
heap and copy the script filename into it. The same
happens with
the stash name.
This is scary - it happens even if you don't create
any threads, but just have an ithreads-enabled perl ?
I'm investigating to convert a chunk of my production
code to use ithreads.

thanks
Sreeji

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http​://uk.messenger.yahoo.com/download/index.html

@p5pRT
Copy link
Author

p5pRT commented Jun 21, 2008

p5p@spam.wizbit.be - Status changed from 'open' 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