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

New copy-on-write breaks CPAN #12617

Closed
p5pRT opened this issue Nov 25, 2012 · 32 comments
Closed

New copy-on-write breaks CPAN #12617

p5pRT opened this issue Nov 25, 2012 · 32 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 25, 2012

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

Searchable as RT115910$

@p5pRT
Copy link
Author

p5pRT commented Nov 25, 2012

From @cpansprout

I haven’t merged it yet, but I intend to shortly. This is what it will break​:

Algorithm-FEC-1.0
Alter-0.07
Audio-FindChunks-2.00
Dotiac-addon-htmltemplate-0.4
File-BOM-0.14
HTML-Template-Parser-0.1007
Linux-DVB-DVBT-Advert-0.04
Log-Syslog-Fast-0.60
Math-Rand48-1.00
Math-Symbolic-0.606 (2 tests failing instead of one)
PHP-Serialization-XS-0.06
Path-Class-0.26
Path-Extended-0.20
POSIX-pselect-0.03 - tests pass anyway; probably still broken
Process-MaxSize-0.01
Storable-AMF-1.00
String-Simrank-0.079
Waft-0.9910
v6-0.044

File​::BOM is actually broken due to an existing Encode bug. There is a patch in rt.cpan.org #80608 that needs to be applied and merged into blead before 5.18.


Flags​:
  category=core
  severity=low


Site configuration information for perl 5.17.7​:

Configured by sprout at Fri Nov 23 12​:46​:02 PST 2012.

Summary of my perl5 (revision 5 version 17 subversion 7) configuration​:
  Commit id​: de0df3c
  Platform​:
  osname=darwin, osvers=10.5.0, archname=darwin-thread-multi-2level
  uname='darwin pint.local 10.5.0 darwin kernel version 10.5.0​: fri nov 5 23​:20​:39 pdt 2010; root​:xnu-1504.9.17~1release_i386 i386 '
  config_args='-de -DDEBUGGING -Duseithreads -Dusedevel -Accflags=-DPERL_NEW_COPY_ON_WRITE'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=define, usemultiplicity=define
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=undef, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-common -DPERL_DARWIN -DPERL_NEW_COPY_ON_WRITE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
  optimize='-O3 -g',
  cppflags='-fno-common -DPERL_DARWIN -DPERL_NEW_COPY_ON_WRITE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.2.1 (Apple Inc. build 5664)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=4, 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'
  libpth=/usr/local/lib /usr/lib
  libs=-ldbm -ldl -lm -lutil -lc
  perllibs=-ldl -lm -lutil -lc
  libc=, so=dylib, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'

Locally applied patches​:
 


@​INC for perl 5.17.7​:
  /usr/local/lib/perl5/site_perl/5.17.7/darwin-thread-multi-2level
  /usr/local/lib/perl5/site_perl/5.17.7
  /usr/local/lib/perl5/5.17.7/darwin-thread-multi-2level
  /usr/local/lib/perl5/5.17.7
  /usr/local/lib/perl5/site_perl
  .


Environment for perl 5.17.7​:
  DYLD_LIBRARY_PATH (unset)
  HOME=/Users/sprout
  LANG=en_US.UTF-8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/bin​:/bin​:/usr/sbin​:/sbin​:/usr/local/bin​:/usr/X11/bin​:/usr/local/bin
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Nov 26, 2012

From @Leont

On Sun, Nov 25, 2012 at 10​:37 PM, Father Chrysostomos
<perlbug-followup@​perl.org> wrote​:

Path-Class-0.26

That's not an XS module, not does it depend on a non-core XS module.
How the hell does it break?

Leon

@p5pRT
Copy link
Author

p5pRT commented Nov 26, 2012

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

@p5pRT
Copy link
Author

p5pRT commented Nov 26, 2012

From @cpansprout

On Mon Nov 26 06​:33​:25 2012, LeonT wrote​:

