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

Broken math (-2147483648 != -2147483648) #6514

Closed
p6rt opened this issue Sep 14, 2017 · 5 comments
Closed

Broken math (-2147483648 != -2147483648) #6514

p6rt opened this issue Sep 14, 2017 · 5 comments
Labels
regression Issue did not exist previously testneeded

Comments

@p6rt
Copy link

p6rt commented Sep 14, 2017

Migrated from rt.perl.org#132083 (status was 'resolved')

Searchable as RT132083$

@p6rt
Copy link
Author

p6rt commented Sep 14, 2017

From @AlexDaniel

Two tests in Data​::MessagePack started to fail​:

Test Summary Report


t/202-unpack-int.t (Wstat​: 256 Tests​: 40 Failed​: 1)
  Failed test​: 35
  Non-zero exit status​: 1
t/302-stream-unpack-int.t (Wstat​: 256 Tests​: 23 Failed​: 1)
  Failed test​: 21
  Non-zero exit status​: 1

MessagePack​::Class depends on Data​::MessagePack and therefore is not installable also.

Committable output for 202-unpack-int.t on 2017.08 and HEAD​: https://gist.github.com/50eab41e808e812c7d555f45272dc2a5

Bisectable points at rakudo/rakudo@9b42484

Module repo​: https://github.com/pierre-vigier/Perl6-Data-MessagePack

It could very well be that it is not a regression, but that the module was relying on buggy behavior. I think having a ticket is reasonable until we get a better answer. Any info is welcome.

@p6rt
Copy link
Author

p6rt commented Sep 16, 2017

From @AlexDaniel

This is definitely an issue in MoarVM, and it existed since 2014.02 but for some reason it was unnoticeable before recent changes.

Code​:
my $value = -0x7FFFFFFF - 1;
say $value;
say -2147483648;
say $value == -2147483648;

Result (MoarVM)​:
-2147483648
-2147483648
False

Result (JVM)​:
-2147483648
-2147483648
True

Maybe this can help​:
Code​:
my $value = -0x7FFFFFFF - 1;
say $value;
say $value == -18446744071562067968

Result (MoarVM)​:
-2147483648
True

On 2017-09-13 19​:49​:24, alex.jakimenko@​gmail.com wrote​:

Two tests in Data​::MessagePack started to fail​:

Test Summary Report
-------------------
t/202-unpack-int.t (Wstat​: 256 Tests​: 40 Failed​: 1)
Failed test​: 35
Non-zero exit status​: 1
t/302-stream-unpack-int.t (Wstat​: 256 Tests​: 23 Failed​: 1)
Failed test​: 21
Non-zero exit status​: 1

MessagePack​::Class depends on Data​::MessagePack and therefore is not
installable also.

Committable output for 202-unpack-int.t on 2017.08 and HEAD​:
https://gist.github.com/50eab41e808e812c7d555f45272dc2a5

Bisectable points at
rakudo/rakudo@9b42484

Module repo​: https://github.com/pierre-vigier/Perl6-Data-MessagePack

It could very well be that it is not a regression, but that the module
was relying on buggy behavior. I think having a ticket is reasonable
until we get a better answer. Any info is welcome.

@p6rt
Copy link
Author

p6rt commented Sep 16, 2017

From @AlexDaniel

The issue seems to be resolved in MoarVM/MoarVM@9c5fed7

Tests needed.

When adding tests for this, please cover this case also​:
say (-0x7FFFFFFF - 1).base(16) # should probably be -80000000 but it erroneously gives -FFFFFFFF80000000

On 2017-09-16 10​:46​:51, alex.jakimenko@​gmail.com wrote​:

This is definitely an issue in MoarVM, and it existed since 2014.02
but for
some reason it was unnoticeable before recent changes.

Code​:
my $value = -0x7FFFFFFF - 1;
say $value;
say -2147483648;
say $value == -2147483648;

Result (MoarVM)​:
-2147483648
-2147483648
False

Result (JVM)​:
-2147483648
-2147483648
True

Maybe this can help​:
Code​:
my $value = -0x7FFFFFFF - 1;
say $value;
say $value == -18446744071562067968

Result (MoarVM)​:
-2147483648
True

On 2017-09-13 19​:49​:24, alex.jakimenko@​gmail.com wrote​:

Two tests in Data​::MessagePack started to fail​:

Test Summary Report
-------------------
t/202-unpack-int.t (Wstat​: 256 Tests​: 40 Failed​: 1)
Failed test​: 35
Non-zero exit status​: 1
t/302-stream-unpack-int.t (Wstat​: 256 Tests​: 23 Failed​: 1)
Failed test​: 21
Non-zero exit status​: 1

MessagePack​::Class depends on Data​::MessagePack and therefore is not
installable also.

Committable output for 202-unpack-int.t on 2017.08 and HEAD​:
https://gist.github.com/50eab41e808e812c7d555f45272dc2a5

Bisectable points at

rakudo/rakudo@9b42484

Module repo​: https://github.com/pierre-vigier/Perl6-Data-MessagePack

It could very well be that it is not a regression, but that the
module
was relying on buggy behavior. I think having a ticket is reasonable
until we get a better answer. Any info is welcome.

@p6rt
Copy link
Author

p6rt commented Oct 8, 2017

From @zoffixznet

Tests in Raku/roast#345

@p6rt
Copy link
Author

p6rt commented Oct 8, 2017

@zoffixznet - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Oct 8, 2017
@p6rt p6rt added regression Issue did not exist previously testneeded labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Issue did not exist previously testneeded
Projects
None yet
Development

No branches or pull requests

1 participant