lua-users home
lua-l archive

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


>
> While looking into one nasty bug (was posted here
> http://lua-list.2524044.n2.nabble.com/Strange-intermittent-LuaJIT-errors-likely-my-fault-td7438216.html)
> I encountered curious error
>
> ./luajit: ../../etc/replay.lua:112: return values check failed: load 00000131
>  -- return value #2 mismatch: actual `""', expected `""'
>  -- return value #4 mismatch: actual `"luatexts"', expected `"luatexts"'
> stack traceback:
>     [C]: in function 'error'
>     ./lua-nucleo/ensure.lua:329: in function 'ensure_returns'
>     ../../etc/replay.lua:112: in main chunk
>
> This happens during running the test, that reveals the bug I mentioned
> above, so any kind of things may happen.  But I wonder, how can it
> ever be, that two similar strings are not equal.  The test uses
> standard comparator for string.

Easy.

    a="snap"
    b="sn\7ap"
    assert(a==b,("parameter mismatch: expected `%s`, got `%s`"):format(a,b))
stdin:1: parameter mismatch: expected `snap`, got `snap`
stack traceback:
	[C]: in function 'assert'
	stdin:1: in main chunk
	[C]: in ?

But show us the file replay.lua.