[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Xavate crash and coxpcall missing 'arg' variable
- From: Javier Guerra <javier@...>
- Date: Mon, 16 May 2005 14:17:10 -0500
On 16 may 2005, at 1:49 PM, Romulo Bahiense wrote:
In my attempt to get Xavante running, I came across an unusual
After configuring all paths and dependencies, when I << require
't_xavante_start.lua' >>, Lua throws an error:
the files starting with 't_' are templates. they're supposed to be
modified by the install procedure. to be honest, i haven't checked how
that works; i install them by hand and execute the final
(...)coxpcall.lua:19: bad argument #1 to `unpack' (table expected, got
xpcall() doesn't work well across coroutines; therefore coxpcall() is
used to bridge them. unfortunately, most errors are lost, and _EVERY_
case turns up as an error in coxpcall(). usually there's a bit of
stack info with the real error source. could you include the whole
Naturally, I opened the file to look what could had caused the error.
I found that there are no 'arg' variable (local or function parameter)
and IMHO it shouldn't be in globals.
'arg' is an array automatically filled with any extra parameters beyond
those indicated in a function definition; it's not a global var.
If I comment that piece of code ( << unpack(arg) >> ), everything
goes fine, except that the Xavante crashes if I stress it. I don't
really know if Xavante does crash because of that call or because
definitely you shouldn't remove that line.
I'm using the latest downloadable (non-cvs) files for LuaSocket,
Xavante, Copas, coxpcall, lfs and compat-5.1. Lua version is 5.0.2.
I'm also using Windows XP pro sp2.
To try to reproduce the crash, just start Xavante, open your browser,
and smack down the Refresh button. In not-so-many requests, Lua prompt
will end with no error messages - just end.
most probably any error message that might be generated was lost
because of the change in coxpcall
Please note that the same occurs when I'm using luahttpd. I just had
to change some things to get luahttpd 'running': first, the namespace
problems like << require "url" >> to << require "socket.url" >>.
Second, apparently luahttpd was using an older (or different) of
copas. It was attempting to call 'skt_wrap', which didn't exist (ok, I
just renamed the reference from skt_wrap to wrap and worked the same
luahttpd is very obsolete and deprecated. all development since
several months ago is done for Xavante