Skip to content

Windows builds built with gcc -O2 works on Win10 but fails on Win11 #20081

@kenneth-olwing

Description

@kenneth-olwing

The below was done with blead@c52f54c8521c6155984dba0a0675d3220170468b and using a standard MSI install of Strawberry Perl 5.32.1.1 as the toolchain.

Description
Building is done out-of-the box with:

cd win32
gmake -f GNUmakefile CCHOME=c:\Strawberry\c test

The build seems fine. Also, on a Win10 machine tests passes.
However, on my Win11 box the tests fails with:

Test Summary Report
-------------------
re/reg_mesg.t                                                      (Wstat: 65280 (exited 255) Tests: 339 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
re/regexp_unicode_prop.t                                           (Wstat: 65280 (exited 255) Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 1110 tests but ran 0.
re/regexp_unicode_prop_thr.t                                       (Wstat: 65280 (exited 255) Tests: 4 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 1110 tests but ran 4.
re/subst.t                                                         (Wstat: 65280 (exited 255) Tests: 236 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 278 tests but ran 236.
re/subst_wamp.t                                                    (Wstat: 65280 (exited 255) Tests: 236 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 278 tests but ran 236.
re/substT.t                                                        (Wstat: 65280 (exited 255) Tests: 236 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 278 tests but ran 236.
win32/popen.t                                                      (Wstat: 2304 (exited 9) Tests: 0 Failed: 0)
  Non-zero exit status: 9
  Parse errors: No plan found in TAP output
../dist/Safe/t/safeops.t                                           (Wstat: 65280 (exited 255) Tests: 71 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 418 tests but ran 71.
../dist/Storable/t/utf8.t                                          (Wstat: 65280 (exited 255) Tests: 5 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 6 tests but ran 5.
../ext/IPC-Open3/t/IPC-Open3.t                                     (Wstat: 0 Tests: 45 Failed: 0)
  TODO passed:   25
Files=2719, Tests=1114380, 4838 wallclock secs (72.62 usr + 112.17 sys = 184.80 CPU)
Result: FAIL
gmake: *** [GNUmakefile:1811: test] Error 9

Most of the fails are the test process simply dying. I'm at this point assuming that the root cause is the same in all cases. Running 'install' on the build produces an installed Perl as expected. The install retains the problem; see further comments for more details on examining that.

After looking around I found issue #20024. Although the toolchain I have only has gcc 8.3.0, it felt worthwhile to test it out, so retrying this with a completely clean clone but adding OPTIMIZE=-Os on the command line, the test suite runs fine. Again, see further comments for more information.

Steps to Reproduce
Hopefully anyone with Win11 can reproduce. I only have one Win11 box and so am unable to verify myself whether this particular machine is somehow culpable or if it's 'any' Win11.

Expected behavior
Working tests.

Perl configuration

Summary of my perl5 (revision 5 version 37 subversion 3) configuration:
   
  Platform:
    osname=MSWin32
    osvers=10.0.22000.856
    archname=MSWin32-x64-multi-thread
    uname=''
    config_args='undef'
    hint=recommended
    useposix=true
    d_sigaction=undef
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='gcc'
    ccflags =' -DWIN32 -DWIN64  -DPERL_TEXTMODE_SCRIPTS -DMULTIPLICITY -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D__USE_MINGW_ANSI_STDIO -fwrapv -fno-strict-aliasing -mms-bitfields'
    optimize='-O2'
    cppflags='-DWIN32'
    ccversion=''
    gccversion='8.3.0'
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='long long'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='g++'
    ldflags ='-s -L"e:\perl-win11-O2\lib\CORE" -L"c:\Strawberry\c\lib" -L"c:\Strawberry\c\x86_64-w64-mingw32\lib" -L"c:\Strawberry\c\lib\gcc\x86_64-w64-mingw32\8.3.0"'
    libpth=c:\Strawberry\c\lib c:\Strawberry\c\x86_64-w64-mingw32\lib c:\Strawberry\c\lib\gcc\x86_64-w64-mingw32\8.3.0
    libs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    perllibs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    libc=
    so=dll
    useshrplib=true
    libperl=libperl537.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs
    dlext=dll
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags='-shared -s -L"e:\perl-win11-O2\lib\CORE" -L"c:\Strawberry\c\lib" -L"c:\Strawberry\c\x86_64-w64-mingw32\lib" -L"c:\Strawberry\c\lib\gcc\x86_64-w64-mingw32\8.3.0"'

Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_TIMES
    HAVE_INTERP_INTERN
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_HASH_FUNC_SIPHASH13
    PERL_HASH_USE_SBOX32
    PERL_IMPLICIT_SYS
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_SAFE_PUTENV
    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
  Built under MSWin32
  Compiled at Aug 10 2022 23:38:33
  @INC:
    E:/perl-win11-O2/site/lib
    E:/perl-win11-O2/lib

More details to follow.

Thank you,

ken1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions