Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bail early and avoid warnings on 32 bit Perl builds #7

Merged
merged 1 commit into from
Apr 12, 2022

Conversation

demerphq
Copy link
Contributor

In 03d0996 the U64 class was removed
and zipdetails was made 64 bit only. This causes warnings and test
failures (t/porting/utils.t) on i386 builds of perl core when
IO-Compress 2.105 was merged.
Perl/perl5#19618
# Failed test 83 - utils/zipdetails compiles at porting/utils.t line 85
# got "Integer overflow in hexadecimal number at utils/zipdetails line 1432.
Integer overflow in hexadecimal number at utils/zipdetails line 2247.
Integer overflow in hexadecimal number at utils/zipdetails line 2248.
Integer overflow in hexadecimal number at utils/zipdetails line 2249.
Integer overflow in hexadecimal number at utils/zipdetails line 2250.
Integer overflow in hexadecimal number at utils/zipdetails line 2251.
Integer overflow in hexadecimal number at utils/zipdetails line 2252.
Integer overflow in hexadecimal number at utils/zipdetails line 2253.
Integer overflow in hexadecimal number at utils/zipdetails line 2254.
utils/zipdetails syntax OK
"
# expected "utils/zipdetails syntax OK
"
t/porting/utils .................................................. FAILED at test 83

The code also makes use of unpack "Q" so it wouldn't work on 32 bit
builds anyway.

This patch adds a check very early in the script to see if the perl supports
pack "Q", and it does not, indicating it is a 32 bit perl, then it bails out.
If the script is run under -c it bails out without a message, and otherwise
it prints out a message, and exits with error code 1.

$ ./perl -Ilib utils/zipdetails
zipdetails requires 64 bit integers, this Perl has 32 bit integers.

This alone does not make it pass t/porting/utils.t in Perl core, we need
a corresponding patch to t/porting/utils.t which I will also push.

See Perl/perl5#19618 for the corresponding patch.

In 03d0996 the U64 class was removed
and zipdetails was made 64 bit only. This causes warnings and test
failures (t/porting/utils.t) on i386 builds of perl core when
IO-Compress 2.105 was merged.

    # Failed test 83 - utils/zipdetails compiles at porting/utils.t line 85
    #      got "Integer overflow in hexadecimal number at utils/zipdetails line 1432.
    Integer overflow in hexadecimal number at utils/zipdetails line 2247.
    Integer overflow in hexadecimal number at utils/zipdetails line 2248.
    Integer overflow in hexadecimal number at utils/zipdetails line 2249.
    Integer overflow in hexadecimal number at utils/zipdetails line 2250.
    Integer overflow in hexadecimal number at utils/zipdetails line 2251.
    Integer overflow in hexadecimal number at utils/zipdetails line 2252.
    Integer overflow in hexadecimal number at utils/zipdetails line 2253.
    Integer overflow in hexadecimal number at utils/zipdetails line 2254.
    utils/zipdetails syntax OK
    "
    # expected "utils/zipdetails syntax OK
    "
    t/porting/utils .................................................. FAILED at test 83

The code also makes use of unpack "Q" so it wouldn't work on 32 bit
builds anyway.

This patch adds a check very early in the script to see if the perl supports
pack "Q", and it does not, indicating it is a 32 bit perl, then it bails out.
If the script is run under -c it bails out without a message, and otherwise
it prints out a message, and exits with error code 1.

    $ ./perl -Ilib utils/zipdetails
    zipdetails requires 64 bit integers, this Perl has 32 bit integers.

This alone does not make it pass t/porting/utils.t in Perl core, we need
a corresponding patch to t/porting/utils.t which I will also push.
@pmqs
Copy link
Owner

pmqs commented Apr 12, 2022

Thanks @demerphq

merging for now to fix the immediate issue.

gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Jun 17, 2024
We need to fix this in Perl itself, see bug #934444. Note that this worked
fine before newer zipdetails landed in Perl (pmqs/zipdetails#7).

Bug: https://bugs.gentoo.org/934444
Closes: https://bugs.gentoo.org/934443
Signed-off-by: Sam James <sam@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants