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

Use of uninitialized value $cb in method lookup at Mojo/Reactor/Poll.pm #2128

Open
e477 opened this issue Nov 13, 2023 · 1 comment
Open

Comments

@e477
Copy link

e477 commented Nov 13, 2023

  • Mojolicious version: 9.34
  • Perl version: 5.38.0
  • Operating system: Debian Linux 12

We use the Mojo::UserAgent for our data scraper and we get lots of errors like this:

Use of uninitialized value $cb in method lookup at /usr/local/lib/perl5/Mojo/Reactor/Poll.pm line 141.
eval {...} called at /usr/local/lib/perl5/Mojo/Reactor/Poll.pm line 141
Mojo::Reactor::Poll::_try(Mojo::Reactor::EV=HASH(0x564e73e33fd8), "I/O watcher", undef, 0)
    called at /usr/local/lib/perl5/Mojo/Reactor/EV.pm line 54

Looking at the code, the docs and similar bug reports this seems to be the result of EV::io emitting two or more events in succession with the earlier event removing the handler while the callback for a later event is still pending.

Mojo/Reactor/EV.pm will catch this situation, but only for write events (line 55). For read events the check for existance of the handler is missing (line 54).

Steps to reproduce the behavior

I've yet been unable to reproduce this error in a test case.

Expected behavior

No errors.

Actual behavior

See above.

@kraih
Copy link
Member

kraih commented Nov 13, 2023

Suppose a shared check for the data structure would make sense. This has to be incredibly rare though.

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