On Sun, Nov 25, 2012 at 10​:37 PM, Father Chrysostomos
<perlbug-followup@​perl.org> wrote​:

Path-Class-0.26

That's not an XS module, not does it depend on a non-core XS module.
How the hell does it break?

Don’t know yet. :-)

The smokers have found two bugs I need to fix. I am working on that
right now. Hopefully that will make the Path​::Class failure disappear.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Nov 26, 2012

From [Unknown Contact. See original ticket]

On Mon Nov 26 06​:33​:25 2012, LeonT wrote​:

On Sun, Nov 25, 2012 at 10​:37 PM, Father Chrysostomos
<perlbug-followup@​perl.org> wrote​:

Path-Class-0.26

That's not an XS module, not does it depend on a non-core XS module.
How the hell does it break?

Don’t know yet. :-)

The smokers have found two bugs I need to fix. I am working on that
right now. Hopefully that will make the Path​::Class failure disappear.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Nov 27, 2012

From @cpansprout

On Mon Nov 26 09​:52​:18 2012, sprout wrote​:

On Mon Nov 26 06​:33​:25 2012, LeonT wrote​:

On Sun, Nov 25, 2012 at 10​:37 PM, Father Chrysostomos
<perlbug-followup@​perl.org> wrote​:

Path-Class-0.26

That's not an XS module, not does it depend on a non-core XS module.
How the hell does it break?

Don’t know yet. :-)

The smokers have found two bugs I need to fix. I am working on that
right now. Hopefully that will make the Path​::Class failure disappear.

It was actually a bug I introduced in e3918bb, which back then
probably only affected PERL_OLD_COPY_ON_WRITE. I fixed it in f5a0fd1.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Nov 27, 2012

From [Unknown Contact. See original ticket]

On Mon Nov 26 09​:52​:18 2012, sprout wrote​:

On Mon Nov 26 06​:33​:25 2012, LeonT wrote​:

On Sun, Nov 25, 2012 at 10​:37 PM, Father Chrysostomos
<perlbug-followup@​perl.org> wrote​:

Path-Class-0.26

That's not an XS module, not does it depend on a non-core XS module.
How the hell does it break?

Don’t know yet. :-)

The smokers have found two bugs I need to fix. I am working on that
right now. Hopefully that will make the Path​::Class failure disappear.

It was actually a bug I introduced in e3918bb, which back then
probably only affected PERL_OLD_COPY_ON_WRITE. I fixed it in f5a0fd1.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Nov 27, 2012

From @cpansprout

On Sun Nov 25 13​:37​:30 2012, sprout wrote​:

I haven’t merged it yet, but I intend to shortly.

It has been merged as cd298ce.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Nov 27, 2012

From [Unknown Contact. See original ticket]

On Sun Nov 25 13​:37​:30 2012, sprout wrote​:

I haven’t merged it yet, but I intend to shortly.

It has been merged as cd298ce.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Dec 6, 2012

From @andk

Father Chrysostomos (via RT) <perlbug-followup@​perl.org> writes​:

This is what it will break​:

Algorithm-FEC-1.0
Alter-0.07
Audio-FindChunks-2.00
Dotiac-addon-htmltemplate-0.4
File-BOM-0.14
HTML-Template-Parser-0.1007
Linux-DVB-DVBT-Advert-0.04
Log-Syslog-Fast-0.60
Math-Rand48-1.00
Math-Symbolic-0.606 (2 tests failing instead of one)
PHP-Serialization-XS-0.06
Path-Class-0.26
Path-Extended-0.20
POSIX-pselect-0.03 - tests pass anyway; probably still broken
Process-MaxSize-0.01
Storable-AMF-1.00
String-Simrank-0.079
Waft-0.9910
v6-0.044

Are you intending to write individual tickets for each?

In any case, I have three more​:

File-Map-0.53
I18N-Handle-0.051
SysV-SharedMem-0.007

All three start failing at v5.17.6-87-g07d01d6

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Dec 6, 2012

From @cpansprout

On Thu Dec 06 12​:17​:00 2012, andreas.koenig.7os6VVqR@​franz.ak.mind.de wrote​:

Father Chrysostomos (via RT) <perlbug-followup@​perl.org> writes​:

This is what it will break​:

Algorithm-FEC-1.0
Alter-0.07
Audio-FindChunks-2.00
Dotiac-addon-htmltemplate-0.4
File-BOM-0.14
HTML-Template-Parser-0.1007
Linux-DVB-DVBT-Advert-0.04
Log-Syslog-Fast-0.60
Math-Rand48-1.00
Math-Symbolic-0.606 (2 tests failing instead of one)
PHP-Serialization-XS-0.06
Path-Class-0.26
Path-Extended-0.20
POSIX-pselect-0.03 - tests pass anyway; probably still broken
Process-MaxSize-0.01
Storable-AMF-1.00
String-Simrank-0.079
Waft-0.9910
v6-0.044

Are you intending to write individual tickets for each?

I was planning to do so as I write patches.

In any case, I have three more​:

File-Map-0.53
I18N-Handle-0.051
SysV-SharedMem-0.007

Thank you.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Dec 6, 2012

From [Unknown Contact. See original ticket]

On Thu Dec 06 12​:17​:00 2012, andreas.koenig.7os6VVqR@​franz.ak.mind.de wrote​:

Father Chrysostomos (via RT) <perlbug-followup@​perl.org> writes​:

This is what it will break​:

Algorithm-FEC-1.0
Alter-0.07
Audio-FindChunks-2.00
Dotiac-addon-htmltemplate-0.4
File-BOM-0.14
HTML-Template-Parser-0.1007
Linux-DVB-DVBT-Advert-0.04
Log-Syslog-Fast-0.60
Math-Rand48-1.00
Math-Symbolic-0.606 (2 tests failing instead of one)
PHP-Serialization-XS-0.06
Path-Class-0.26
Path-Extended-0.20
POSIX-pselect-0.03 - tests pass anyway; probably still broken
Process-MaxSize-0.01
Storable-AMF-1.00
String-Simrank-0.079
Waft-0.9910
v6-0.044

Are you intending to write individual tickets for each?

I was planning to do so as I write patches.

In any case, I have three more​:

File-Map-0.53
I18N-Handle-0.051
SysV-SharedMem-0.007

Thank you.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Dec 6, 2012

From @Leont

On Thu, Dec 6, 2012 at 9​:16 PM, Andreas Koenig
<andreas.koenig.7os6VVqR@​franz.ak.mind.de> wrote​:

Are you intending to write individual tickets for each?

File-Map-0.53
SysV-SharedMem-0.007

Interesting. Both SV_CHECK_THINKFIRST(var) before initializing the
variable, so I thought they were safe. I don't know the details of the
new COW logic, I can imagine I also need to do it in the set magic.

Leon

@p5pRT
Copy link
Author

p5pRT commented Dec 8, 2012

From @andk

Andreas Koenig <andreas.koenig.7os6VVqR@​franz.ak.mind.de> writes​:

I18N-Handle-0.051

Scratch that, it belongs into a different category. Smoker still
running, but I suspect it will turn out as a hash randomization bug.

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Dec 16, 2012

From @Leont

On Thu, Dec 6, 2012 at 11​:37 PM, Leon Timmermans <fawaka@​gmail.com> wrote​:

Interesting. Both SV_CHECK_THINKFIRST(var) before initializing the
variable, so I thought they were safe. I don't know the details of the
new COW logic, I can imagine I also need to do it in the set magic.

I think I've fixed it in the latest version of File​::Map, but I
haven't actually had time to verify it.

Leon

@p5pRT
Copy link
Author

p5pRT commented Dec 17, 2012

