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

Unhealthy overflow in .head and .tail with huge negative numbers ( (4,5,6).tail(-9999999999999999999) ) #5867

Closed
p6rt opened this issue Dec 7, 2016 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Dec 7, 2016

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

Searchable as RT130285$

@p6rt
Copy link
Author

p6rt commented Dec 7, 2016

From @AlexDaniel

Code​:
say (4,5,6).tail(-9999999999999999999)

Result HEAD​:
MoarVM panic​: Memory allocation failed; could not allocate 12233720368547758088 bytes

Result (2016.09)​:
()

Code​:
say (4,5,6).head(-9999999999999999999)

Result HEAD​:
(4 5 6)

Result (2016.09)​:
()

Bisectable points to these commits​:
* rakudo/rakudo@a3406cb
* rakudo/rakudo@6996512

@p6rt
Copy link
Author

p6rt commented Jan 18, 2017

From @lizmat

Fixed with 93b0ffae5292791bf14b0d

@p6rt
Copy link
Author

p6rt commented Jul 22, 2017

From @lizmat

I’m inclined to WONTFIX, as other, much more common, indexing operation suffer from the same issue​:

$ 6 'my @​a; say @​a[9999999999999999999]'
Cannot unbox 64 bit wide bigint into native integer

$ 6 'my @​a[9999999999999999999]'
Illegal dimension in shape​: 9999999999999999999. All dimensions must be integers bigger than 0

etc etc etc.

On 7 Dec 2016, at 01​:37, Aleks-Daniel Jakimenko-Aleksejev (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev
# Please include the string​: [perl #​130285]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=130285 >

Code​:
say (4,5,6).tail(-9999999999999999999)

Result HEAD​:
MoarVM panic​: Memory allocation failed; could not allocate 12233720368547758088 bytes

Result (2016.09)​:
()

Code​:
say (4,5,6).head(-9999999999999999999)

Result HEAD​:
(4 5 6)

Result (2016.09)​:
()

Bisectable points to these commits​:
* rakudo/rakudo@a3406cb
* rakudo/rakudo@6996512

@p6rt
Copy link
Author

p6rt commented Jul 22, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 22, 2017

From @AlexDaniel

  I'm not sure if this is closable. The regression is no longer there, so I'll remove the tag, but here's a problem​:
 
  Code​:
  say (4,5,6).tail(-2**63+4)
 
  Result​:
  ()
 
 
  Code​:
  say (4,5,6,7).tail(-2**63+4)
 
  Result​:
  Cannot unbox 64 bit wide bigint into native integer
    in block <unit> at -e line 1
 
 
  It feels like something is wrong? I am not sure.
 
 
  On 2017-07-22 12​:44​:53, elizabeth wrote​:
  > I’m inclined to WONTFIX, as other, much more common, indexing
  > operation suffer from the same issue​:
  >
  > $ 6 'my @​a; say @​a[9999999999999999999]'
  > Cannot unbox 64 bit wide bigint into native integer
  >
  > $ 6 'my @​a[9999999999999999999]'
  > Illegal dimension in shape​: 9999999999999999999. All dimensions must
  > be integers bigger than 0
  >
  > etc etc etc.
  >
  > > On 7 Dec 2016, at 01​:37, Aleks-Daniel Jakimenko-Aleksejev (via RT)
  > > <perl6-bugs-followup@​perl.org> wrote​:
  > >
  > > # New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev
  > > # Please include the string​: [perl #​130285]
  > > # in the subject line of all future correspondence about this issue.
  > > # <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=130285 >
  > >
  > >
  > > Code​:
  > > say (4,5,6).tail(-9999999999999999999)
  > >
  > > Result HEAD​:
  > > MoarVM panic​: Memory allocation failed; could not allocate
  > > 12233720368547758088 bytes
  > >
  > > Result (2016.09)​:
  > > ()
  > >
  > >
  > > Code​:
  > > say (4,5,6).head(-9999999999999999999)
  > >
  > > Result HEAD​:
  > > (4 5 6)
  > >
  > > Result (2016.09)​:
  > > ()
  > >
  > >
  > > Bisectable points to these commits​:
  > > *
  > > rakudo/rakudo@a3406cb
  > > *
  > > rakudo/rakudo@6996512
 
 
   

@p6rt
Copy link
Author

p6rt commented Oct 15, 2017

From @zoffixznet

lizmat++ fixed in rakudo/rakudo@43e7b893b1
Tests​: Raku/roast@76ed46049a

@p6rt p6rt closed this as completed Oct 15, 2017
@p6rt
Copy link
Author

p6rt commented Oct 15, 2017

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

@p6rt
Copy link
Author

p6rt commented Oct 15, 2017

From @zoffixznet

Additional tests for .head​: Raku/roast@dc7447626b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant