Skip to content

Lua GC crash #216

Closed
Closed
@nimble0

Description

I've had trouble getting easy reproduction of this but maybe what I've worked out will help:

  • EventDispatcher::DispatchEvent creates an event (with C++ new).
  • The event gets sent to Lua with LuaType::push, marked not to delete when GCed.
  • The event is deleted on the C++ side.
  • A new object which is deleted when GCed (e.g. ElementStyleProxy) is created at the same address as the event.
  • The new object gets sent to Lua with LuaType::push, marked to delete when GCed, overwriting the original mark not to delete when GCed.
  • The new object gets GCed calling LuaType::gc_T, which deletes the object in C++.
  • The event gets GCed calling LuaType::gc_T, which deletes the same address in C++ causing a segfault.

Metadata

Assignees

No one assigned

    Labels

    LuaLua binding issuesbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions