perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

BBC: Blead Breaks Variable::Magic

Open cjg-cguevara opened this issue 1 year ago • 13 comments

This is a bug report for perl from "Carlos Guevara" [email protected], generated with the help of perlbug 1.43 running under perl 5.39.6.


BBC: Blead Breaks Variable::Magic

Please see http://fast-matrix.cpantesters.org/?dist=Variable::Magic


Flags

  • category=core
  • severity=low

Perl configuration

Site configuration information for perl 5.39.6:

Configured by cpan at Thu Jan 11 13:07:43 EST 2024.

Summary of my perl5 (revision 5 version 39 subversion 6) configuration:
  Commit id: 142fad4314e422f85799a7991e48b413c3dd9840
  Platform:
    osname=linux
    osvers=6.6.10-0-lts
    archname=x86_64-linux-thread-multi
    uname='linux cjg-alpine3 6.6.10-0-lts #1-alpine smp preempt_dynamic mon, 08 jan 2024 10:08:57 +0000 x86_64 linux '
    config_args='-des -Dprefix=/home/cpan/bin/perl -Dscriptdir=/home/cpan/bin/perl/bin -Dusedevel -Duse64bitall -Duseithreads'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='cc'
    ccflags ='-D_REENTRANT -D_GNU_SOURCE -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-O2'
    cppflags='-D_REENTRANT -D_GNU_SOURCE -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong'
    ccversion=''
    gccversion='13.2.1 20231014'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    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-strong -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib /lib
    libs=-lpthread -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc
    libc=/usr/lib/libc.a
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'


---
@INC for perl 5.39.6:
    /home/cpan/bin/perl/lib/site_perl/5.39.6/x86_64-linux-thread-multi
    /home/cpan/bin/perl/lib/site_perl/5.39.6
    /home/cpan/bin/perl/lib/5.39.6/x86_64-linux-thread-multi
    /home/cpan/bin/perl/lib/5.39.6

---
Environment for perl 5.39.6:
    HOME=/home/cpan
    LANG=C.UTF-8
    LANGUAGE (unset)
    LC_COLLATE=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/cpan/bin/perl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

cjg-cguevara avatar Jan 11 '24 18:01 cjg-cguevara

The failed test in Variable::Magic's test suite looks like this:

t/17-ctl.t ........... ok

#   Failed test 'get magic with op_info == 1 gets the right op info'
#   at t/18-opinfo.t line 88.
#          got: 'sassign'
#     expected: 'padsv_store'

#   Failed test 'get magic with op_info == 2 gets the right op info'
#   at t/18-opinfo.t line 91.
#          got: 'sassign'
#     expected: 'padsv_store'

#   Failed test 'get magic with op_info == 1 gets the right op info'
#   at t/18-opinfo.t line 88.
#          got: 'sassign'
#     expected: 'padsv_store'

#   Failed test 'get magic with op_info == 2 gets the right op info'
#   at t/18-opinfo.t line 91.
#          got: 'sassign'
#     expected: 'padsv_store'

#   Failed test 'get magic with op_info == 1 gets the right op info'
#   at t/18-opinfo.t line 88.
#          got: 'sassign'
#     expected: 'padsv_store'

#   Failed test 'get magic with op_info == 2 gets the right op info'
#   at t/18-opinfo.t line 91.
#          got: 'sassign'
#     expected: 'padsv_store'
# Looks like you failed 6 tests of 139.
t/18-opinfo.t ........ 
Dubious, test returned 6 (wstat 1536, 0x600)
Failed 6/139 subtests 

(From this CPANtesters report.)

Bisecting with this invocation ...

perl Porting/bisect.pl --module=Variable::Magic \
--start=846cc447bb8be24479c8be36022a285ec088a9ca \
--end=142fad4314e422f85799a7991e48b413c3dd9840

... points to

c90e7ed39e5df8d5915422454fb76198801f3563 is the first bad commit
commit c90e7ed39e5df8d5915422454fb76198801f3563
Author: David Mitchell <[email protected]>
Date:   Fri Dec 15 21:55:04 2023 +0000
Commit:     David Mitchell <[email protected]>
CommitDate: Tue Jan 9 12:51:04 2024 +0000


    OP_PADSV_STORE: only in void context

@iabyn, can you take a look? Thanks.

jkeenan avatar Jan 11 '24 21:01 jkeenan

Variable::Magic has tests which assume certain ops are present. I've submitted a ticket with a fix: https://rt.cpan.org/Public/Bug/Display.html?id=151104

iabyn avatar Jan 12 '24 14:01 iabyn

