Skip Menu |

This queue is for tickets about the GD CPAN distribution.

Report information
The Basics
Id: 130045
Status: open
Priority: 0/
Queue: GD

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: --options to Makefile.PL completely ignored, leading to broken .so and OOMing tests
Thanks to the state of affairs with pkg-config, relying on pkg-config just breaks things!

If you've locally compiled gd without many of the image libraries:

gdlib-config --features
gdlib-config: warning: this script is deprecated; please use the pkg-config file instead.
GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_ZLIB GD_FREETYPE GD_FONTCONFIG GD_XPM GD_TIFF

And, defensively, try to build GD with a similarly restrictive set of options:

/usr/bin/perl Makefile.PL --options 'VERSION_33,GD_UNCLOSEDPOLY,GD_FTCIRCLE'


Makefile.PL instead just gives you the finger and gives you a hard-coded list of features! ....

/usr/bin/perl Makefile.PL --options 'VERSION_33,GD_UNCLOSEDPOLY,GD_FTCIRCLE'
Configuring for libgd version 2.2.5.
Included Features:          GD_GIF GD_OPENPOLYGON GD_ZLIB GD_PNG GD_FREETYPE GD_FONTCONFIG GD_JPEG GD_XPM GD_TIFF GD_WEBP GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33
gdlib-config used from the PATH

Unsurprisingly, this list directly corresponds with the string defined here:

https://metacpan.org/source/RURBAN/GD-2.71/Makefile.PL#L458

Extended with the string defined here:

https://metacpan.org/source/RURBAN/GD-2.71/Makefile.PL#L491

Which is basically ignoring the actual features supported by the installed gd implementation.

This unsurprsingly leads to a broken compilation of GD ( which, amusingly, compiles and links just fine )


Only to shit the bed later in tests:

t/fork.t .................. Can't load '/home/kent/.cpanm/work/1562826265.13873/GD-2.71/blib/arch/auto/GD/GD.so' for module GD: /home/kent/.cpanm/work/1562826265.13873/GD-2.71/blib/arch/auto/GD/GD.so: undefined symbol: gdImageCreateFromJpegCtx at /usr/lib64/perl5/5.30.0/x86_64-linux/DynaLoader.pm line 193.
 at /home/kent/.cpanm/work/1562826265.13873/GD-2.71/blib/lib/GD/Simple.pm line 160.
Compilation failed in require at /home/kent/.cpanm/work/1562826265.13873/GD-2.71/blib/lib/GD/Simple.pm line 160.
BEGIN failed--compilation aborted at /home/kent/.cpanm/work/1562826265.13873/GD-2.71/blib/lib/GD/Simple.pm line 160.
Compilation failed in require at t/fork.t line 3.
BEGIN failed--compilation aborted at t/fork.t line 3.
t/fork.t .................. Dubious, test returned 2 (wstat 512, 0x200)

And shortly thereafter killing your computer with an OOM + Swaprush in t/GD.t:

[pid 14989] <... read resumed>"#     Tried to use 'GD::Simple'."..., 65536) = 430
[pid 14989] write(2, "#     Tried to use 'GD::Simple'."..., 430#     Tried to use 'GD::Simple'.
Show quoted text
#     Error:  Attempt to reload GD.pm aborted.
# Compilation failed in require at /home/kent/.cpanm/work/1562826265.13873/GD-2.71/t/../blib/lib/GD/Simple.pm line 160.
# BEGIN failed--compilation aborted at /home/kent/.cpanm/work/1562826265.13873/GD-2.71/t/../blib/lib/GD/Simple.pm line 160.
# Compilation failed in require at t/GD.t line 15.
# BEGIN failed--compilation aborted at t/GD.t line 15.
) = 430
[pid 14989] select(8, [3 5], NULL, NULL, NULL <unfinished ...>
[pid 14993] brk(0x56097b81a000)         = 0x56097b81a000
[pid 14993] brk(0x56097b83b000)         = 0x56097b83b000
[pid 14993] brk(0x56097b85c000)         = 0x56097b85c000
[pid 14993] brk(0x56097b87d000)         = 0x56097b87d000
[pid 14993] brk(0x56097b89e000)         = 0x56097b89e000
[pid 14993] brk(0x56097b8bf000)         = 0x56097b8bf000
[pid 14993] brk(0x56097b8e0000)         = 0x56097b8e0000
[pid 14993] brk(0x56097b901000)         = 0x56097b901000
[pid 14993] brk(0x56097b922000)         = 0x56097b922000
[pid 14993] mmap(NULL, 139264, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f19a9f98000
[pid 14993] brk(0x56097b944000)         = 0x56097b944000
[pid 14993] brk(0x56097b965000)         = 0x56097b965000
[pid 14993] brk(0x56097b986000)         = 0x56097b986000
[pid 14993] mremap(0x7f19a9f98000, 139264, 204800, MREMAP_MAYMOVE) = 0x7f19a9f66000
[pid 14993] brk(0x56097b9a7000)         = 0x56097b9a7000
[pid 14993] brk(0x56097b9c8000)         = 0x56097b9c8000
[pid 14993] brk(0x56097b9e9000)         = 0x56097b9e9000
[pid 14993] brk(0x56097ba0a000)         = 0x56097ba0a000
[pid 14993] brk(0x56097ba2d000)         = 0x56097ba2d000
[pid 14993] brk(0x56097ba4e000)         = 0x56097ba4e000
[pid 14993] mremap(0x7f19a9f66000, 204800, 307200, MREMAP_MAYMOVE) = 0x7f19a9f66000
[pid 14993] brk(0x56097ba70000)         = 0x56097ba70000
[pid 14993] brk(0x56097ba91000)         = 0x56097ba91000
[pid 14993] brk(0x56097bab2000)         = 0x56097bab2000
[pid 14993] brk(0x56097bad3000)         = 0x56097bad3000
[pid 14993] brk(0x56097baf4000)         = 0x56097baf4000



Unsurprisingly, its taken me a bit to get around to triaging this problem ....
-- 
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )
Yes, upstream is nor helpful at all. See https://github.com/lstein/Perl-GD/issues/27 An autoconf-like probe for the features is needed. If you provide the wrong options it fails. That's a limitation, not a bug. I'll check the --options handling again, what you pointed out. This could be a bug. -- Reini Urban
On 2019-07-11 21:22:24, RURBAN wrote:

Show quoted text
> An autoconf-like probe for the features is needed. If you provide the
> wrong options it fails. That's a limitation, not a bug.


As long as Makefile.PL or `make` screams about it not making sense(preferably the former), I don't mind *so* much, but only failing tests ... I mind a bit more.



-- 
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )