StrawberryPerl / Perl-Dist-Strawberry

Tooling to build and package releases for Perl on Windows.
https://strawberryperl.com
Other
279 stars 48 forks source link

perl 5.36 cpan | GD fails tests #81

Closed shawnlaffan closed 1 year ago

shawnlaffan commented 1 year ago

I can replicate this locally with a 5.36 build but have not looked into which line is failing (seg faulting).

###
cpanm (App::cpanminus) 1.7043 on perl 5.036000 built for MSWin32-x64-multi-thread
Work directory is C:\spbuild\msys64/.cpanm/work/1678934616.1132
You have make C:\strawberry\c\bin\gmake.exe
You have LWP 6.68
Falling back to Archive::Tar 2.40
Searching GD on mirror https://cpan.metacpan.org ...
Downloading index file https://cpan.metacpan.org/modules/02packages.details.txt.gz ...
Unpacking GD-2.76.tar.gz
Entering GD-2.76
Checking configure dependencies from META.json
Checking if you have ExtUtils::PkgConfig 0 ... Yes (1.16)
Checking if you have ExtUtils::Constant 0.22 ... Yes (0.25)
Running Makefile.PL
--> Working on GD
Fetching https://cpan.metacpan.org/authors/id/R/RU/RURBAN/GD-2.76.tar.gz ... OK
Configuring GD-2.76 ... Notice: Type perl Makefile.PL -h for command-line option summary.

Configuring for libgd version 2.2.5.
Checking for stray libgd header files...The system cannot find the path specified.
none found.

Warning: prerequisite Test::Fork 0.02 not found.
Included Features:          GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_ZLIB GD_PNG GD_FREETYPE GD_JPEG GD_XPM GD_TIFF GD_UNCLOS
EDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33 GD2
GD library used from:       C:\strawberry\c\bin\..\lib
gdlib-config used:          gdlib-config
Checking if your kit is complete...
Looks good
Generating a gmake-style Makefile
Writing Makefile for GD
Writing MYMETA.yml and MYMETA.json
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.68)
Checking if you have Test::More 0.88 ... Yes (1.302194)
Checking if you have Math::Trig 0 ... Yes (1.23)
Checking if you have Test::Fork 0.02 ... No
Searching Test::Fork on mirror https://cpan.metacpan.org ...
Unpacking Test-Fork-0.02.tar.gz
Entering Test-Fork-0.02
Checking configure dependencies from META.yml
Checking if you have Module::Build 0.38 ... Yes (0.4232)
Checking if you have ExtUtils::Install 1.46 ... Yes (2.22)
Running Build.PL
OK
==> Found dependencies: Test::Fork
--> Working on Test::Fork
Fetching https://cpan.metacpan.org/authors/id/M/MS/MSCHWERN/Test-Fork-0.02.tar.gz ... OK
Configuring Test-Fork-0.02 ... Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Test-Fork' version '0.02'
Checking dependencies from MYMETA.json ...
Checking if you have Test::More 0.62 ... Yes (1.302194)
Checking if you have Test::Builder::Module 0.02 ... Yes (1.302194)
Checking if you have Test::Builder::Tester 1.02 ... Yes (1.302194)
OK
Building and testing Test-Fork-0.02 ... Building Test-Fork
t\failed_fork.t ..... ok
t\fork.t ............ ok
t\fork_ok_return.t .. ok
All tests successful.
Files=3, Tests=17,  1 wallclock secs ( 0.02 usr +  0.03 sys =  0.05 CPU)
Result: PASS
Building Test-Fork
Installing C:\strawberry\perl\vendor\lib\Test\Fork.pm
OK
Successfully installed Test-Fork-0.02
Installing C:\strawberry\perl\site\lib\MSWin32-x64-multi-thread\.meta\Test-Fork-0.02\install.json
Installing C:\strawberry\perl\site\lib\MSWin32-x64-multi-thread\.meta\Test-Fork-0.02\MYMETA.json
Building and testing GD-2.76 ... "C:\strawberry\perl\bin\perl.exe" lib/GD/Image_pm.PL lib/GD/Image.pm
Extracting Image.pm (with variable substitutions)
cp lib/GD/Image.pm blib\lib\GD\Image.pm
cp lib/GD.pm blib\lib\GD.pm
AutoSplitting blib\lib\GD.pm (blib\lib\auto\GD)
cp lib/GD/Polygon.pm blib\lib\GD\Polygon.pm
cp lib/GD/Simple.pm blib\lib\GD\Simple.pm
cp lib/GD/Group.pm blib\lib\GD\Group.pm
cp lib/GD/Polyline.pm blib\lib\GD\Polyline.pm
Running Mkbootstrap for GD ()
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "GD.bs"
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- GD.bs blib\arch\auto\GD\GD.bs 644
"C:\strawberry\perl\bin\perl.exe" "C:\strawberry\perl\lib\ExtUtils/xsubpp"  -typemap C:\strawberry\perl\lib\ExtUtils\typ
emap -typemap C:\spbuild\msys64\.cpanm\work\1678934616.1132\GD-2.76\typemap  GD.xs > GD.xsc
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- GD.xsc GD.c
gcc -c  -I"C:\strawberry\c\bin\..\include" -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DMULTIPLICI
TY -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D__USE_MINGW_ANSI_STDIO -fwrapv -fno-strict-aliasing -mms-bitfields -Wall -Wextra -
Wformat=1 -O2   -DVERSION=\"2.76\" -DXS_VERSION=\"2.76\"  "-IC:\strawberry\perl\lib\CORE"  -DHAVE_WBMP -DHAVE_JPEG -DHAV
E_FT -DHAVE_XPM -DHAVE_GIF -DHAVE_GD2 -DHAVE_PNG -DHAVE_TIFF -DHAVE_ANIMGIF -DVERSION_33 -DHAVE_UNCLOSEDPOLY -DHAVE_FTCI
RCLE -DLIBGD_VERSION="2.2.5" GD.c
GD.c: In function 'XS_GD__Image_useFontConfig':
GD.c:5683:6: warning: unused variable 'flag' [-Wunused-variable]
 5683 |  int flag = (int)SvIV(ST(1))
      |      ^~~~
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \
     -e "Mksymlists('NAME'=>\"GD\", 'DLBASE' => 'GD', 'DL_FUNCS' => {  }, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS'
 => []);"
