Re: Static lib and lua5.1.dll (crash on lua_close_())

Mark Mruss <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
Hi Catherine,

This is exactly what I think is happening. I think I'm getting two
"lua runtimes" and because of the static variables I'm getting the
crash. I just haven't been able to figure it out!

I can't move to a static linking of lua because we want out program to
be able to support lua DLL modules which require you to link with the
lua DLL or you will get the exact same lua static variable problem.

As far as I can tell everything should work...I'm just missing something.

Thanks,

mark.

On Tue, May 18, 2010 at 12:30 PM, Catherine West <[email protected]> wrote:
> This sounds kinda similar to a problem I was having a while ago on OS X that turned out to be caused by duplicate symbols.
>
> I was doing the opposite of what you were doing... lua was built as a static library, and luabind was being built shared.
>
> There seemed to be duplicate per library static variables in the lua library that were included in both my final binary (linked to the static lua library) and luabind (shared library, linked to the static lua library)
>
> The duplicate static variables seemed to be garbage collector related, and normally my app would crash on shutdown, but I could get it to crash earlier by calling collectGarbage() in lua.
>
> I *think* I did my analysis correctly, but I may not fully understand all the rules for the scope of static variables when it comes to the linker on different compilers / OSes.
>
> I second the suggestion to try linking lua statically, as that eliminates the potential for duplicate per shared library symbols.
>
> I hope you can get it figured out!
> -Catherine
>

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.