lua-users home
lua-l archive

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


于 2012-9-21 20:42, Vespe Savikko 写道:
Hi,

I have encountered a weird problem when
trying to get Lua 5.1.4 and LPeg 0.10.2 working
in a target device with ARM architecture.

The cross-compilation in the desktop Linux
does not seem to have any particular issues,
but when running Lua in the target, something
odd happens:

# lua -l re
lua: /usr/share/lua/5.1/re.lua:105: loop body may accept empty string 
stack traceback:
       [C]: ?
       /usr/share/lua/5.1/re.lua:105: in main chunk
       [C]: ?
       [C]: ?

where line 105 is:
local S = (m.S(" \f\n\r\t\v") + "--" * (any - Predef.nl)^0)^0
 
Also, LPeg’s own test set crashes between asserts:
 
# lua l/lpeg-test.lua
General tests for LPeg library
version 0.10
lua: l/lpeg-test.lua:123: bad argument #2 to '?' (number expected, got userdata) 
stack traceback:

       [C]: ?
       l/lpeg-test.lua:123: in main chunk
       [C]: ?

where line 123 is:
word = alpha^1 * (1 - alpha)^0

I am pretty sure that the problem is not within Lua or LPeg per se,
since we have gotten Lua working on ARM architecture (PandaBoard)
earlier. Also, other Lua libraries seem to work (e.g., LuaSocket). 
Unfortunately, our current target has very limited
debugging support, so the hunting for the root cause is quite slow.

Has anybody encountered similar problems or has any
helpful hints?

Thanks and take care.

  ++Vespe

I've no clue for the problem since I don't have an ARM envirenment,
but I guess this might due to lpeg and lua might were compiled use different compiler flags,
e.g. the ABI spec, the optimization level, and so on.