g++ GD.def -o blib\arch\auto\GD\GD.xs.dll -shared -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" -L"C:\straw
berry\c\x86_64-w64-mingw32\lib" -L"C:\strawberry\c\lib\gcc\x86_64-w64-mingw32\10.3.0" GD.o   "C:\strawberry\perl\lib\COR
E\libperl536.a" "C:\strawberry\c\bin\..\lib\libjpeg.a" "C:\strawberry\c\bin\..\lib\libpng.a" "C:\strawberry\c\bin\..\lib
\libfreetype.a" "C:\strawberry\c\bin\..\lib\libXpm.a" "C:\strawberry\c\bin\..\lib\libtiff.a" "C:\strawberry\c\bin\..\lib
\libz.a" "C:\strawberry\c\bin\..\lib\libiconv.a" "C:\strawberry\c\bin\..\lib\libgd.a" "C:\strawberry\c\x86_64-w64-mingw3
2\lib\libmoldname.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libu
ser32.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libwinspool.a" "C:\
strawberry\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\strawberry
\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libole32.a" "C:\strawberry\c\x86_64-w64-
mingw32\lib\liboleaut32.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\strawberry\c\x86_64-w64-mingw32\li
b\libuuid.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\
strawberry\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libversion.a" "C:\strawberry\c\x
86_64-w64-mingw32\lib\libodbc32.a" "C:\strawberry\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\strawberry\c\x86_64-w64-mi
ngw32\lib\libcomctl32.a" -Wl,--enable-auto-image-base
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 755 blib\arch\auto\GD\GD.xs.dll
"C:\strawberry\perl\bin\perl.exe" "-Iblib\arch" "-Iblib\lib" bdf_scripts/bdf2gdfont_pl.PL bdf_scripts/bdf2gdfont.pl
Extracting bdf2gdfont.pl (with variable substitutions)
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command -e cp -- bdf_scripts/bdf2gdfont.pl blib\script\bdf2gdfont.pl
pl2bat.bat blib\script\bdf2gdfont.pl
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- GD.bs blib\arch\auto\GD\GD.bs 644
"C:\strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test
_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/fork.t .................. ok
# Testing gd 2.2.5 using gd2 support.
t/GD.t ....................
Dubious, test returned 5 (wstat 1280, 0x500)
Failed 12/14 subtests
t/HSV.t ................... ok
t/Polyline.t .............. ok
Use of uninitialized value $pkg in concatenation (.) or string at C:/strawberry/perl/lib/Symbol.pm line 131.
t/transp.t ................
Dubious, test returned 5 (wstat 1280, 0x500)
Failed 11/12 subtests
t/z_kwalitee.t ............ skipped: No RELEASE_TESTING
t/z_manifest.t ............ skipped: requires a git checkout and a unix for git and diff
t/z_pod-spell-mistakes.t .. skipped: No RELEASE_TESTING
t/z_pod.t ................. skipped: No RELEASE_TESTING

