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

Mystery: Deep recursion on anonymous subroutine at /usr/local/share/perl/5.36.0/DBIx/Class/Candy.pm line 255 #150

Open
PaulGWebster opened this issue Dec 5, 2024 · 3 comments

Comments

@PaulGWebster
Copy link

PaulGWebster commented Dec 5, 2024

Good day!

I stumbled across a bit of an oddity probably not a bug, but even so thought I would ask if anyone had any idea what was going on.

I have a pretty normal Mojo OpenAPI service:

image

And I use perlcritic with the community theme: https://metacpan.org/pod/Perl::Critic::Community with a severity rating if 2.

I noticed that for whatever reason I am getting the following warning:

image

So I thought to get more info I would call perlcritic directly (my theme and severity are set via ~/.perlcriticrc so the same settings as vscode is using):

`
paulwebster@PAUL-PC-RGB:~/work/shiny-octo-tribble/components/mojo-core$ perlcritic main.pl

main.pl source OK
`

Can realistically see no reason why this warning is being raised, anyone able to fill me in on what I missed :)

@bscan
Copy link
Owner

bscan commented Dec 5, 2024

Hi @PaulGWebster, I can take a look as well, but I wanted to note that this is not a perlcritic issue. All critic issues are prefixed by Critic: in the diagnostic. This is coming directly from the perl compiler itself as a warning and therefore prefixed as Syntax:. If you run "perl -c" on this file, does it also produce the warning?

@PaulGWebster
Copy link
Author

PaulGWebster commented Dec 5, 2024

Hey @bscan great work on the VSCode plugin, very helpful!

To answer your question, no for the script and no for the module:

paulwebster@PAUL-PC-RGB:~/work/shiny-octo-tribble/components/mojo-core$ perl -c /usr/local/share/perl/5.36.0/DBIx/Class/Candy.pm
Name "DBIx::Class::Candy::Exports::methods" used only once: possible typo at /usr/local/share/perl/5.36.0/DBIx/Class/Candy.pm line 141.
Name "DBIx::Class::Candy::Exports::aliases" used only once: possible typo at /usr/local/share/perl/5.36.0/DBIx/Class/Candy.pm line 138.
/usr/local/share/perl/5.36.0/DBIx/Class/Candy.pm syntax OK
paulwebster@PAUL-PC-RGB:~/work/shiny-octo-tribble/components/mojo-core$ perl -c main.pl 
main.pl syntax OK
paulwebster@PAUL-PC-RGB:~/work/shiny-octo-tribble/components/mojo-core$ 

@bscan
Copy link
Owner

bscan commented Dec 6, 2024

Hi @PaulGWebster, I'm getting a bit stuck on this one. I installed those dependencies on my machine and I am not able to reproduce the error. Perhaps one of your local dependencies is doing something? If you can keep removing dependencies until you isolate the issue, that could be helpful. For example, if a file contains only use DBIx::Class::Candy, does it trigger?

Another possibility is the symbol table inspection is throwing an error or somehow interacting with DBIx::Class::Candy. One of the ways that the Navigator finds symbol information is by compiling the file and then walking through the symbol table and through class hierarchies introspecting things leftover after compilation. If you check the Perl Navigator logs (see this comment for details if needed: #147 (comment) ), you should be able to rerun the perl -c navigator command and see if it reproduces the error. It'll be something like this, where the Inquisitor does the inspection at the end of compilation.

Starting perl compilation check with the equivalent of: /home/brian/perl5/perlbrew/perls/perl-5.38.0/bin/perl -c -I /home/brian/.vscode-server/extensions/bscan.perlnavigator-0.8.15/server/src/perl -MInquisitor /tmp/test.pl

The output will be fairly large, so you may need to pipe it to a file first and then see if the warning shows up. Thanks!

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

2 participants