lua-users home
lua-l archive

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

It was thus said that the Great John Dunn once stated:
> >  I won't claim a compiler bug just yet---it might be caused by issues I outlined here.  It might also help 
> >  with knowing the operating  system and compiler you saw the error with.
> Good point. I'm compiling Lua as c++ using Visual Studio 2017 (
> technically 2019 using the 2017 compiler ). I'm defining LUA_COMPAT_MODULE
> which brings in luaL_register. I removed LUA_COMPAT_MODULE and switched to
> compiling Lua as c and neither had any effect - the app still crashed.

  The app?  Or the sample code you provided?

> I was also able to reproduce the bug on Linux as well ( gcc, I think
> 7.5.0, also compiled as c++ ) so I don't think it's a straight ahead
> compiler bug. 

  If you are using Linux, could you run the app under valgrind?  It will
take longer, but it should reveal some issues.

> We do have some slight modifications to our Lua library but
> mostly they are just to sandbox things by removing some 'dangerous'
> modules

  I'd be interested in seeing what the "dangerous" modules are.
> As a sanity check I downloaded 5.3.2 and compiled it without modifications
> on Windows using VS2019 and it's still crashing. The crash happens in
> different locations depending on x86/x64 and Debug/Release. 

  My experience in such things will automatically go towards memory
corruption (which valgrind will show) or issues with multithreading [1]
(which also tend towards memory corruption).  

> Things also
> crash with 5.4.4 but in different spots as well. I've uploaded a
> standalone VS project here ( solution is inside the LuaTest folder ) -
> This project doesn't use LUA_COMPAT_MODULE and Lua is compiled as c but
> the main application is still c++.

  I don't do Windows development (nor do I have Windows at home or at work)
so maybe someone else can look there.  But my gut feeling is that you have
some issue elsewhere in your codebase.  Maybe crank the compiler warnings up
and fix all reported issues?


[1]	Longest bug for me to find turned out to be a threading issue, even
	though the program itself used no threads, but did use a signal
	handler ...