Test Summary Report
-------------------
t/GD.t                  (Wstat: 1280 (exited 5) Tests: 2 Failed: 0)
  Non-zero exit status: 5
  Parse errors: Bad plan.  You planned 14 tests but ran 2.
t/transp.t              (Wstat: 1280 (exited 5) Tests: 1 Failed: 0)>> storing results via Storable to 'C:\strawberry_bui
ld\debug\mod_install_GD_1678934615.list.nstore.txt'
>> storing results via Data::Dumper to 'C:\strawberry_build\debug\mod_install_GD_1678934615.list.nstore.txt'
>> FAILUE [exit_code=256]

  Non-zero exit status: 5
  Parse errors: Bad plan.  You planned 12 tests but ran 1.
Files=9, Tests=25,  2 wallclock secs ( 0.09 usr +  0.03 sys =  0.12 CPU)
Result: FAIL
Failed 2/9 test programs. 0/25 subtests failed.
gmake: *** [makefile:1138: test_dynamic] Error 255
! Installing GD failed. See C:\spbuild\msys64\.cpanm\work\1678934616.1132\build.log for details. Retry with --force to f
orce install it.
shawnlaffan commented 1 year ago

This looks like it could be a clash between winlibs libraries and those compiled using the extlibs repo.

We need to subset the winlibs directory tree (e.g. #57).

shawnlaffan commented 1 year ago

If it helps, running the test under gdb gives this backtrace:

(gdb) set args t\GD.t
(gdb) run
Starting program: c:\strawberry\perl\bin\perl.exe t\GD.t
[New Thread 28272.0x56a0]
[New Thread 28272.0x4efc]
[New Thread 28272.0x6578]
1..14
ok 1 - use GD;
ok 2 - use GD::Simple;
# Testing gd 2.2.5 using gd2 support.

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff903c43aba in ntdll!TpWorkOnBehalfClearTicket () from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0  0x00007ff903c43aba in ntdll!TpWorkOnBehalfClearTicket () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff903c318d4 in ntdll!RtlEnterCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff903c316c2 in ntdll!RtlEnterCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x00007ff901357e31 in ucrtbase!fgetc () from C:\WINDOWS\System32\ucrtbase.dll
#4  0x00007ff8e4e6e85a in ?? () from c:\strawberry\c\bin\libgd-3__.dll
#5  0x00007ff8e4e6eac0 in ?? () from c:\strawberry\c\bin\libgd-3__.dll
#6  0x00007ff8e4e6ef7c in ?? () from c:\strawberry\c\bin\libgd-3__.dll
#7  0x00007ff8c6c53974 in ?? ()
   from C:\Users\user\.cpanm\work\1681894380.24240\GD-2.76\blib\arch\auto\GD\GD.xs.dll
#8  0x00007ff8a73268f2 in perl536!Perl_clear_defarray () from c:\strawberry\perl\bin\perl536.dll
#9  0x00007ff8a73790a2 in perl536!Perl_runops_standard () from c:\strawberry\perl\bin\perl536.dll
#10 0x00007ff8a73372a8 in perl_run () from c:\strawberry\perl\bin\perl536.dll
#11 0x00007ff8a73885f0 in perl536!RunPerl () from c:\strawberry\perl\bin\perl536.dll
#12 0x00007ff7999d142a in ?? ()
#13 0x00007ff7999d113d in ?? ()
#14 0x00007ff902f226bd in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#15 0x00007ff903c6a9f8 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#16 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
shawnlaffan commented 1 year ago

Updating GD to 2.3.2 (with the MSYS2 patches) makes this problem disappear.

I'll close the issue when the respective repos have been updated.

shawnlaffan commented 1 year ago

Updates have been applied, closing.