Bug#1014295: libwx-perl-processstream-perl: FTBFS with Perl 5.36: build hangs

Niko Tyni ntyni at debian.org
Sun Jul 10 18:42:20 BST 2022


Control: reassign -1 libwx-perl 1:0.9932-6
Control: retitle -1 libxwx-perl: Wx::InputStream::READLINE returns non-string value
Control: tag -1 patch
Control: affects -1 libwx-perl-processstream-perl

(Full quote for context, see below for discussion.)

On Sun, Jul 03, 2022 at 05:29:36PM +0300, Niko Tyni wrote:
> Source: libwx-perl-processstream-perl
> Version: 0.32-1.1
> Tags: ftbfs
> User: debian-perl at lists.debian.org
> Usertags: perl-5.36-transition
> 
> This package fails to build from source with Perl 5.36 (currently in
> experimental.)
> 
> Build log at
> 
>   http://perl.debian.net/rebuild-logs/perl-5.36-throwaway/libwx-perl-processstream-perl_0.32-1.1/libwx-perl-processstream-perl_0.32-1.1_amd64-2022-06-13T09:38:04Z.build
> 
> Excerpt:
> 
>   t/00-load.t .... 
>   1..1
>   ok 1 - use Wx::Perl::ProcessStream;
>   ok
>   
>   #   Failed test at t/01-events.t line 59.
>   #          got: undef
>   #     expected: '0'
>   
>   #   Failed test at t/01-events.t line 80.
>   #          got: undef
>   #     expected: 'HELLO WORLD'
>   
>   #   Failed test at t/01-events.t line 94.
>   #          got: undef
>   #     expected: 'HELLO WORLD'
>   
>   #   Failed test at t/01-events.t line 117.
>   #          got: undef
>   #     expected: 'HELLO WORLD'
>   
>   #   Failed test at t/01-events.t line 131.
>   #          got: undef
>   #     expected: 'HELLO WORLD'
>   
>   #   Failed test at t/01-events.t line 152.
>   #          got: ''
>   #     expected: anything else
>   
>   #   Failed test at t/01-events.t line 170.
>   #          got: ''
>   #     expected: 'ONE-TWO-THREE'
>   
>   #   Failed test at t/01-events.t line 174.
>   #          got: ''
>   #     expected: 'FOUR'
>   
>   #   Failed test at t/01-events.t line 192.
>   #          got: ''
>   #     expected: 'ECHO:TEST STDIN 1-TEST STDIN 2'
>   E: Build killed with signal TERM after 150 minutes of inactivity

This seems to be a bug in libwx-perl, triggered by changes in
Perl 5.35.9 or so.

>From https://metacpan.org/dist/perl/view/pod/perldelta.pod#Internal-Changes :

  Reading the string form of an integer value no longer sets the flag SVf_POK. [...]

Here's a snippet that shows the changed behaviour:

   #!/usr/bin/perl -w
   use Test::More tests => 3;
   use Devel::Peek;
   
   use Inline C => <<'EOC';
     SV * myString() {
       SV *ret;
       ret = newSViv(0);
       char *buf = SvPV_nolen(ret);
       buf[0] = '1';
       return ret;
     }
   EOC
   
   my $val = myString();
   is($val, "1", "XS return value equals the string 1");
   is($val, 1, "XS return value equals numeric 1");
   ok($val, "XS return value is true");
   
   Dump $val;
   __END__

The return value is created as the integer zero, then its string buffer
is changed but the corresponding SvPOK flag is not set. This passes all
the three tests on sid / Perl 5.34 fails the last one with Perl 5.36.
The Dump output shows

-  FLAGS = (IOK,POK,pIOK,pPOK)
+  FLAGS = (IOK,pIOK,pPOK)

and explicitly declaring the variable a valid string by adding an
SvPOK_on(ret) call fixes the tests.

The above snippet was adapted from the Wx::InputStream::READLINE() method
in libwx-perl, which has the same issue. The Wx::Perl::ProcessStream
test suite tests if the return value is set, but sees it evaluate to
false and assumes an early EOF, breaking the tests.

Proposed patch attached. I've tested that it fixes the test suite with
Perl 5.36 without breaking it on sid / 5.34.
-- 
Niko Tyni   ntyni at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Explicitly-return-a-string-SV-from-Wx-InputStream-RE.patch
Type: text/x-diff
Size: 1123 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-perl-maintainers/attachments/20220710/020847cc/attachment-0003.patch>


More information about the pkg-perl-maintainers mailing list