Solving random crashes

前端 未结 17 1400
青春惊慌失措
青春惊慌失措 2021-01-31 08:15

I am getting random crashes on my C++ application, it may not crash for a month, and then crash 10 times in a hour, and sometimes it may crash on launch, while sometimes it may

17条回答
  •  情书的邮戳
    2021-01-31 09:18

    There are a lot of good answers here, but no one has yet touched on the Lua angle.

    Lua is generally pretty well behaved, but it is still possible for it to cause memory corruption or crashing if e.g. the Lua stack overflows or underflows, or bad bytecode is executed.

    One easy thing you can do that will detect many such errors is to define the lua_assert macro in luaconf.h. Defining this (to e.g. standard C's assert) will enable a variety of sanity checks inside the Lua core.

提交回复
热议问题