Failed attempt at compiling with Visual Studio 2019

Failed attempt at compiling with Visual Studio 2019

Postby Danfun64 » 06 Apr 2019, 02:00

I recently did a fresh install of Windows 10. I found that Visual Studio 2019 had just been released, so I downloaded it instead of Visual Studio 2017. It appears to have been compiled in its entirety, but running it is another matter. Note that I'm using the latest windows_64bit dependencies.
Here's the compile log: http://paste.debian.net/1076393/

{l Code}: {l Select All Code}
---------------------------
SuperTuxKart crashed :/
---------------------------
SuperTuxKart crashed!
Please hit Ctrl+C to copy to clipboard and signal the problem
to the developers on our forum: http://forum.freegamedev.net/viewforum.php?f=16

Call stack:

 pngread.c:png_read_destroy:1092
 pngread.c:png_destroy_read_struct:973
 CImageLoaderPNG.cpp:irr::video::CImageLoaderPng::loadImage:249
 sp_texture.cpp:SP::SPTexture::getImageFromPath:137
 sp_texture.cpp:SP::SPTexture::getTextureImage:162
 sp_texture.cpp:SP::SPTexture::threadedLoad:456
 sp_texture_manager.cpp:<lambda_aa8069a420787a7c20c57f5569a1ece0>::operator():67
 thread:std::thread::_Invoke<std::tuple<<lambda_aa8069a420787a7c20c57f5569a1ece0> >,0>:39
 o_exp
 BaseThreadInitThunk
 RtlUserThreadStart
---------------------------
OK   
---------------------------
Danfun64
 
Posts: 32
Joined: 29 Aug 2012, 21:57

Re: Failed attempt at compiling with Visual Studio 2019

Postby benau » 06 Apr 2019, 03:20

is it always reproducible?
Image
benau
STK Moderator
 
Posts: 505
Joined: 08 Dec 2015, 17:32

Re: Failed attempt at compiling with Visual Studio 2019

Postby Danfun64 » 06 Apr 2019, 18:25

Yes it is. I get the error both when reopening the exe and when recompiling it.
Danfun64
 
Posts: 32
Joined: 29 Aug 2012, 21:57

Re: Failed attempt at compiling with Visual Studio 2019

Postby benau » 06 Apr 2019, 18:37

possible to help debugging it?
Image
benau
STK Moderator
 
Posts: 505
Joined: 08 Dec 2015, 17:32

Re: Failed attempt at compiling with Visual Studio 2019

Postby Danfun64 » 06 Apr 2019, 22:37

Unfortunately, I bumped into a weird problem. I get that crash message when I run a "Release" or "RelWithDebInfo" build, but "Debug" builds run correctly.
Danfun64
 
Posts: 32
Joined: 29 Aug 2012, 21:57

Re: Failed attempt at compiling with Visual Studio 2019

Postby Auria » 07 Apr 2019, 03:20

Perhaps some compiler optimisation breaks the game... I do not have VS2019 at this time, but I would suggest trying to play with the optimisation level settings, disabling the riskier optimisations and keeping only the simplier optimisations.

Also, anything helpful in the logs? (they are in %appdata%\supertuxkart\config-0.10\stdout.log)
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Failed attempt at compiling with Visual Studio 2019

Postby Danfun64 » 07 Apr 2019, 18:43

The last shader Supertuxkart attempts to compile is "[info ] ShaderFilesManager: Compiling shader: C:/Users/Danfu/Documents/supertuxkart/stk-code/data/shaders/sp_normal_visualizer.frag"

Aside from that, there doesn't appear to be any useful info in the logs.
Danfun64
 
Posts: 32
Joined: 29 Aug 2012, 21:57

Re: Failed attempt at compiling with Visual Studio 2019

Postby deve » 11 Apr 2019, 13:35

Does this patch work for you?

{l Code}: {l Select All Code}
diff --git a/lib/libpng/pngread.c b/lib/libpng/pngread.c
index b90e017e6..ca93ec870 100644
--- a/lib/libpng/pngread.c
+++ b/lib/libpng/pngread.c
@@ -1089,7 +1089,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr,
    free_fn = png_ptr->free_fn;
 #endif
 
-   png_memset(png_ptr, 0, png_sizeof(png_struct));
+   png_memset((png_voidp)png_ptr, 0, png_sizeof(png_struct));
 
    png_ptr->error_fn = error_fn;
 #ifdef PNG_WARNINGS_SUPPORTED
deve
 
Posts: 268
Joined: 23 Jan 2014, 13:45

Re: Failed attempt at compiling with Visual Studio 2019

Postby Danfun64 » 17 Apr 2019, 00:24

Sorry for taking so long to respond. I can confirm that the problem has been fixed after the patch.
Danfun64
 
Posts: 32
Joined: 29 Aug 2012, 21:57

Re: Failed attempt at compiling with Visual Studio 2019

Postby Lyberta » 22 Apr 2019, 04:23

Dunno how VS handle things, but this would be UB if compiled in C++ mode. memset is almost never legal in C++, in fact, I don't know when it is legal in C++.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Re: Failed attempt at compiling with Visual Studio 2019

Postby deve » 22 Apr 2019, 17:23

Illegal memset :-D
deve
 
Posts: 268
Joined: 23 Jan 2014, 13:45

Who is online

Users browsing this forum: No registered users and 1 guest