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

d527ce7c pp_caller UTF8 cleanup broke B::C XSLoader #11696

Closed
p5pRT opened this issue Oct 13, 2011 · 5 comments
Closed

d527ce7c pp_caller UTF8 cleanup broke B::C XSLoader #11696

p5pRT opened this issue Oct 13, 2011 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 13, 2011

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

Searchable as RT101336$

@p5pRT
Copy link
Author

p5pRT commented Oct 13, 2011

From @rurban

This is a bug report for perl from rurban@​cpan.org,
generated with the help of perlbug 1.39 running under perl 5.14.2.


This commit d527ce7
Author​: Brian Fraser <fraserbn@​gmail.com>
Date​: Mon Sep 26 15​:32​:45 2011 -0700

  pp_ctl.c​: pp_caller UTF8 cleanup.

using the stash hek instead of the stash name broke the B​::C compiler,
esp. for XSLoader, loading dynamic modules from within C.
Overwriting the static cop with the new HEK fails with

#0 0x00007fff812fd0b6 in __kill ()
#1 0x00007fff8139d9f6 in abort ()
#2 0x00007fff8138a9bc in __assert_rtn ()
#3 0x00000001002ae422 in S_unshare_hek_or_pvn (hek=0x10062d1e8,
str=0x0, len=0, hash=0) at hv.c​:2588
#4 0x00000001002ae3a6 in Perl_unshare_hek (hek=0x10062d1e8) at hv.c​:2561
#5 0x000000010030da9c in Perl_sv_force_normal_flags (sv=0x1000cf990,
flags=4) at sv.c​:4829
#6 0x000000010030c4a8 in Perl_sv_usepvn_flags (sv=0x1000cf990,
ptr=0x100608650 "Data​::Dumper", len=12, flags=256) at sv.c​:4659
#7 0x000000010030c08b in Perl_sv_sethek (sv=0x1000cf990,
hek=0x100608648) at sv.c​:4618
#8 0x00000001003974ad in Perl_pp_caller () at pp_ctl.c​:1911
#9 0x000000010025d2af in Perl_runops_debug () at dump.c​:2201
#10 0x000000010017ab91 in Perl_call_sv (sv=0x1000c96b0, flags=5) at perl.c​:2665
#11 0x000000010017a56e in Perl_call_pv (sub_name=0x1000a4b8d
"XSLoader​::load", flags=5) at perl.c​:2568
#12 0x000000010009fd20 in dl_init () at ccode45.c​:28187

This was not an issue with the stashname.
Repro​:
$ cpan B​::C
$ t/testc.sh 45

I found no way to workaround this.



Flags​:
  category=core
  severity=high


Site configuration information for perl 5.14.2​:

Configured by rurban at Tue Sep 27 12​:28​:28 CDT 2011.

Summary of my perl5 (revision 5 version 14 subversion 2) configuration​:

  Platform​:
  osname=darwin, osvers=10.8.0, archname=darwin-x86-64-nothreads
  uname='darwin air.local 10.8.0 darwin kernel version 10.8.0​: tue
jun 7 16​:33​:36 pdt 2011; root​:xnu-1504.15.3~1release_i386 i386 '
  config_args='-de -Dusedtrace -Dmksymlinks -Doptimize=-Os
-Uuseithreads -Dcc=gcc-mp-4.6 -Accflags=-m64 -Duseshrplib
-Dld=gcc-mp-4.6 -Accflags=-mssse3 -Darchname=darwin-x86-64-nothreads'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='gcc-mp-4.6', ccflags ='-fno-common -DPERL_DARWIN -m64 -mssse3
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-I/opt/local/include',
  optimize='-Os',
  cppflags='-fno-common -DPERL_DARWIN -m64 -mssse3
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-I/opt/local/include'
  ccversion='', gccversion='4.6.1 20110325 (prerelease)', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='
-fstack-protector -L/usr/local/lib -L/opt/local/lib'
  libpth=/usr/local/lib /opt/local/lib /usr/lib
  libs=-lgdbm -ldbm -ldl -lm -lutil -lc
  perllibs=-ldl -lm -lutil -lc
  libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup
-L/usr/local/lib -L/opt/local/lib -fstack-protector'

Locally applied patches​:


@​INC for perl 5.14.2​:
  /usr/local/lib/perl5/site_perl/5.14.2/darwin-x86-64-nothreads
  /usr/local/lib/perl5/site_perl/5.14.2
  /usr/local/lib/perl5/5.14.2/darwin-x86-64-nothreads
  /usr/local/lib/perl5/5.14.2
  /usr/local/lib/perl5/site_perl/5.14.1
  /usr/local/lib/perl5/site_perl/5.14.0
  /usr/local/lib/perl5/site_perl/5.10.1
  /usr/local/lib/perl5/site_perl/5.8.9
  /usr/local/lib/perl5/site_perl/5.6.2
  /usr/local/lib/perl5/site_perl
  .


Environment for perl 5.14.2​:
  DYLD_LIBRARY_PATH (unset)
  HOME=/Users/rurban
  LANG=en_US.UTF-8
  LANGUAGE (unset)
  LC_CTYPE=en_US.UTF-8
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/opt/local/libexec/gnubin​:/opt/local/bin​:/opt/local/sbin​:/usr/bin​:/bin​:/usr/sbin​:/sbin​:/usr/local/bin​:/usr/X11/bin​:/Users/rurban/bin
  PERL_BADLANG (unset)
  SHELL=/bin/bash

--
Reini Urban
http​://cpanel.net/   http​://www.perl-compiler.org/

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2011

From @rurban

Found a workaround
http​://code.google.com/p/perl-compiler/issues/detail?id=77

I added a XSLoader​::load_file function with a sane API in r1190, which does not use caller() and
its new problem with using HEK instead of the stashname PV. We have no caller info since we
freeze/thaw the state after BEGIN, when the bootstrap call was already made, and we have no
caller information for this call. We successfully faked it until 5.15.3 in dl_init(), now we use our
private XSLoader​::load_file()
--
Reini Urban

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2011

From [Unknown Contact. See original ticket]

Found a workaround
http​://code.google.com/p/perl-compiler/issues/detail?id=77

I added a XSLoader​::load_file function with a sane API in r1190, which does not use caller() and
its new problem with using HEK instead of the stashname PV. We have no caller info since we
freeze/thaw the state after BEGIN, when the bootstrap call was already made, and we have no
caller information for this call. We successfully faked it until 5.15.3 in dl_init(), now we use our
private XSLoader​::load_file()
--
Reini Urban

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2011

@rurban - Status changed from 'new' to 'resolved'

@p5pRT p5pRT closed this as completed Oct 17, 2011
@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2011

From @cpansprout

On Mon Oct 17 11​:30​:05 2011, rurban wrote​:

Found a workaround
http​://code.google.com/p/perl-compiler/issues/detail?id=77

I added a XSLoader​::load_file function with a sane API in r1190, which
does not use caller() and
its new problem with using HEK instead of the stashname PV. We have no
caller info since we
freeze/thaw the state after BEGIN, when the bootstrap call was already
made, and we have no
caller information for this call. We successfully faked it until
5.15.3 in dl_init(), now we use our
private XSLoader​::load_file()

Thank you. I was going to try and look at this, but I only got as far
as staring at the offending change and wondering how it could have
broken anything....

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