I'm re-opening this issue, not because we haven't addressed it, but because Variable::Magic is very high up on the "CPAN River", i.e., has many dependencies. I typically test a list of 500 CPAN distros against a new monthly development release. With this morning's release of perl-5.39.7, there were approx. 61 distros not reached during testing because their common prerequisite, Variable-Magic, was not installed. So we will have to pay special attention to this BBC as perl-5.40 approaches.

If there's anyone who can facilitate the application of the patch which Dave submitted upstream, please contact the upstream maintainer.

jkeenan avatar Jan 20 '24 15:01 jkeenan

Also affected by the same commit: KARASIK/DBIx-Perlish-1.07.tar.gz Sample fail report: http://www.cpantesters.org/cpan/report/72170200-d41e-11ee-8b20-fd5b2320d34f @dk please take note

andk avatar Feb 26 '24 21:02 andk

On Mon, Feb 26, 2024 at 01:09:57PM -0800, andk wrote:

Also affected by the same commit: KARASIK/DBIx-Perlish-1.07.tar.gz Sample fail report: http://www.cpantesters.org/cpan/report/72170200-d41e-11ee-8b20-fd5b2320d34f @dk please take note

That appears to be also due to the changed optree structure and the module's expectations of that structure.

I propose reverting this commit for now and readdress the issue after 5.40. it's just a minor optimisation and we're getting near the 5.40 release date.

I've make a PR with the revert: PR #22041

-- No man treats a motor car as foolishly as he treats another human being. When the car will not go, he does not attribute its annoying behaviour to sin, he does not say, You are a wicked motorcar, and I shall not give you any more petrol until you go. He attempts to find out what is wrong and set it right. -- Bertrand Russell, Has Religion Made Useful Contributions to Civilization?

iabyn avatar Feb 27 '24 12:02 iabyn

On Tue, Feb 27, 2024 at 04:07:13AM -0800, iabyn wrote:

I propose reverting this commit for now and readdress the issue after 5.40. it's just a minor optimisation and we're getting near the 5.40 release date.

I've make a PR with the revert: PR #22041

now reverted via v5.39.8-35-gdc524b6cbd

-- Standards (n). Battle insignia or tribal totems.

iabyn avatar Feb 28 '24 10:02 iabyn

Variable::Magic has been fixed: https://metacpan.org/release/VPIT/Variable-Magic-0.64

mauke avatar Mar 19 '24 04:03 mauke

Now that 5.40.0 has been released, I've unreverted this commit with v5.41.0-51-g9a224d076a

iabyn avatar Jun 19 '24 16:06 iabyn

I built a perl at a commit later than the one at which @iabyn committed yesterday. I was able to install Variable::Magic against that perl. So that suggests that we may be able to quickly re-close this ticket. We will presumably have more data after a v5.41.1 release; I will take the ticket in the meantime.

jkeenan avatar Jun 20 '24 22:06 jkeenan

Says https://metacpan.org/dist/Variable-Magic/changes:

0.64 2024-03-18 23:20 UTC
[...]

  • Fix : [RT #151104] : fix for t/18-opinfo.t broken under blead Some optimization in core made t/18-opinfo.t fail since perl 5.39.7, but that was reverted before 5.40 was released. This fix will make this test pass even when the optimization is reinstantiated after release freeze. Thanks David Mitchell for reporting and providing a fix.

mauke avatar Jun 21 '24 03:06 mauke

On Thu, Jun 20, 2024 at 03:49:12PM -0700, James E Keenan wrote:

I built a perl at a commit later than the one at which @iabyn committed yesterday. I was able to install Variable::Magic against that perl.

This ticket mentions that DBIx-Perlish was also failing. I haven't looked into whether it is fixed yet.

-- It's not that I'm afraid to die, I just don't want to be there when it happens. -- Woody Allen

iabyn avatar Jun 21 '24 08:06 iabyn

On Thu, Jun 20, 2024 at 03:49:12PM -0700, James E Keenan wrote: I built a perl at a commit later than the one at which @iabyn committed yesterday. I was able to install Variable::Magic against that perl. This ticket mentions that DBIx-Perlish was also failing. I haven't looked into whether it is fixed yet.

I've applied new code in DBIx-Perlish that works with your latest change but I didn't release the next version 1.08 because I was a bit confused whether that would be the correct thing to do until the dust settles. So I guess the tests on 1.07 will still fail, but if you mean that releasing 1.08 is a good idea kindly ping me if/when you think the work on this opcode optimization is done

dk avatar Jun 21 '24 11:06 dk

On Thu, Jun 20, 2024 at 03:49:12PM -0700, James E Keenan wrote: I built a perl at a commit later than the one at which @iabyn committed yesterday. I was able to install Variable::Magic against that perl. This ticket mentions that DBIx-Perlish was also failing. I haven't looked into whether it is fixed yet.

I've applied new code in DBIx-Perlish that works with your latest change but I didn't release the next version 1.08 because I was a bit confused whether that would be the correct thing to do until the dust settles. So I guess the tests on 1.07 will still fail, but if you mean that releasing 1.08 is a good idea kindly ping me if/when you think the work on this opcode optimization is done

Variable-Magic-1.07 was PASSing all its tests, but unfortunately the most recent commit cited in this ticket has caused t/80.parse-bad.t to FAIL. See, e.g.,, http://www.cpantesters.org/cpan/report/04221034-2fca-11ef-a625-a5b3ee15ee15. Or:

perlmonger: DBIx-Perlish-1.07-0] $ bleadprove -vb t/80.parse-bad.t
t/80.parse-bad.t .. 
ok 1 - empty select
...
ok 8 - table label1
not ok 9 - table label2

