4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.81k stars 848 forks source link

Light Extension : crash when previewed #127

Closed victorlevasseur closed 9 years ago

victorlevasseur commented 9 years ago

Here is the gdb output :

Program received signal SIGSEGV, Segmentation fault.
(gdb) bt
#0  0x6bdc2635 in Light::AddTriangle(sf::Vector2<float>, sf::Vector2<float>, int
, std::vector<Wall*, std::allocator<Wall*> >&) ()
   from C:\Program Files (x86)\GDevelop\CppPlatform\Extensions\Light.xgdwe
#1  0x00000000 in ?? ()
4ian commented 9 years ago

Is this happening with any example?

victorlevasseur commented 9 years ago

Yes, Dynamic Lights and Laser & Zombies It seems that the crash occurs when a light is inside a light obstacle.

4ian commented 9 years ago

Ok, surely an edge case causing the crash :/ I guess a debug build would be useful to see precisely what's going on.

4ian commented 9 years ago

Do you know how to reproduce the bug? I wasn't able to make the lights crash when previewing the Physics with lights example nor the dynamic lights. (Not tried yet with Laser & Zombies).

victorlevasseur commented 9 years ago

You can reproduce it by putting a light inside a light obstacle. It seems that it doesn't happen on Linux...

victorlevasseur commented 9 years ago

I think this game suffers the same bug : http://forum.compilgames.net/viewtopic.php?f=4&t=6761&p=51764#p51753

4ian commented 9 years ago

Looks like a heisenbug, when I try with a Debug build, or even a RelWithDebInfo build, no crash on Windows. :( (Not sure the game is working properly though because using my virtual machine I have not proper rendering of the scene).

4ian commented 9 years ago

Fixed in https://github.com/4ian/GD/commit/a4de75d2516f8d46afa3e77687f91388606a6741 :smile: It was due to comparison between sf::Vector2f returning null even if the vectors were equal, surely a rounding error or something related to floating number precision.