X-Plane / XLua

Ultra-Minimal Lua Plugin for X-Plane
MIT License
31 stars 18 forks source link

CTD when using non-existent datarefs #9

Open HussJMH opened 2 years ago

HussJMH commented 2 years ago

In the new version of the plugin, when a dataref is missing (for example, existed in XP11 but was removed in X-Plane 12), and there is a script line that uses it, it crashes X-Plane 12. However...when the same script (with the dataref that is not existent in XP12) is being used with the old XP11 plugin, it will not crash X-Plane 12...(for example, loading an XP11 aircraft that uses xlua, without updating its xlua version).

So... With the new xlua plugin, try to define a non-existent dataref in the xlua script (even with a typo), and reload the aircraft. It will CTD.

Replace the plugin's to the previous XP11 version, and load the aircraft. Due to the non-existing dataref, the script won't work, however, X-Plane will not CTD...

Danita commented 2 years ago

Please post a complete minimal example we can use to reproduce the problem. Thanks!

condac commented 2 years ago

I have also CTD when using undefined variables. Using x-plane 11.55 on linux

Minimal step to reproduce:

function after_physics()    
    XLuaSetNumber(dr_override_surfaces, 0) 
end

dr_override_surfaces have not been created in this example. Previous versions just stopped execution of script silently, this was much better because you could figure out where it crashed with some debug variables.

Danita commented 1 year ago

@condac can you repro this on 1.3.0? Provisions were taken so it doesn't happen anymore.

condac commented 11 months ago

Yes this works much better with 1.3, no crashes because of this.