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

Lua state allocation checks are compiled out in release builds. #11948

Closed
jpeach opened this issue Jul 8, 2020 · 0 comments · Fixed by #12065
Closed

Lua state allocation checks are compiled out in release builds. #11948

jpeach opened this issue Jul 8, 2020 · 0 comments · Fixed by #12065
Labels

Comments

@jpeach
Copy link
Contributor

jpeach commented Jul 8, 2020

The Lua filter allocates Lua states like this:

ThreadLocalState::LuaThreadLocal::LuaThreadLocal(const std::string& code) : state_(lua_open()) {
  ASSERT(state_.get() != nullptr, "unable to create new lua state object");
  luaL_openlibs(state_.get());
  int rc = luaL_dostring(state_.get(), code.c_str());
  ASSERT(rc == 0);
}

lua_open() can return NULL, but in a release build -DNDEBUG is meant to be set by bazel, so the failure won't cause an immediate, controlled crash. Probably this (and maybe other cases in the Lua filter) should be RELEASE_ASSERT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants