Crash when testing Britzl simple lights example

Hello, I was trying to run Britlz’s “Simple Lights” example (https://github.com/britzl/publicexamples/tree/master/examples/simple_lights) and when I run the project I got the screen and after 1 second the example crashes with this result:

INFO:DLIB: Log server started on port 58870
INFO:ENGINE: Engine service started on port 58871
INFO:ENGINE: Defold Engine 1.2.172 (dedf1ed)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device ‘default’

DEBUG:SCRIPT: Listening for debugger on 0.0.0.0
DEBUG:SCRIPT: Debugger connected from 127.0.0.1
WARNING:RENDER: render.draw_debug2d is deprecated and will be removed in future versions, please use render.draw_debug3d instead.
INFO:DLIB: SSDP: Started on address 169.254.221.242
INFO:DLIB: SSDP: Started on address 192.168.2.5
INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\Rodrigo\AppData\Roaming\Defold/_crash
ERROR:CRASH: CALL STACK:

0 0x7FF7284C2C8D _scwprintf :0
1 0xEC9A70 alcCreateContext :0
2 0x7FFB14AEF400 UnhandledExceptionFilter :0
3 0x7FFB17942F80 memset :0
4 0x7FFB1792C5C0 __C_specific_handler :0
5 0x7FFB179410B0 __chkstk :0
6 0x7FFB17909E70 RtlRaiseException :0
7 0x7FFB1793FE10 KiUserExceptionDispatcher :0
8 0x7FF7284C2C8D _scwprintf :0
9 0x7FF7284C2C8D _scwprintf :0
10 0x7FF7284C2C8D _scwprintf :0
11 0x7FF7284C2C8D _scwprintf :0
12 0x7FF7284C2C8D _scwprintf :0
13 0x7FF7284C2C8D _scwprintf :0
14 0x7FF7284C2C8D _scwprintf :0
15 0x7FF7284C2C8D _scwprintf :0
16 0x7FF7284C2C8D _scwprintf :0
17 0x7FF7284C2C8D _scwprintf :0
18 0x7FFB174B7BC0 BaseThreadInitThunk :0
19 0x7FFB1790CE30 RtlUserThreadStart :100:

Unfortunately I cant upload the dump here in forum.

Can you try this fork and see if it still crashes for you? I tried to update a few things

This as is runs for me without warnings and no crashes on Windows 10.

1 Like

Well I tried it, even restarted the computer and it’s still crashing. I use Windows 10 and my graphics card is NVIDIA Geforce 1050 2GB, I5 processor (2nd generation) 8 GB memory. For hard drives I have 1 SSD for the main system and SATA2 500gb for data. Screen resolution 1920x1080, 1080p in 60hz. I will paste below the sysinfo from Nvidia panel, it might help altough it’s in portuguese:

Relatório de informações do Sistema NVIDIA criado em: 08/18/2020 19:29:38
Nome do sistema: DESKTOP-5N3LVCK

[Monitor]
Sistema operacional: Windows 10 Pro, 64-bit
Versão do DirectX: 12.0
Processador da GPU: GeForce GTX 1050
Versão do driver: 451.48
Tipo de driver: DCH
Versão da API Direct3D: 12
Nível de recursos do Direct3D: 12_1
Cores CUDA: 640
Clock do núcleo: 1354 MHz
Taxa de dados da memória: 7.01 Gbps
Interface da memória: 128bits
Largura de banda da memória: 112.13 GB/s
Memória total de gráficos disponível: 6123 MB
Memória de vídeo dedicada: 2048 MB GDDR5
Memória de vídeo dedicada: 0 MB
Memória compartilhada do sistema: 4075 MB
Versão BIOS do vídeo: 86.07.39.40.9B
IRQ: Not used
Barramento: PCI Express x16 Gen2
ID do dispositivo: 10DE 1C81 37661458
Número da peça: G210 0001

[Componentes]

nvui.dll 8.17.14.5148 NVIDIA User Experience Driver Component
nvxdplcy.dll 8.17.14.5148 NVIDIA User Experience Driver Component
nvxdbat.dll 8.17.14.5148 NVIDIA User Experience Driver Component
nvxdapix.dll 8.17.14.5148 NVIDIA User Experience Driver Component
NVCPL.DLL 8.17.14.5148 NVIDIA User Experience Driver Component
nvCplUIR.dll 8.1.940.0 NVIDIA Control Panel
nvCplUI.exe 8.1.940.0 NVIDIA Control Panel
nvViTvSR.dll 27.21.14.5148 NVIDIA Video Server
nvViTvS.dll 27.21.14.5148 NVIDIA Video Server
nvDispSR.dll 27.21.14.5148 NVIDIA Display Server
nvDispS.dll 27.21.14.5148 NVIDIA Display Server
nvLicensingS.dll 6.14.14.5148 NVIDIA Licensing Server
nvWSSR.dll 27.21.14.5148 NVIDIA Workstation Server
nvWSS.dll 27.21.14.5148 NVIDIA Workstation Server
nvDevToolSR.dll 27.21.14.5148 NVIDIA Licensing Server
nvDevToolS.dll 27.21.14.5148 NVIDIA 3D Settings Server
PhysX 09.19.0218 NVIDIA PhysX
NVCUDA64.DLL 27.21.14.5148 NVIDIA CUDA 11.0.197 driver
nvGameSR.dll 27.21.14.5148 NVIDIA 3D Settings Server
nvGameS.dll 27.21.14.5148 NVIDIA 3D Settings Server

And below, the error stack

INFO:DLIB: Log server started on port 49745
INFO:ENGINE: Engine service started on port 49746
INFO:ENGINE: Defold Engine 1.2.172 (dedf1ed)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device ‘default’

DEBUG:SCRIPT: Listening for debugger on 0.0.0.0
DEBUG:SCRIPT: Debugger connected from 127.0.0.1
INFO:DLIB: SSDP: Started on address 169.254.221.242
INFO:DLIB: SSDP: Started on address 192.168.2.5
INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\Rodrigo\AppData\Roaming\Defold/_crash
ERROR:CRASH: CALL STACK:

0 0x7FF6DF612C8D _scwprintf :0
1 0x879A70 alcCreateContext :0
2 0x7FF96120F400 UnhandledExceptionFilter :0
3 0x7FF963C62F80 memset :0
4 0x7FF963C4C5C0 __C_specific_handler :0
5 0x7FF963C610B0 __chkstk :0
6 0x7FF963C29E70 RtlRaiseException :0
7 0x7FF963C5FE10 KiUserExceptionDispatcher :0
8 0x7FF6DF612C8D _scwprintf :0
9 0x7FF6DF612C8D _scwprintf :0
10 0x7FF6DF612C8D _scwprintf :0
11 0x7FF6DF612C8D _scwprintf :0
12 0x7FF6DF612C8D _scwprintf :0
13 0x7FF6DF612C8D _scwprintf :0
14 0x7FF6DF612C8D _scwprintf :0
15 0x7FF6DF612C8D _scwprintf :0
16 0x7FF6DF612C8D _scwprintf :0
17 0x7FF6DF612C8D _scwprintf :0
18 0x7FF962807BC0 BaseThreadInitThunk :0
19 0x7FF963C2CE30 RtlUserThreadStart :0

INFO:CRASH: Successfully wrote MiniDump to file: C:\Users\Rodrigo\AppData\Roaming\Defold/_crash.dmp

1 Like

Could you try disabling parts of the example until you can figure out what exactly is causing the crash? Use -- to comment out lines and look for whatever is causing the issue.

This is the main file you want to experiment with /examples/simple_lights/simple_lights/render/postprocess.render_script

If the function update(self) try to disable parts. You can toggle comment out multiple lines by highlighting them and press Ctrl + /

@Mathias_Westerdahl might know what’s wrong based on the call stack.

1 Like

Sure, I’d love to help fix this. Thanks for the tip on the “comment multiple lines”, I need it. Since it’s kinda late here, I’ll post the results tomorrow.

1 Like

Unfortunately, that callstack looks broken. Those functions seem very arbitrary.

If you could upload the _crash.dmp, I could debug using that.

Hello Mathias. Here are both crash files in ZIP (I didn’t saw the zip format was allowed to upload until now, sorry guys). It was generated a few moments ago, right after the update. Hope you can fix it.

simple_lights_crash.zip (20.5 KB)

1 Like

Guys, I did right now what Pkeod suggested, and I got success identifying the line in the render script (in function update) that generates the problem. After commenting the line

render_helper.set_screen_view_projection(self)

the scene loaded and run without errors.

Are you using any native extensions?
If so, could you share the dmengine.exe that you built?
And preferably, if you build with bob.jar, if you add the “–with-symbols”, you’ll also find the dmengine.pdb in the bundled folder.

(Yes, I really need to add the “–with-symbols” as default when building with the editor)

Mathias, I was trying to do what you asked when I find out the following: the project builds OK, with no errors (even with that line uncommented) if I press CTRL+B or CTRL+SHIFT+B, but when I try to run the game (from the editor) with F5 key (as I use to do) the error occurs.

For me, F5 was just another way to reach the same result as CTRL+B but apparently they are different procedures.

Edit: I have luasocket installed, only.

Do you use any dependencies in your project?
I.e. “project -> dependencies” in the game.project settings.

No dependencies, I ran the example project as it came. I noticed however it uses ortho camera. Anyway the problem seems to be only when I run the project from the editor with the F5 key as I stated above.

Pressing F5 in the editor builds the game with a debugger which has some issues, though this seems to be a new error. Does the same thing happen if you run other projects with F5?

1 Like

Not really, BUT I haven’t tried many examples yet. Mostly my own studies reading the manuals. So far I’ve been using rendercam in my project, but I recently made some study in a separate project using normal camera and all went ok.