From @andk

Leon Timmermans <fawaka@​gmail.com> writes​:

On Thu, Dec 6, 2012 at 11​:37 PM, Leon Timmermans <fawaka@​gmail.com> wrote​:

Interesting. Both SV_CHECK_THINKFIRST(var) before initializing the
variable, so I thought they were safe. I don't know the details of the
new COW logic, I can imagine I also need to do it in the set magic.

I think I've fixed it in the latest version of File​::Map, but I
haven't actually had time to verify it.

In my bisecting runs it survives up to v5.17.6-87-g07d01d6 and then
fails with v5.17.6-88-g1a904fc​:

1a904fc is the first bad commit
commit 1a904fc
Author​: Father Chrysostomos <sprout@​cpan.org>
Date​: Sun Nov 25 12​:57​:04 2012 -0800

  Disable PL_sawampersand

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Dec 18, 2012

From @Leont

On Mon, Dec 17, 2012 at 10​:25 PM, Andreas Koenig
<andreas.koenig.7os6VVqR@​franz.ak.mind.de> wrote​:

I think I've fixed it in the latest version of File​::Map, but I
haven't actually had time to verify it.

In my bisecting runs it survives up to v5.17.6-87-g07d01d6 and then
fails with v5.17.6-88-g1a904fc​:

1a904fc is the first bad commit
commit 1a904fc
Author​: Father Chrysostomos <sprout@​cpan.org>
Date​: Sun Nov 25 12​:57​:04 2012 -0800

Disable PL\_sawampersand

That isn't making any sense. I'd say either the bisect is wrong or the
refactoring FC did is strangely broken, I suspect the former. Do you
have a test report at hand? FC​: can you take a look at this?

Leon

@p5pRT
Copy link
Author

p5pRT commented Dec 19, 2012

From @andk

Leon Timmermans <fawaka@​gmail.com> writes​:

Disable PL\_sawampersand

That isn't making any sense. I'd say either the bisect is wrong or the
refactoring FC did is strangely broken, I suspect the former. Do you
have a test report at hand? FC​: can you take a look at this?

http​://www.cpantesters.org/cpan/report/26634729
http​://www.cpantesters.org/cpan/report/26634753

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Dec 19, 2012

From @Leont

On Wed, Dec 19, 2012 at 7​:19 AM, Andreas Koenig
<andreas.koenig.7os6VVqR@​franz.ak.mind.de> wrote​:

That isn't making any sense. I'd say either the bisect is wrong or the
refactoring FC did is strangely broken, I suspect the former. Do you
have a test report at hand? FC​: can you take a look at this?

http​://www.cpantesters.org/cpan/report/26634729
http​://www.cpantesters.org/cpan/report/26634753

Thank you, that clarifies everything. I'm somewhat horrified I didn't
have an explicit test for this, if it wasn't for Test​::NoWarnings we
wouldn't have noticed something was broken bad.

My module makes the assumption that s/a/b/g does not reallocate the
buffer that is substituted. It seems the COW logic on s/// breaks that
assumption. This reallocation breaks writing to memory mappings in
general (and probably other modules that own their own buffers too).

Leon

@p5pRT
Copy link
Author

p5pRT commented Dec 19, 2012

From @cpansprout

On Wed Dec 19 05​:13​:09 2012, LeonT wrote​:

On Wed, Dec 19, 2012 at 7​:19 AM, Andreas Koenig
<andreas.koenig.7os6VVqR@​franz.ak.mind.de> wrote​:

That isn't making any sense. I'd say either the bisect is wrong or the
refactoring FC did is strangely broken, I suspect the former. Do you
have a test report at hand? FC​: can you take a look at this?

http​://www.cpantesters.org/cpan/report/26634729
http​://www.cpantesters.org/cpan/report/26634753

Thank you, that clarifies everything. I'm somewhat horrified I didn't
have an explicit test for this, if it wasn't for Test​::NoWarnings we
wouldn't have noticed something was broken bad.

