lua-users home
lua-l archive

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


Greetings!

We ran into an interesting situation while working with LuaJIT 2.0.0-beta8:

> require 'cdlua'
> =cd.GREEN
userdata: 0x0000ff00
> =cd.BLUE
userdata: 0x000000ff
> =cd.GREEN == cd.GREEN
true
> =cd.GREEN == cd.BLUE
PANIC: unprotected error in call to Lua API (4.4562912041821e-313)

This is using the CD library from tecgraf, and the cd.X are lightuserdata objects.

We're running Windows 7, x64 and the crash happens with beta8 and HEAD and with the JIT turned off and no optimisations enabled (-joff -O0)

I suspect this means that if the pointers are equal, the result comes back quickly, but if they're not there's some deep inspection of the pointers happening, and I wouldn't have expected that. In regular Lua, the result comes back as I would expect (false) and doesn't crash.

I haven't been able to track down exactly where this sort of thing is resolved (lj_obj.c?), so my question -- Is this expected behaviour or a bug?


Cheers,

Daniel M. Klein
s/w dev, Tornado Medical Systems, Inc.
NOTICE OF CONFIDENTIAL AND PRIVILEGED INFORMATION

This e-mail message, including any attachments, may contain information that is 
confidential, privileged, subject to copyright, or exempt from disclosure.  Any 
unauthorized distribution, disclosure, copying, review, retransmission or other use 
of or reliance on this information may be unlawful and is strictly prohibited.  You 
may contact us at: info@tornado-medical.com