-
Notifications
You must be signed in to change notification settings - Fork 29
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
Make sure package.preload exists #8
base: master
Are you sure you want to change the base?
Conversation
It doesn't work that way. First, you are discarding the previous package.preload table, which could already contain values, and second, the Lua Reference Manual states:
|
Should some error checking be done in set_package_preload instead? (How are you missing the package table? and in that case, why are you trying to use the package system through require?) |
Also automatically fall back to 5.1 if 5.2 could not be found and no version was explicitly set in the LUABIND_LUA_VERSION CMake variable.
Also automatically fall back to 5.1 if 5.2 could not be found and no version was explicitly set in the LUABIND_LUA_VERSION CMake variable.
Hi, sorry for the delay I've been trying to find time to do some testing to see if this bug still exists, and I've just checked and it does. To elaborate, I'm using a GIT submodule to include luabind in my application, with my fork (including the above patch) everything works fine, but with your repository I get the following segfault:
And here is my calling code:
This is on Fedora (if it matters) and the clang compiler. Is this my error? Am I supposed to do something else before calling luabind::open ? Thanks |
Aha! This seems to fix it!
Should I be required to call luaL_openlibs(), is that normal? |
Yes, I think so - the "package" library is one that the package preload Ryan On Sun, Sep 15, 2013 at 3:00 PM, Luke Benstead notifications@github.comwrote:
Ryan Pavlik |
Hi,
package.preload doesn't always exist when luabind::open is called which causes set_package_preload to fail. This patch initializes the package and preload tables in open() to prevent a segfault.