My module makes the assumption that s/a/b/g does not reallocate the
buffer that is substituted. It seems the COW logic on s/// breaks that
assumption. This reallocation breaks writing to memory mappings in
general (and probably other modules that own their own buffers too).

That logic probably needs to be revisited then. Is the s/// target a
COW before the substitution? (You don’t need to CC me.)

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Dec 19, 2012

From [Unknown Contact. See original ticket]

On Wed Dec 19 05​:13​:09 2012, LeonT wrote​:

On Wed, Dec 19, 2012 at 7​:19 AM, Andreas Koenig
<andreas.koenig.7os6VVqR@​franz.ak.mind.de> wrote​:

That isn't making any sense. I'd say either the bisect is wrong or the
refactoring FC did is strangely broken, I suspect the former. Do you
have a test report at hand? FC​: can you take a look at this?

http​://www.cpantesters.org/cpan/report/26634729
http​://www.cpantesters.org/cpan/report/26634753

Thank you, that clarifies everything. I'm somewhat horrified I didn't
have an explicit test for this, if it wasn't for Test​::NoWarnings we
wouldn't have noticed something was broken bad.

My module makes the assumption that s/a/b/g does not reallocate the
buffer that is substituted. It seems the COW logic on s/// breaks that
assumption. This reallocation breaks writing to memory mappings in
general (and probably other modules that own their own buffers too).

That logic probably needs to be revisited then. Is the s/// target a
COW before the substitution? (You don’t need to CC me.)

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Dec 19, 2012

From @Leont

On Wed, Dec 19, 2012 at 2​:55 PM, Father Chrysostomos via RT
<perlbug-comment@​perl.org> wrote​:

That logic probably needs to be revisited then. Is the s/// target a
COW before the substitution? (You don’t need to CC me.)

No, it's a SvLEN == 0 string, with set magic as fallback to ensure the
SvPVX keeps pointing into the memory map. The fallback however is
wildly inefficient as it needs to copy the copy, hence the warning.
It's there to prevent data-loss and segfaults, not to be used
intentionally.

Leon

@p5pRT
Copy link
Author

p5pRT commented Dec 20, 2012

From @andk

git bisect


commit 07d01d6
Author​: Father Chrysostomos <sprout@​cpan.org>
Date​: Wed Nov 21 12​:45​:33 2012 -0800

  Enable PERL_NEW_COPY_ON_WRITE by default

sample fail report


http​://www.cpantesters.org/cpan/report/482522f4-4462-11e2-b569-bf2ea8c9b5a1

also affected


SISYPHUS/Math-GMPf-0.35.tar.gz
SISYPHUS/Math-GMPq-0.35.tar.gz

perl -V


Summary of my perl5 (revision 5 version 17 subversion 7) configuration​:
  Commit id​: 07d01d6
  Platform​:
  osname=linux, osvers=3.2.0-4-amd64, archname=x86_64-linux-ld
  uname='linux k83 3.2.0-4-amd64 #1 smp debian 3.2.35-1 x86_64 gnulinux '
  config_args='-Dprefix=/home/src/perl/repoperls/installed-perls/perl/v5.17.6-87-g07d01d6/127e -Dmyhostname=k83 -Dinstallusrbinperl=n -Uversiononly -Dusedevel -des -Ui_db -Uuseithreads -Duselongdouble -DDEBUGGING=-g'
  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=define
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2 -g',
  cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.7.2', 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='long double', nvsize=16, Off_t='off_t', lseeksize=8
  alignbytes=16, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
  libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
  libc=, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.13'
  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 PERLIO_LAYERS PERL_DONT_CREATE_GVSV
  PERL_MALLOC_WRAP PERL_NEW_COPY_ON_WRITE
  PERL_PRESERVE_IVUV PERL_USE_DEVEL USE_64_BIT_ALL
  USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
  USE_LOCALE_COLLATE USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC USE_LONG_DOUBLE USE_PERLIO
  USE_PERL_ATOF
  Built under linux
  Compiled at Dec 17 2012 22​:01​:44
  @​INC​:
  /home/src/perl/repoperls/installed-perls/perl/v5.17.6-87-g07d01d6/127e/lib/site_perl/5.17.7/x86_64-linux-ld
  /home/src/perl/repoperls/installed-perls/perl/v5.17.6-87-g07d01d6/127e/lib/site_perl/5.17.7
  /home/src/perl/repoperls/installed-perls/perl/v5.17.6-87-g07d01d6/127e/lib/5.17.7/x86_64-linux-ld
  /home/src/perl/repoperls/installed-perls/perl/v5.17.6-87-g07d01d6/127e/lib/5.17.7
  .

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Dec 20, 2012

