lua-users home
lua-l archive

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


I'm seeing some very rare and frankly baffling script execution issues when running our Android and iOS builds. It mostly comes down to arithmetic producing nonsense values. Unfortunately these errors are extremely rare (and may not be Lua's fault, anyway - it could just be a pointer scribble from some other part of the app, but I'm starting with Lua since the error always manifests in scripts and has yet to blow up any other part of the process), and reproducing them reliably is next to impossible, so I'm in the process of checking over everything I can think of...

So, what should luaconf.h and my compiler flags (GCC 4.8, Apple LLVM 5.1) look like for the Lua source? I've googled around a bit, but there's little consistency among the sources I've found for various projects (apart from the llex/getlocaledecpoint issue), so I'm hoping someone can give me an official answer.

First off, what's the status of the various optimization "tricks" on 32-bit ARM targets? Specifically, LUA_IEEE754TRICK, LUA_IEEELL, and LUA_NANTRICK? A few of the makefiles I've run across define LUA_ANSI, which precludes all of those, but I'm really not sure why that's the case - everything seems to still run if I enable them. Does anyone know what the subtle thing which would explode on ARM if those are enabled is? For the NaN trick in particular, I'm not sure I understand exactly what the differences are between ARM and x86 in relation to signalling, so where should I expect an error if that's the case? I'm guessing there's some math operation somewhere which produces a value that the VM would mistake as a non-number somewhere...

And finally, do I need to disable any optimizations (-fno-strict-aliasing, for instance) in order to ensure correctness?

--
Phill Djonov
Programmer, Tools and Graphics