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

REPL: Internal error: unhandled encoding (Readline) #2759

Open
cfa opened this issue Mar 10, 2019 · 6 comments
Open

REPL: Internal error: unhandled encoding (Readline) #2759

cfa opened this issue Mar 10, 2019 · 6 comments
Labels

Comments

@cfa
Copy link

cfa commented Mar 10, 2019

The Problem

Intermittent internal errors from Readline, e.g.

$ perl6
> $*ENV<RAKUDO_HIST> ?? $*ENV<RAKUDO_HIST>.IO !! ($*HOME || $*TMPDIR).add('.perl6/rakudo-history');
Internal error: unhandled encoding
  in method CALL-ME at /Users/cfa/.rakudup/2019.03/install/share/perl6/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 587
  in method readline at /Users/cfa/.rakudup/2019.03/install/share/perl6/site/sources/EBC1B2DDA59A9D91D483BD81DAA416714D2D1276 (Readline) line 1460
^D
$ perl6
$*ENV<RAKUDO_HIST> ?? $*ENV<RAKUDO_HIST>.IO !! ($*HOME || $*TMPDIR).add('.perl6/rakudo-history');
"/Users/cfa/.perl6/rakudo-history".IO

Note how the same input triggers the exception in one run but not the next. This has occurred with a variety of input and seemingly at random—though frequently enough to make the REPL nigh unusable.
Also note that errors usually occur midway through a REPL session; the above was cherrypicked for clarity.

Expected Behavior

Handled encoding!

Actual Behavior

See above.

Following a discussion in #perl6, I also tried with MVM_SPESH_DISABLE=1 and MVM_JIT_DISABLE=1; neither helped:

$ MVM_SPESH_DISABLE=1 p6
To exit type 'exit' or '^D'
> %*ENV<MVM_SPESH_DISABLE>
Internal error: unhandled encoding
  in method CALL-ME at /Users/cfa/.rakudup/2019.03/install/share/perl6/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 587
  in method readline at /Users/cfa/.rakudup/2019.03/install/share/perl6/site/sources/EBC1B2DDA59A9D91D483BD81DAA416714D2D1276 (Readline) line 1460

> %*ENV<MVM_SPESH_DISABLE>
1

and

$ MVM_JIT_DISABLE=1 p6
To exit type 'exit' or '^D'
> %*ENV<MVM_SPESH_DISABLE>
Internal error: unhandled encoding
  in method CALL-ME at /Users/cfa/.rakudup/2019.03/install/share/perl6/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 587
  in method readline at /Users/cfa/.rakudup/2019.03/install/share/perl6/site/sources/EBC1B2DDA59A9D91D483BD81DAA416714D2D1276 (Readline) line 1460

> %*ENV<MVM_JIT_DISABLE>
1
> %*ENV<MVM_SPESH_DISABLE>
(Any)

(Again, quite a few runs were required to reproduce the error at the beginning of the session.)

Environment

  • Operating system: macOS.
  • Compiler version (perl6 -v): 2019.03. Problem first noticed following upgrade from 2018.12.
@cfa
Copy link
Author

cfa commented Mar 10, 2019

@cfa
Copy link
Author

cfa commented Mar 10, 2019

Also, in case anyone else hits this error: My current workaround is the following wrapper script (p6):

#!/bin/sh

# workaround for https://github.com/rakudo/rakudo/issues/2759
RAKUDO_LINE_EDITOR='none' rlwrap perl6 "$@"

—no need to uninstall Readline or fall back on Linenoise.

@AlexDaniel AlexDaniel added the BLOCKER Preventing the next release of rakudo, or just needing attention before the release label Mar 11, 2019
@Kaiepi
Copy link
Contributor

Kaiepi commented Jun 8, 2019

I thought this was an OpenBSD exclusive thing since it uses its own version of Readline... huh.
Times like this are when it'd be nice to have wchar_t support so Editline can be used instead of Readline in cases like this or if you just don't like the GPL.

@Kaiepi
Copy link
Contributor

Kaiepi commented Jun 22, 2019

Does this still happen? I can't get the error to appear on HEAD

@AlexDaniel
Copy link
Contributor

Ping @cfa :)

@AlexDaniel
Copy link
Contributor

I also can't reproduce. Blocker label removed.

If anybody stumbles upon this ticket in the future, just close it.

@AlexDaniel AlexDaniel removed the BLOCKER Preventing the next release of rakudo, or just needing attention before the release label Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants