-
Notifications
You must be signed in to change notification settings - Fork 2k
Issues with subrequests in Lua 5.1.4 #54
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
Comments
On Fri, Aug 26, 2011 at 7:36 PM, simpl
Can you provide a minimized standalone test case for these?
This is a restriction in the standard Lua 5.1 interpreter because its
We've been trying hard to support the standard Lua 5.1.4 interpreter :)
We definitely need more information for these issues :) Thanks! |
I've got a tight deadline at the moment, and don't really have the time to look into it again right now. When I'm a bit freer, I'll send you some more info. |
Any update on this issue? |
Sorry, I'd forgotten about this - I've been very busy of late. I've been using LuaJIT recently, and haven't noticed these particular issues. When I'm less busy with stuff, I'll test out what I'm doing with 5.1 and the latest builds. |
Any updates on this issue? |
seems I have a similar issue,
using openresty, compiled so:
full code that sometimes triggers it including comments and anything, maybe its lua bytecode related somehow:
relevant nginx config
|
also, lua_code_cache is off, Linux feanor 2.6.35-28.50 #1 SMP Mon Oct 17 23:44:59 CEST 2011 x86_64 Intel(R) Pentium(R) Dual CPU E2160 @ 1.80GHz GenuineIntel GNU/Linux |
https://dl.dropbox.com/u/195588/core.442 and the core dump |
Hello! On Sun, Jun 24, 2012 at 3:57 AM, sztanpet
Thank you for the bug report! Just want to ask a few questions:
You're recommended to rebuild your openresty using the
Best regards, |
no, there is nothing in my error.log, (error_log /dev/kmsg error;) minimizing the sample code didnt seem like a good idea because the crashes were random, the only thing I noticed was that after the subrequest I'm trying to construct a lua hash from a redis hash and it didn't work (upon trying to print all the values I get an empty string for the value, but in the request.body I see that a value should be there) and json.encode errors out with saying that it cannot encode illegal values. the redis data was |
with lua_code_cache on, daemon off, master_process off
|
Thank you for the valgrind output! Could you also use "error_log /dev/kmsg debug;" and paste out all the debug logs in your error.log right before the crash? |
|
Hmm, I still need more information :P So the crash happens on the ngx.print line in the following lines of local ret = {success = true, data = {}} for i = 1, #reply, 2 do And could you try dumping out the reply[i] and reply[i+1] arguments using JSON? Also, can you reproduce the crash with LuaJIT 2.0? You can enable Thanks! |
yes, here is the valgrind output with luajit
and the json dump of reply[i] and reply[i+1] is the following
with the following code, it does not segfault
|
Hello! On Sun, Jun 24, 2012 at 2:09 PM, sztanpet
Valgrind says the nginx process is aborted. Then there should be an Also, please use gdb to obtain the backtrace for this assertion failure. Thanks!
Can you output the "replies" table with cjson.encode right after
Also, what is exactly in result.body? Can you output it as a string directly? Thanks! |
the result.body
the json.encode( replies )
EDIT: the json encode right after parsing, and no, there is nothing extra in the error log, I can paste it again if you want |
Hello! On Sun, Jun 24, 2012 at 2:39 PM, sztanpet
This backtrace is invaluable! I've just reproduced this on my side and Thank you very much! |
thanks for your time and the awesome software |
Hello! On Sun, Jun 24, 2012 at 4:22 PM, sztanpet
I don't think so. It's an issue in ngx.print()/ngx.say() when table Best regards, |
…yped arguments were given. thanks sztanpet for reporting this in github issue #54.
Hello! On Sun, Jun 24, 2012 at 4:16 PM, agentzh [email protected] wrote:
I've just committed a patch for this issue to ngx_lua's git master branch:
Could you please try out this patch (or the git master HEAD) on your Thanks! |
Hello! On Sun, Jun 24, 2012 at 10:05 PM, agentzh [email protected] wrote:
To make your life easier, I've just put a new (rc) version of the
Thanks! |
yes, the segfault is gone but this parsed response seems wrong for this body:
is that table valid tho for the response? the parsing seems a bit off or my code is buggy, anyway that should probably be another ticket if its not on my end |
Hello! On Mon, Jun 25, 2012 at 12:01 AM, sztanpet
Please provide a minimal example for this because it could be an issue BTW, nowadays it's recommended to use the lua-resty-redis library that
This is much simpler to use than the old approach you're using, Best regards, |
nope, nevermind it was on my end, |
Hello! On Mon, Jun 25, 2012 at 1:33 PM, sztanpet
Sure thing! Check out its set_keepalive method which puts the current Best regards, |
…yped arguments were given. thanks sztanpet for reporting this in github issue openresty#54.
Consider it resolved. |
Hi,
When using Lua 5.1.4 to do subrequests (e.g. ngx.location.capture() -> memc_pass), after the first or second subrequest, I've found that that I've had a host of problems, including:
and (in versions around 2.0 - 2.1.7/8 of ngx_lua)
As mentioned in another post, I've been doing a lot of hacking, and didn't do any checking without my code compiled-in. However, when I switched to LuaJIT, these issues went away.
I don't know how interested you are in supporting 5.1.4 since you're using JIT, but just in case you were, I thought I'd pass it on. I'm afraid I haven't got the time to look into it in any more depth myself right now.
Cheers,
Marcus.
The text was updated successfully, but these errors were encountered: