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

Printing a Unicode surrogate code point fails with LTA error or segfault in Rakudo #3757

Closed
p6rt opened this issue Mar 26, 2015 · 3 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Mar 26, 2015

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

Searchable as RT124185$

@p6rt
Copy link
Author

p6rt commented Mar 26, 2015

From @smls

Trying to print a Unicode codepoint like 55296 can fail with multiple different failure modes, none of which are very helpful, and at least one of which (segfaullt) is a bug​:

$ perl6 -e 'say 55296.chr'
Iteration past end of grapheme iterator
  in method print at src/gen/m-CORE.setting​:17885
  in sub say at src/gen/m-CORE.setting​:18644
  in block <unit> at -e​:1

$ perl6 -e 'say "A" ~ 55296.chr'
Error encoding UTF-8 string near grapheme position 0 with codepoint 65
  in method print at src/gen/m-CORE.setting​:17885
  in sub say at src/gen/m-CORE.setting​:18644
  in block <unit> at -e​:1

$ perl6 -e 'say "A", 55296.chr'
A/home/smls/.rakudobrew/bin/perl6​: line 2​: 20876 Segmentation fault (core dumped) ...

Discussion​:

moritz​: well, it could die with "Illegal codepoint"
moritz​: or something like that
moritz​: but everything else is either a bug, or an LTA error (which is also a bug, IMHO)

TimToady​: m​: say uniname(55296)
camelia​: rakudo-moar 9210cc​: OUTPUT«<Non Private Use High Surrogate>␤»

smls​: Does that mean it should print "Invalid code point?" for that
TimToady​: maybe more "No true codepoint would ever be a surrogate!"

@p6rt
Copy link
Author

p6rt commented Apr 6, 2015

From @FROGGS

$ perl6 -e 'say "A", 55296.chr'
AError encoding UTF-8 string near grapheme position 0 with codepoint 55296
in method print at src/gen/m-CORE.setting​:17967
in sub say at src/gen/m-CORE.setting​:18731
in block <unit> at -e​:1

Patch​: MoarVM/MoarVM@0acf845fcb
Testing it seems problematic because it would invalidate the TAP output.

@p6rt p6rt closed this as completed Apr 6, 2015
@p6rt
Copy link
Author

p6rt commented Apr 6, 2015

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

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

No branches or pull requests

1 participant