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

t/ops.t fail on 64-bit Strawberry Perl #75

Merged
merged 2 commits into from Mar 15, 2015
Merged

t/ops.t fail on 64-bit Strawberry Perl #75

merged 2 commits into from Mar 15, 2015

Conversation

mohawk2
Copy link
Member

@mohawk2 mohawk2 commented Mar 15, 2015

This snippet:

$INT_MAX=2147483647;
cmp_ok indx($INT_MAX*4)%2, '==', 0, 'big indx modulus';
cmp_ok double($INT_MAX*4)%2, '==', 0, 'big double modulus';

It passes on my 64-bit Linux Perl 5.20.1, but on my 64-bit Strawberry Perl 5.20.0 gives these results:

#   Failed test 'big indx modulus'
#   at t/ops.t line 165.
#          got: 8589934592
#     expected: 0

#   Failed test 'big double modulus'
#   at t/ops.t line 168.
#          got: 12884901884
#     expected: 0

@mohawk2
Copy link
Member Author

mohawk2 commented Mar 15, 2015

To add to this, the indx number got is 0x200000000, while the double one is 0x2fffffffc.

@mohawk2
Copy link
Member Author

mohawk2 commented Mar 15, 2015

The relevant-looking bit of Strawberry Perl's -V is:

    intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8
    alignbytes=8, prototype=define

While my Linux one is:

    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define

So the differences are:

Name Linux Strawberry
longsize 8 4
longdblsize 16 12
ivtype long long long
Off_t off_t long long

Of those, it seems likely the first 3 are relevant and may dictate how to change the test so it is meaningful.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 49.01% when pulling 0fc1c2b on intmaxfix into 27764a1 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 49.01% when pulling 5cbd281 on intmaxfix into 27764a1 on master.

@zmughal zmughal added this to the PDL v2.009 milestone Mar 15, 2015
@wchristian
Copy link
Member

Observation on windows:

strawberry-perl-5.20.2.1-32bit-portable
strawberry-perl-5.20.2.1-64bit-portable

both tests fail for both of these distros

strawberry-perl-no64-5.20.2.1-32bit-portable

only big double modulus fails, ok 50 - big indx modulus passes

@mohawk2
Copy link
Member Author

mohawk2 commented Mar 15, 2015

@wchristian, that's valuable.

Other findings, using this snippet:

perl MPDL::Version -MPDL::LiteF -MTest::More=tests,1 -e "cmp_ok indx(2147483647*4)%2, '==', 0, 'big indx %';diag qq{'$PDL::Version::VERSION'\n}"

Gives the same failure on ActivePerl 5.18.1 with PDL 2.007 as with my Strawberry setup as above, so @devel-chm's report of @sisyphus's findings are corroborated. I'm going to TODO it per @devel-chm suggestion.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 49.01% when pulling fb9880b on intmaxfix into 27764a1 on master.

@zmughal
Copy link
Member

zmughal commented Mar 15, 2015

Looks good. We should merge per @devel-chm's rec to make this a TODO at http://thread.gmane.org/gmane.comp.lang.perl.pdl.devel/6373/focus=6374.

I think I know of a fix, but that can be done later.

@mohawk2 mohawk2 merged commit fb9880b into master Mar 15, 2015
@mohawk2 mohawk2 deleted the intmaxfix branch March 15, 2015 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants