[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Technical question wrt lua_pcall() and errors
- From: Drake Wilson <drake@...>
- Date: Tue, 18 Jan 2011 03:15:47 -0700
Quoth Marc Balmer <firstname.lastname@example.org>, on 2011-01-18 10:47:39 +0100:
> The fcgi_handler() calls Lua code using lua_pcall(). Nothing fancy.
> When the Lua function returns without error, everything is fine, the
> accept loop above is called once per request.
> As soon as the Lua returns an error, however, the accept loop above is
> run twice.
> Does Lua somehow modify stdin, stdout, stderr or the environment when an
> error happens? That would partly explain above behaviour.
A pcall doesn't by itself modify any I/O streams or the process
environment. Could you show more context regarding where the
lua_pcall happens? In particular, where are you getting the Lua
state, and what do you do with the Lua stack before and after the
pcall? Does this still happen if you replace the Lua code with
trivial Lua code that does nothing except throw an error?
---> Drake Wilson