pkulchenko/MobDebug

[Question] Why MobDebug is incompatible with OpenResty's cosocket

Closed this issue · 1 comments

When I try to migrate MobDebug to OpenResty's cosocket, I found that it doesn't work. The error log told me that it "attempt to yield across c-call boundary". But using LuaSocket like official guide said, it works well. So what's the problem with cosocket running MobDebug?

I don't think it's a problem with mobdebug per se. It looks like in a "normal" debugging scenario, mobdebug yields from the debugger loop when there is a timeout from a socket, but in the case of openresty, it resumes from the actual luasocket call (hence it needs a modified library), so when mobdebug attempts to yield in this case, you get the error you see.

I've tried to make it work with these libraries, but I couldn't come up with a way to make it work without rewriting the model that mobdebug is built based on (which would make it incompatible with other engines). This is the reason why mobdebug relies on the "original" socket code.