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

Bleadperl v5.21.1-120-g34dadc6 breaks SYOHEX/Text-Xslate-3.3.3.tar.gz #14057

Closed
p5pRT opened this issue Aug 31, 2014 · 6 comments
Closed

Bleadperl v5.21.1-120-g34dadc6 breaks SYOHEX/Text-Xslate-3.3.3.tar.gz #14057

p5pRT opened this issue Aug 31, 2014 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 31, 2014

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

Searchable as RT122666$

@p5pRT
Copy link
Author

p5pRT commented Aug 31, 2014

From @andk

git bisect


commit 34dadc6
Author​: David Mitchell <davem@​iabyn.com>
Date​: Mon Jul 7 23​:17​:13 2014 +0100

  faster constant hash key lookups ($hash{const})

Note​: the bisect was limited to threaded perls. Text-Xslate-3.3.3
continues to wok on unthreaded perls.

sample fail


http​://www.cpantesters.org/cpan/report/44711096

perl -V


Summary of my perl5 (revision 5 version 21 subversion 2) configuration​:
  Commit id​: 0e22af7
  Platform​:
  osname=linux, osvers=3.14-2-amd64, archname=x86_64-linux-thread-multi
  uname='linux k83 3.14-2-amd64 #1 smp debian 3.14.13-2 (2014-07-24) x86_64 gnulinux '
  config_args='-Dprefix=/home/sand/src/perl/repoperls/installed-perls/perl/v5.21.2/9980 -Dmyhostname=k83 -Dinstallusrbinperl=n -Uversiononly -Dusedevel -des -Ui_db -Duseithreads -Uuselongdouble -DDEBUGGING=-g'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=define, usemultiplicity=define
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2',
  optimize='-O2 -g',
  cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.9.1', 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='cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/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=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
  libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.19'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl)​:
  Compile-time options​: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
  PERL_DONT_CREATE_GVSV
  PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
  PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
  PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
  PERL_USE_DEVEL USE_64_BIT_ALL USE_64_BIT_INT
  USE_ITHREADS USE_LARGE_FILES USE_LOCALE
  USE_LOCALE_COLLATE USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO
  USE_PERL_ATOF USE_REENTRANT_API
  Built under linux
  Compiled at Aug 1 2014 04​:36​:41
  %ENV​:
  PERL5LIB=""
  PERL5OPT=""
  PERL5_CPANPLUS_IS_RUNNING="7063"
  PERL5_CPAN_IS_RUNNING="7063"
  PERL_MM_USE_DEFAULT="1"
  @​INC​:
  /home/sand/src/perl/repoperls/installed-perls/perl/v5.21.2/9980/lib/site_perl/5.21.2/x86_64-linux-thread-multi
  /home/sand/src/perl/repoperls/installed-perls/perl/v5.21.2/9980/lib/site_perl/5.21.2
  /home/sand/src/perl/repoperls/installed-perls/perl/v5.21.2/9980/lib/5.21.2/x86_64-linux-thread-multi
  /home/sand/src/perl/repoperls/installed-perls/perl/v5.21.2/9980/lib/5.21.2
  .
--
andreas

@p5pRT
Copy link
Author

p5pRT commented Aug 31, 2014

From @cpansprout

On Sun Aug 31 05​:19​:31 2014, andreas.koenig.7os6VVqR@​franz.ak.mind.de wrote​:

git bisect
----------
commit 34dadc6
Author​: David Mitchell <davem@​iabyn.com>
Date​: Mon Jul 7 23​:17​:13 2014 +0100

faster constant hash key lookups ($hash{const})

Note​: the bisect was limited to threaded perls. Text-Xslate-3.3.3
continues to wok on unthreaded perls.

sample fail
-----------
http​://www.cpantesters.org/cpan/report/44711096

I haven’t looked into the failure yet, but parts of that commit don’t make sense to me​:

  /* keysv is actually a HEK in disguise, so we can match just by
  * comparing the HEK pointers in the HE chain. There is a slight
  * caveat​: on something like "\x80", which has both plain and utf8
  * representations, perl's hashes do encoding-insensitive lookups,
  * but preserve the encoding of the stored key. Thus a particular
  * key could map to two different HEKs in PL_strtab. We only
  * conclude 'not found' if all the flags are the same; otherwise
  * we fall back to a full search (this should only happen in rare
  * cases).
  */
  int keysv_flags = HEK_FLAGS(keysv_hek);
  HE *orig_entry = entry;

  for (; entry; entry = HeNEXT(entry)) {
  HEK *hek = HeKEY_hek(entry);
  if (hek == keysv_hek)
  goto found;
  if (HEK_FLAGS(hek) != keysv_flags)
  break; /* need to do full match */
  }

Since the flags are stored as part of the hek, shouldn’t a simple address equality check be sufficient?

What that code is doing is falling back to the old code if a hash contains *any* entries (prior to the one we want) that have flags differing from the sought entry.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Aug 31, 2014

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

@p5pRT
Copy link
Author

p5pRT commented Aug 31, 2014

From @cpansprout

On Sun Aug 31 07​:05​:35 2014, sprout wrote​:

On Sun Aug 31 05​:19​:31 2014, andreas.koenig.7os6VVqR@​franz.ak.mind.de
wrote​:

git bisect
----------
commit 34dadc6
Author​: David Mitchell <davem@​iabyn.com>
Date​: Mon Jul 7 23​:17​:13 2014 +0100

faster constant hash key lookups ($hash{const})

Note​: the bisect was limited to threaded perls. Text-Xslate-3.3.3
continues to wok on unthreaded perls.

sample fail
-----------
http​://www.cpantesters.org/cpan/report/44711096

I haven’t looked into the failure yet, but parts of that commit don’t
make sense to me​:

Never mind that. I wasn’t thinking straight.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Sep 2, 2014

From @iabyn

On Sun, Aug 31, 2014 at 05​:19​:32AM -0700, Andreas J. Koenig via RT wrote​:

git bisect
----------
commit 34dadc6
Author​: David Mitchell <davem@​iabyn.com>
Date​: Mon Jul 7 23​:17​:13 2014 +0100

faster constant hash key lookups \($hash\{const\}\)

Note​: the bisect was limited to threaded perls. Text-Xslate-3.3.3
continues to wok on unthreaded perls.

It's a thread-safety issue in Mouse (which Text-Xslate uses), and which
that perl commit just happens to tickle.

I'll raise a ticket against Mouse.

--
Dave's first rule of Opera​:
If something needs saying, say it​: don't warble it.

@p5pRT
Copy link
Author

p5pRT commented Sep 3, 2014

@iabyn - 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