Lua2C - C2Lua overflow

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua2C - C2Lua overflow

Supratik Champati
I am using tolua to make my C/C++ routines available to
lua. Is there a limit to the number of functions that
can be on the stack ?

I am getting the following message
lua : Lua2C - C2Lua overflow
Active Stack:
	`settable' tag method [in file (C)]
lua: exit(1). Unable to recover

Is there a way to solve the above problem ?

I will appreciate any help in this matter.

Thanx in advance.

-- 
supratik

Reply | Threaded
Open this post in threaded view
|

RE: Lua2C - C2Lua overflow

Ashley Fryer-2
Are you using lua_beginblock() and lua_endblock() ?  You can read more about
them at the end of "section 5.3 Garbage Collection", but the generally you
should enclose any calls to Lua functions within a
lua_beginblock/lua_endblock pair.

ashley

> -----Original Message-----
> From: [hidden email] [[hidden email]
> Behalf Of Supratik Champati
> Sent: Sunday, February 21, 1999 10:55 PM
>
> I am getting the following message
> lua : Lua2C - C2Lua overflow
> Active Stack:
> 	`settable' tag method [in file (C)]
> lua: exit(1). Unable to recover
>
> Is there a way to solve the above problem ?
>


Reply | Threaded
Open this post in threaded view
|

Re: Lua2C - C2Lua overflow

David Jeske-2
In reply to this post by Supratik Champati
On Mon, Feb 22, 1999 at 03:55:21AM -0300, Supratik Champati wrote:
> I am using tolua to make my C/C++ routines available to
> lua. Is there a limit to the number of functions that
> can be on the stack ?
> 
> I am getting the following message
> lua : Lua2C - C2Lua overflow
> Active Stack:
> 	`settable' tag method [in file (C)]
> lua: exit(1). Unable to recover
> 
> Is there a way to solve the above problem ?
> 
> I will appreciate any help in this matter.

I usually run into this problem when I don't close a block
correctly.. (i.e. lua_beginblock() lua_endblock())


-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Lua2C - C2Lua overflow

Supratik Champati
In reply to this post by Supratik Champati
There are to may .pkg files
what I was doing was something like
...
    lua_iolibopen();
    lua_strlibopen();
    lua_mathlibopen();
    tolua_mylib_1_open();
    tolua_mylib_2_open();
    tolua_mylib_3_open();
           ...
           ...
    tolua_mylib_n_open();

I think when n became to large it gave me the error.
For right now I went inside the source code and
doubled the STACK_LIMIT and STACK_UNIT and it worked.
When I get the some time I will try the begin and end blocks
(thanx for the help guys).
If you still want the .pkg files let me know -

Thanx.

Supratik.

// here is a sample
//--------------------------------------------------------------//
//			graph.pkg				//
//--------------------------------------------------------------//
$#include "graph_object.h"

class GraphicsObject 	//Base class
{
    ~CLexGraphicsObject();

    int getId();
    void draw(Canvas *) const;
$#ifdef OPENGL
    void draw_for_feedback(Canvas *) const;
$#endif
    void erase(Canvas *) const;

    Coord* getPoints();
    int numPoints();
    int isComposite() const;
};

Waldemar Celes wrote:
> 
> Supratik Champati wrote:
> >
> > I am using tolua to make my C/C++ routines available to
> > lua. Is there a limit to the number of functions that
> > can be on the stack ?
> >
> > I am getting the following message
> > lua : Lua2C - C2Lua overflow
> > Active Stack:
> >         `settable' tag method [in file (C)]
> > lua: exit(1). Unable to recover
> >
> > Is there a way to solve the above problem ?
> >
> > I will appreciate any help in this matter.
> >
> 
> are you using tolua 3.0, right?
> 
> could you send me your .pkg file?
> 
> -- waldemar