From @nwc10

On Wed, Dec 19, 2012 at 10​:06​:04PM +0100, Leon Timmermans wrote​:

On Wed, Dec 19, 2012 at 2​:55 PM, Father Chrysostomos via RT
<perlbug-comment@​perl.org> wrote​:

That logic probably needs to be revisited then. Is the s/// target a
COW before the substitution? (You don???t need to CC me.)

No, it's a SvLEN == 0 string, with set magic as fallback to ensure the
SvPVX keeps pointing into the memory map. The fallback however is
wildly inefficient as it needs to copy the copy, hence the warning.
It's there to prevent data-loss and segfaults, not to be used
intentionally.

SvLEN == 0 has a historical established meaning of "the core doesn't own
this buffer". If COW were disabled for all PVs with SvLEN == 0, does this
solve the issues in more than just this module?

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Dec 20, 2012

From @Leont

On Thu, Dec 20, 2012 at 1​:12 PM, Nicholas Clark <nick@​ccl4.org> wrote​:

SvLEN == 0 has a historical established meaning of "the core doesn't own
this buffer". If COW were disabled for all PVs with SvLEN == 0, does this
solve the issues in more than just this module?

I assume it does, but I'm not certain on the implications for $& and
friends on such strings (I had the impression they rely on COW now,
but I haven't looked into it).

Leon

@p5pRT
Copy link
Author

p5pRT commented Dec 21, 2012

From @doy

On Sun, Nov 25, 2012 at 01​:37​:30PM -0800, Father Chrysostomos wrote​:

# New Ticket Created by Father Chrysostomos
# Please include the string​: [perl #115910]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=115910 >

I haven’t merged it yet, but I intend to shortly. This is what it will break​:

Algorithm-FEC-1.0
Alter-0.07
Audio-FindChunks-2.00
Dotiac-addon-htmltemplate-0.4
File-BOM-0.14
HTML-Template-Parser-0.1007
Linux-DVB-DVBT-Advert-0.04
Log-Syslog-Fast-0.60
Math-Rand48-1.00
Math-Symbolic-0.606 (2 tests failing instead of one)
PHP-Serialization-XS-0.06
Path-Class-0.26
Path-Extended-0.20
POSIX-pselect-0.03 - tests pass anyway; probably still broken
Process-MaxSize-0.01
Storable-AMF-1.00
String-Simrank-0.079
Waft-0.9910
v6-0.044

File​::BOM is actually broken due to an existing Encode bug. There is a patch in rt.cpan.org #80608 that needs to be applied and merged into blead before 5.18.

[perl #116158] seems related, looks like Inline​::C may be affected as
well.

-doy

@p5pRT
Copy link
Author

p5pRT commented May 20, 2013

From @jkeenan

On Thu Dec 20 16​:40​:39 2012, doy@​tozt.net wrote​:

On Sun, Nov 25, 2012 at 01​:37​:30PM -0800, Father Chrysostomos wrote​:

# New Ticket Created by Father Chrysostomos
# Please include the string​: [perl #115910]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=115910 >

I haven’t merged it yet, but I intend to shortly. This is what it
will break​:

Algorithm-FEC-1.0
Alter-0.07
Audio-FindChunks-2.00
Dotiac-addon-htmltemplate-0.4
File-BOM-0.14
HTML-Template-Parser-0.1007
Linux-DVB-DVBT-Advert-0.04
Log-Syslog-Fast-0.60
Math-Rand48-1.00
Math-Symbolic-0.606 (2 tests failing instead of one)
PHP-Serialization-XS-0.06
Path-Class-0.26
Path-Extended-0.20
POSIX-pselect-0.03 - tests pass anyway; probably still broken
Process-MaxSize-0.01
Storable-AMF-1.00
String-Simrank-0.079
Waft-0.9910
v6-0.044

File​::BOM is actually broken due to an existing Encode bug. There
is a patch in rt.cpan.org #80608 that needs to be applied and merged
into blead before 5.18.

[perl #116158] seems related, looks like Inline​::C may be affected as
well.

Now that Perl 5.18.0 is out, it would be good if someone could summarize
the state of issues discussed in this ticket, particularly with respect to​:

* Opening tickets for any issues that have appeared with 5.18.0.
* Seeing if we can close *this* ticket.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented May 27, 2013

From @Leont

On Thu, Dec 20, 2012 at 1​:12 PM, Nicholas Clark <nick@​ccl4.org> wrote​:

SvLEN == 0 has a historical established meaning of "the core doesn't own
this buffer". If COW were disabled for all PVs with SvLEN == 0, does this
solve the issues in more than just this module?

That is already taken into account in sv_setsv, so I guess something
is happening somewhere else. I think SvCANCOW needs to be improved to
handle this.

Leon

@p5pRT
Copy link
Author

p5pRT commented Aug 22, 2013

From @cpansprout

On Sun May 19 17​:33​:08 2013, jkeenan wrote​:

Now that Perl 5.18.0 is out, it would be good if someone could summarize
the state of issues discussed in this ticket, particularly with
respect to​:

* Opening tickets for any issues that have appeared with 5.18.0.
* Seeing if we can close *this* ticket.

Before we close this ticket, we ought to find out why these are failing
and see, in each case, whether perl or the module needs tweaking​:

ILYAZ/modules/Audio-FindChunks-2.00.tar.gz
ATHOMASON/Log-Syslog-Fast-0.61.tar.gz
NI-S/Math-Rand48-1.00.tar.gz
MSCHILLI/Process-MaxSize-0.03.tar.gz
GRIAN/Storable-AMF-1.00.tar.gz
SHURIKO/String-Simrank-0.079.tar.gz
LEONT/SysV-SharedMem-0.008.tar.gz
SISYPHUS/Math-GMPz-0.37.tar.gz
SISYPHUS/Math-GMPf-0.35.tar.gz
SISYPHUS/Math-GMPq-0.35.tar.gz
KULP/PHP-Serialization-XS-0.06.tar.gz

Those are distributions that either fail on bleadperl or require C
libraries I don’t have installed (so I can’t easily check whether they
are fixed).

And I need to look into this one​:

POSIX-pselect-0.03 - tests pass anyway; probably still broken

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Aug 22, 2013

From @Leont

On Thu, Aug 22, 2013 at 5​:40 PM, Father Chrysostomos via RT <
perlbug-followup@​perl.org> wrote​:

LEONT/SysV-SharedMem-0.008.tar.gz

It uses code highly similar to File​::Map, so if that is fixed I'd assume
SV​::SM is also fixed.

Leon

@p5pRT
Copy link
Author

p5pRT commented May 12, 2014

From @rjbs

This ticket is no longer useful. Specific problems can get specific new tickets.

--
rjbs

@p5pRT
Copy link
Author

p5pRT commented May 12, 2014

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