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
Infinite loop in dispatch in many Cool methods #6113
Comments
From tim.bollman@live.comIf you pass an undefined value into starts-with, it loops forever because the Cool class has a wrapper method that casts the parameters to Str then invokes that. The Str class, however, defines the method as only taking a defined string. So it matches the Cool method again. Repeat. Changing the cool variant to only take a defined value causes it to die with an error message which is infinitely better: multi method starts-with(Cool:D: Str(Cool:D) $needle). Or you could make a Str variant that returns some stock value. I don't really know nor care what the intended behavior is as long as it doesn't loop infinitely. From what I've seen in languages I have installed, the majority give an exception or otherwise crash and perl5 obviously treats it as the empty string. I presume there's a whole category of these in the Cool class that need the same treatment (like ends-with and contains). |
From @zoffixznetOn Mon, 06 Mar 2017 12:51:12 -0800, TimTom wrote:
yes, there's a whole ton of them. All of these hang: I see a bunch more too and this isn't the first time we're fixing a Cool dispatch hang, For methods that just coerce to another type and forward the args, the fix is moving the |
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetOn Mon, 06 Mar 2017 12:51:12 -0800, TimTom wrote:
Thank you for the report. This is now fixed. Fix: rakudo/rakudo@bfbe4298a7 |
@zoffixznet - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#130940 (status was 'resolved')
Searchable as RT130940$
The text was updated successfully, but these errors were encountered: