Camelcade/Devel-Camelcadedb

Debugger hangs when hitting template withcall to a method of stashed object

hurricup opened this issue · 1 comments

by @sseide:
I have come acros a bug where the debugger or perl server hangs and must be killed eventually.

It is an mojolicious project, where i stash an Moose Object in the controller for later rendering.
Within the EP template a method of this object is called. This seems to trigger some bug in the mojolicious server or debugger part - the HTTP call never returns to the browser.

Starting the project via "run" from intellij everything works fine. Starting in Debug mode everything works too and i can debug as long as i do not hit an EP template where an method of an object stashed is called.

Attached is an simple mojolicious project where i am able to reprocduce the problem everytime.
Setting an breakpoint in Site::Homepage method simple_template() works as expected,
Calling method template_calling_method() via route /fails hits the bug.

debugger-test.zip

Another remark - in my real Project i see an endless stream of the following messages in the console when hitting such a template - but have not seen them in this test project. Maybe it is another problem...

Mojo::Reactor::EV: I/O watcher failed: Can't locate object method "" via package "Mojo::Reactor::EV" at /home/user/workspaces/workspace/website/script/../perl5/lib/perl5/Mojo/Reactor/Poll.pm line 143.

Use of uninitialized value $cb in method lookup at /home/user/workspaces/workspace/website/script/../perl5/lib/perl5/Mojo/Reactor/Poll.pm line 143.

Linux x64 Debian Jessie
Intellij 2016.1.2
Perl Camelcade Plugin 2.001
Devel-Camelcadedb-1.6.1.1

Perl (v5.20.2, linux - Debian default)
Mojolicious (6.61, Clinking Beer Mugs)
EV 4.0+ (4.22)
IO::Socket::Socks 0.64+ (0.68)
IO::Socket::SSL 1.94+ (2.002)
Net::DNS::Native 0.15+ (n/a)
Moose-2.1802

Console output where debugger hangs (first call to url /ok is fine, second call to url /fails hangs.

Listening on localhost:42690...
/usr/bin/perl -d:Camelcadedb /home/user/workspaces/workspace/debug-test/testserver.pl daemon
Connected
(1)Connecting to the IDE from process 23891 at localhost:42690...
Connected.
Use of uninitialized value $real_path in substitution (s///) at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 1278, line 2125.
Use of uninitialized value $real_path in hash element at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 1011, line 2125.
Use of uninitialized value $real_path in hash element at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 1028, line 2125.
Use of uninitialized value $real_path in hash element at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 1035, line 2125.
[Sat May 28 20:22:48 2016] [info] Listening at "http://*:3000"
[Sat May 28 20:22:55 2016] [debug] GET "/ok"
[Sat May 28 20:22:56 2016] [debug] Routing to controller "Site::Homepage" and action "simple_template"
Use of uninitialized value $real_path in pattern match (m//) at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 197, line 2125.
[Sat May 28 20:22:58 2016] [debug] Rendering template "homepage/simple_template.html.ep"
[Sat May 28 20:22:58 2016] [debug] 200 OK (2.664365s, 0.375/s)
[Sat May 28 20:23:07 2016] [debug] GET "/fails"
[Sat May 28 20:23:07 2016] [debug] Routing to controller "Site::Homepage" and action "template_calling_method"
[Sat May 28 20:23:07 2016] [debug] Rendering template "homepage/template_calling_method.html.ep"
Use of uninitialized value $real_path in substitution (s///) at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 1278, line 3.
Use of uninitialized value $real_path in hash element at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 1011, line 3.
Use of uninitialized value $real_path in pattern match (m//) at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 197, line 3.
Use of uninitialized value $real_path in substitution (s///) at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 1278, line 3.
Use of uninitialized value $real_path in hash element at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 1011, line 3.
Use of uninitialized value $real_path in pattern match (m//) at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 197, line 3.
Use of uninitialized value $real_path in pattern match (m//) at /home/user/workspaces/workspace/perl5/lib/perl5/Devel/Camelcadedb.pm line 197, line 3.

Ok. This will be interesting task, because I'm not familiar with Mojo :)

  1. When i start project, both breakpoints works fine: http://joxi.net/n2Y8bylFj9vzKm.png
  2. Are you sure that server is not working with threads/forks?
  3. Would be really nice to be able to communicate via skype or smth, mine is hurricup