lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Martin <wtxnh-lua@...> wrote:
One thing that bother me is that I can not find why game always end with segmentation fault when I am closing it! What is strange it segfault after last command in the game is executed. I strongly suspect it has to do something with memory management but can not figure out a cure. Any suggestion?

I have to cope with a similar problem: a segmentation fault occurring in the aftermath of a program (see subject "module loading in C"). Did you load C-libraries of your own, possibly within C-code? In my case I now believe the origin of such a crash might be in the premature unloading of a C library. These are held in the LUA_REGISTRY as userdata under a key "LOADLIB: <path-of-library>" and apparently nowhere else. The __gc function in the accompanying metatable unloads the library. Your problem might be similar.

Hans van der Meer