Skip to content
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

luaL_lopenlibs hangs forever #6

Open
danishcake opened this issue Jul 22, 2016 · 0 comments
Open

luaL_lopenlibs hangs forever #6

danishcake opened this issue Jul 22, 2016 · 0 comments

Comments

@danishcake
Copy link

danishcake commented Jul 22, 2016

I've been running this under NodeJS (more or less unchanged, but with one additional line added to the end of lua5.1.5-v0.9.1.min.js)

module.exports = Lua5_1;

A minimal programme using luaL_openlibs will hang forever.

"use strict";

let Lua5_1 = require("lua5.1.5-v0.9.1.min");
let lua = Lua5_1.C;
let vm = lua.luaL_openlibs();
// Never hits the next line. Saturates an entire core

As a workaround I'm loading the libraries independently

"use strict";

let Lua5_1 = require("lua5.1.5-v0.9.1.min");
let lua = Lua5_1.C;
let vm = lua.lua_open();

// Manually load libs as luaL_openlibs hangs
lua.lua_pushcfunction(vm, Lua5_1.Runtime.addFunction(function(vm) {
  lua.luaopen_base(vm);
  lua.luaopen_table(vm);
  lua.luaopen_io(vm);
  lua.luaopen_string(vm);
  lua.luaopen_math(vm);
}));
lua.lua_call(vm, 0, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant