Sign in to follow this  

Of updating LuaInterface and of coroutine error handling

This topic is 4284 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently in the process of upgrading LuaInterface to work with Lua 5.1, since it hasn't been updated in quite some time and I want to experiment with the latest Lua release. So far I've done: * Updated P/Invoke bindings to deal with renamed/removed/modified functions * Reworked the OpenXXXLib functions to work with Lua 5.1 * Made lua_safetostring in the stub DLL actually safe (it now checks to make sure that it's trying to copy a string, where before it would just segfault if it wasn't) I also plan to add a few new features (like a C# equivalent of lua_gc, a way for Lua to throw .NET exceptions, a new LuaException for errors rather than just using Exception, etc.), but that will come after I get this fully stable. Mostly it's running fine, but I'm still having a few problems. Whenever I go to run any of the samples that came with LuaInterface 1.3.0, they run fine until I close them, at which point I get a segfault. If I run any code after running form.lua, it does not crash; likewise testluaform.lua doesn't crash if I run some code through it. I haven't tested socket.lua yet, but I assume it would be the same. If somebody gives me an email address or something I could send you the source - it's a bit too big to post it all in here. They're all VS2005 projects, so you'll need at least VC# and VC++ Express 2005. This part's all solved now: As a side note, I've got an issue with coroutines and I figured I might as well put it in the same thread rather than starting two at once. A coroutine in my current game project appears to be crashing out intermittently in my updated LuaInterface (but not in the old one). To try and track down what the problem is, I surrounded the call to the function with a pcall, but now I can't yield from inside that function at all ("attempt to yield across metamethod/C-call boundaries"). The game isn't text-based (and it's in C#, thus the LuaInterface), so I can't see the error that Lua is probably reporting to stdout. How can I catch that error without breaking yield? [Edited by - trevaaar on March 6, 2006 5:50:47 AM]

Share this post


Link to post
Share on other sites
Second problem solved now - I wasn't checking the result of coroutine.resume when I should've been. By the way, according to a quick Google _ALERT hasn't been in use since Lua 4.0.

Share this post


Link to post
Share on other sites

This topic is 4284 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this