armory3d / armory

3D Engine with Blender Integration
https://armory3d.org
zlib License
3.05k stars 317 forks source link

Live Patch crashes the application on Krom after selecting an element #2158

Open N8n5h opened 3 years ago

N8n5h commented 3 years ago

Description Enabling Live Patch, hitting Play and then going back to Blender and selecting an element crashes the application with the following error:

#
# Fatal error in v8::ToLocalChecked
# Empty MaybeLocal.
#

Tested on Krom Linux

To Reproduce New File -> Enable Live Patch -> Play -> Go back to Blender -> Select Default Cube

System Blender: 2.83LTS Armory: latest commit OS: Ubuntu 20.04.2 LTS

MoritzBrueckner commented 3 years ago

I can't confirm this on Windows, so it could be an issue on Linux only. Does this happen with other actions as well or only when you select something? I have some old live patch diffs laying around that then could solve this by just not doing anything when the selection changes as this should not trigger any update. We should still search for the actual cause though.

N8n5h commented 3 years ago

Not sure what other actions are there, since I've never used live patch that much really, but it seems any small interaction with the scene that triggers issuing a command just crashes Krom.

Lykdraft commented 3 years ago

Hmm. I just checked on OSX. Live-Patch is super slow and laggy as hell, but seems pretty stable here also. (Can move stuff around in a running game, not just in a bare-bones scene.)

Dzynek commented 2 years ago

Hello

LivePatch works for a short while, such as moving the object and freezing the Krom window.

Reproduce: New project -> Live Patch: enable -> F5

Windows 10 64bit ArmorySDK2201a Radeon RX 580 8GB Blender 2.93.7 LTS

`Read prefs: C:\Users\djdzy\AppData\Roaming\Blender Foundation\Blender\2.93\config\userpref.blend Running Armory SDK from C:\Armory3D\SDK\ArmorySDK2201a\armsdk/ Read blend: C:\Armory3D\Projekty\2_93LTS\TESTY\LivePatch\LivePatch.blend Project cleaned Armory v2022.1 ($Id: 7b09c2be0d748547ea0406473ea133f65a5de29b $) Using CPU for environment render (might be slow). Enable CUDA if possible. Saved: 'C:\Armory3D\Projekty\2_93LTS\TESTY\LivePatch\build_LivePatch\compiled\Assets\envmaps\env_World.jpg' Time: 00:00.05 (Saving: 00:00.01)

CMFT info: Converting latlong image to cubemap. CMFT info: Saving spherical harmonics coefficients to C:\Armory3D\Projekty\2_93LTS\TESTY\LivePatch\build_LivePatch/compiled/Assets/envmaps/env_World_irradiance.c CMFT info: Done.

512x256

256x128

128x64

64x32

32x16

16x8

8x4

4x2

2x1

1x1

Exporting Scene Scene exported in 0.005s Finished in 5.023s Live patch session started Initializing a new default audio device. Falling back to the system's preferred WASAPI mix format. Trace: TypeError: Cannot read property 'hxBytes' of undefined at Function.ofData (:29311:14) at Function.loadBlobFromDescription (:49737:49) at Function.loadBlobFromPath (:48792:18) at armory_trait_internal_LivePatch.update (:27602:14) at update (:24865:28) at kha_TimeTask.task (:50139:4) at Function.executeTimeTasks (:50022:76) at Function.executeFrame (:49972:18) at renderCallback (:50872:17) Project cleaned Live patch session stopped Project cleaned Armory v2022.1 ($Id: 7b09c2be0d748547ea0406473ea133f65a5de29b $) Using CPU for environment render (might be slow). Enable CUDA if possible. Saved: 'C:\Armory3D\Projekty\2_93LTS\TESTY\LivePatch\build_LivePatch\compiled\Assets\envmaps\env_World.jpg' Time: 00:00.03 (Saving: 00:00.01)

CMFT info: Converting latlong image to cubemap. CMFT info: Saving spherical harmonics coefficients to C:\Armory3D\Projekty\2_93LTS\TESTY\LivePatch\build_LivePatch/compiled/Assets/envmaps/env_World_irradiance.c CMFT info: Done.

512x256

256x128

128x64

64x32

32x16

16x8

8x4

4x2

2x1

1x1

Exporting Scene Scene exported in 0.007s Finished in 10.263s Live patch session started Initializing a new default audio device. Falling back to the system's preferred WASAPI mix format. Traceback (most recent call last): File "C:\Armory3D\SDK\ArmorySDK2201a\armsdk/armory\blender\arm\handlers.py", line 62, in on_depsgraph_update_post live_patch.on_operator(ops[-1].bl_idname) File "C:\Armory3D\SDK\ArmorySDK2201a\armsdk/armory\blender\arm\live_patch.py", line 352, in on_operator send_event('obj_location') File "C:\Armory3D\SDK\ArmorySDK2201a\armsdk/armory\blender\arm\live_patch.py", line 141, in send_event write_patch(js) File "C:\Armory3D\SDK\ArmorySDK2201a\armsdk/armory\blender\arm\live_patch.py", line 110, in write_patch with open(arm.utils.get_fp_build() + '/debug/krom/krom.patch', 'w') as f: PermissionError: [Errno 13] Permission denied: 'C:\Armory3D\Projekty\2_93LTS\TESTY\LivePatch\build_LivePatch/debug/krom/krom.patch' Trace: TypeError: Cannot read property 'hxBytes' of undefined at Function.ofData (:29311:14) at Function.loadBlobFromDescription (:49737:49) at Function.loadBlobFromPath (:48792:18) at armory_trait_internal_LivePatch.update (:27602:14) at update (:24865:28) at kha_TimeTask.task (:50139:4) at Function.executeTimeTasks (:50022:76) at Function.executeFrame (:49972:18) at renderCallback (:50872:17) Live patch session stopped`