#   Failed test 'table label2'
#   at t/test_utils.pm line 53.
#                   'label table must be followed by an assignment at t/80.parse-bad.t line 33.
# '
#     doesn't match '(?^:label .*? must be followed by a lexical variable declaration)'
ok 10 - limit label1

...
ok 23 - assignment in select
ok 24 - assignment in delete
not ok 25 - bad simple term 1

#   Failed test 'bad simple term 1'
#   at t/test_utils.pm line 53.
#                   'label table must be followed by an assignment at t/80.parse-bad.t line 91.
# '
#     doesn't match '(?^:cannot reconstruct simple term from operation)'
ok 26 - bad simple term 2
...

I bisected to the change in blead and, not surprisingly, got this result:

# first bad commit: [9a224d076a17344e9e851460223544deb2a30532] OP_PADSV_STORE: only in void context
9a224d076a17344e9e851460223544deb2a30532 is the first bad commit
commit 9a224d076a17344e9e851460223544deb2a30532
Author: David Mitchell <[email protected]>
Date:   Wed Jun 19 16:20:53 2024 +0100
Commit:     David Mitchell <[email protected]>
CommitDate: Wed Jun 19 12:44:13 2024

    OP_PADSV_STORE: only in void context

    (The original commit, v5.39.6-108-gc90e7ed39e, was reverted by
    v5.39.8-35-gdc524b6cbd, and is now being re-applied. Originally it broke
    some CPAN distributions and as it was near code-freeze time and was only
    an optimisation, it seemed better to leave it for later. Since we're now
    early in the cycle of 5.41.x, there's more time to fix up any fallout.)
...

Here is one possible approach:

  • We expect a development release of perl-5.41.1 within the next few days. Many CPANtesters rigs are set up so as to listen for new dev releases and then begin testing a large number of CPAN distributions. You will get some FAILs against perl-5.41.1, but we (P5P) will give us an idea of the scope of any other breakage attributable to 9a224d076a. If there is such breakage, then @iabyn and others will investigate.

  • If there's not further breakage in blead, then there should be no further obstacle to your releasing DBIx-Perlish-1.08. I've eyeballed -- but not tested -- the code at https://github.com/dk/DBIx-Perlish/commit/a0cad12133ec0c2763cac112cdb412f5825d2346 and it looks okay.

Another possible approach is to do a development release to CPAN (DBIx-Perlish-1.07_001). (I always have to look up how to modify $VERSION, so don't quote me on specifics.) You could do that soon after the release of perl-5.41.1.

jkeenan avatar Jun 21 '24 16:06 jkeenan

On Thu, Jun 20, 2024 at 03:49:12PM -0700, James E Keenan wrote: I built a perl at a commit later than the one at which @iabyn committed yesterday. I was able to install Variable::Magic against that perl. This ticket mentions that DBIx-Perlish was also failing. I haven't looked into whether it is fixed yet.

I've applied new code in DBIx-Perlish that works with your latest change but I didn't release the next version 1.08 because I was a bit confused whether that would be the correct thing to do until the dust settles. So I guess the tests on 1.07 will still fail, but if you mean that releasing 1.08 is a good idea kindly ping me if/when you think the work on this opcode optimization is done

@dk, perl-5.41.1 has been released. Can you build it and test your latest work on DBIx-Perlish against it? Thanks.

jkeenan avatar Jul 02 '24 17:07 jkeenan

@jkeenan just built last blead (v5.41.1-2-g7a17d6f4a1), tested, all is fine. I also rolled out v1.08 several days ago, all seems ok so far. Thank you!

dk avatar Jul 02 '24 17:07 dk

@jkeenan just built last blead (v5.41.1-2-g7a17d6f4a1), tested, all is fine. I also rolled out v1.08 several days ago, all seems ok so far. Thank you!

Confirmed. While it is true that future reversions of reversions may pose problems for Variable::Magic and its revdeps, for now this ticket can be closed.

jkeenan avatar Jul 03 '24 00:07 jkeenan