Closed 0-wiz-0 closed 3 years ago
I found the command line lsp-mode uses:
perl -MPerl::LanguageServer -e Perl::LanguageServer::run -- --port 32443 --version 2.1.0
That produces a core dump like above.
I hadn't mentioned bfore: I use Compiler-Lexer-0.23. I see no relevant diffs to the copy included in the Perl-LanguageServer distribution on cpan.
Which OS and which Perl Version you are using?
You can try out this small script to parse a file:
use ExtUtils::testlib ;
use lib ('lib') ;
use Perl::LanguageServer::Parser ;
use Data::Dump qw{dump} ;
my $filename = $ARGV[0];
open(my $fh, "<", $filename) or die("Cannot open $filename: $!");
my $script = do { local $/; <$fh> };
my ($vars, $tokens) = Perl::LanguageServer::Parser -> parse_perl_source ($filename, $script) ;
print dump ($tokens), "\n" ;
print dump ($vars), "\n" ;
I'm running on NetBSD/amd64/9.99.67. Perl is, in general, running very well on NetBSD. The perl version is 5.30.3. The script you pasted seems to work fine, it produces output without a core dump.
I guess this is an issue with Coro or AnyEvent. Since I am not using NetBSD I have no idea what's wrong. The command line your using should never core dump, but just wait for input. You can run it with --debug i.e.
perl -MPerl::LanguageServer -e Perl::LanguageServer::run --debug
Maybe this give a hint were it crashs. Anyway, maybe you can find some known issues for Coro or AnyEvent on NetBSD.
Thanks for the suggestion. AnyEvent seems to work fine, but Coro does not run its self tests successfully: https://rt.cpan.org/Public/Bug/Display.html?id=133270 I hope that fixing that will fix the issue here.
The problem was in libpthread via Coro. The pkgsrc package has a bugfix. https://github.com/NetBSD/pkgsrc/blob/trunk/devel/p5-Coro/patches/patch-Coro_libcoro_coro.c
Hi!
I've just packaged Perl-LanguageServer for pkgsrc and wanted to try it out with emacs/lsp-mode. That didn't work:
so I looked over the bug reports and found this example usage:
when I try this, I get a perl core dump:
An example from another bug report does work:
gives me a long dump.
Any ideas how to debug this?