Actium Posted February 24 Posted February 24 (edited) Clean (no mods, no scripts), freshly repaired (full verification) DCS 2.9.13.6818 install. Running the following Lua code will cause a segmentation fault (ACCESS_VIOLATION): local res = {net.dostring_in("mission", [[ return {a_do_script("return {1, 2, 3, 4}", 1, 2, 3, 4)} ]])} Steps to reproduce: Save segfault_a_do_script.lua in %USERPROFILE%\Saved Games\DCS.openbeta\Scripts\Hooks\ Run an arbitrary mission from the mission editor. Game should crash with a "DCS Crash" popup once loading completes. Crash trace for comparison: dcs.20250224-084219.crash How did I stumble upon this? I got curious what the updated a_do_script() can do and started messing around with it. Quote from the changelog: Quote Scripting API. Added possibility to pass args and return values from mission scripting a_do_script() and a_do_file() APIs. Edited February 24 by Actium
Actium Posted February 24 Author Posted February 24 The dedicated server is also affected (same lua.dll, presumably). The code does not cause a segfault with server version 2.9.12.5336. Server crash trace: dcs.20250224-092739.crash
Flappie Posted February 24 Posted February 24 Good news: the fix for the former issue you reported works for this issue as well. 1 ---
Actium Posted March 20 Author Posted March 20 @Flappie While said former issue has been fixed with 2.9.14.8222, above issue is still present. 1
Flappie Posted March 20 Posted March 20 Thanks for your feedback. I'll try harder to reproduce the issue. ---
Actium Posted March 20 Author Posted March 20 The steps to reproduce from my first posts still trigger the crash on both client and dedicated server. dcs.20250320-214042.crash
MarcosR Posted April 19 Posted April 19 I was using this in my server and now i can't see any returned values ... is there any other way i should be using this sentence? local safeScript = escape_lua_string(script) local result = net.dostring_in("mission", " return a_do_script( \"" .. safeScript .. "\" )" ) This was working before the update..
MarcosR Posted April 19 Posted April 19 Just to clarify we don't get any result.. script gets ran on the mission side but the return value doesn't arrive back... any idea @Flappie?
Actium Posted April 19 Author Posted April 19 @Flappie I can confirm that the fix presumably broke the underlying scripting feature entirely. Removed the solution mark. @MarcosR I took the liberty to create a separate bug report for the issue you discovered, as it is kinda off topic here: 1
Recommended Posts