Potential divide by zero in the GIT source code for Cryengine V.

#1
Hello everyone,

I've been fiddling around with Cryengine V since about a week ago. I want to do a little project and for that I might need to set-up some custom FlowGraph ndoes. Thus, I cloned and prepped the Cryengine source code from the git repo (the 'release' branch) following this awesome tutorial
viewtopic.php?f=11&t=66
but I ran into a couple of issues when compiling/trying to debug the engine. Hopefully someone can shed some light on the situation.

First, I had a compiling error. The projects are set up in a way that errors are treated as warnings (WX compiler flag). So while compiling the SystemInit.cpp in the CrySystem project, there are two warnings for potential division by zero and as such, the compiler treats them as errors and doesn't build the CrySystem project. Trying to run the debugger sometimes gives out a 'GameLauncher' exited with code 1 error and crashes and sometimes puts out an error window saying MemoryManager: Cannot access memory management functions.
Here is the compiling error/warnings:

Code: Select all

50>c:\users\nuc\documents\github\cryengine\code\cryengine\crysystem\systeminit.cpp(274): error C2220: warning treated as error - no 'object' file generated 50>c:\users\nuc\documents\github\cryengine\code\cryengine\crysystem\systeminit.cpp(274): warning C4723: potential divide by 0 50>c:\users\nuc\documents\github\cryengine\code\cryengine\crysystem\systeminit.cpp(274): warning C4723: potential divide by 0
So I went into the project properties and disable the WX flag (which is not awesome but seemed to be worth a try) and the CrySystem project was successfully built. Trying to run the debugger gives out the exact same 'GameLauncher' exited with code 1 error as before and crashes.

In both cases, the full debugger error looks like this:
'GameLauncher.exe' (Win32): Loaded 'C:\Users\nuc\Documents\GitHub\CRYENGINE\bin\win_x64\GameLauncher.exe'. Symbols loaded.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Unloaded 'C:\Windows\System32\vcruntime140.dll'
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Users\nuc\Documents\GitHub\CRYENGINE\bin\win_x64\CrySystem.dll'. Symbols loaded.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Users\nuc\Documents\GitHub\CRYENGINE\bin\win_x64\ProfilerCore64.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\wininet.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\avifil32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\dbghelp.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\msvfw32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\msacm32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.16299.192_none_887f70824ab5b0de\comctl32.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\winmmbase.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\winmmbase.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Unloaded 'C:\Windows\System32\winmmbase.dll'
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\winmmbase.dll'. Cannot find or open the PDB file.
'GameLauncher.exe' (Win32): Unloaded 'C:\Windows\System32\winmmbase.dll'
'GameLauncher.exe' (Win32): Loaded 'C:\Users\nuc\Documents\GitHub\CRYENGINE\bin\win_x64\CryAction.dll'. Symbols loaded.
'GameLauncher.exe' (Win32): Loaded 'C:\Windows\System32\ntmarta.dll'. Cannot find or open the PDB file.
BackupNameAttachment=" Build(0) 16 Jan 18 (14 51 06)" -- used by backup system
Log Started at Tue Jan 16 14:51:06 2018
Built on Jan 16 2018 14:49:02
Running 64 bit Windows version
Command Line: "C:\Users\nuc\Documents\GitHub\CRYENGINE\bin\win_x64\GameLauncher.exe"
Executable: C:\Users\nuc\Documents\GitHub\CRYENGINE\bin\win_x64\GameLauncher.exe
FileVersion: 1.0.0.0
ProductVersion: 1.0.0.0
[Warning] Config file system.cfg not found!
System Shutdown
[Warning] <ThreadInfo>: Unable to find config for thread:CaptureCrashScreenShot
<ThreadInfo> Configured thread "CryThread_Unnamed" | AffinityMask: 4294967295 | Priority: 0 | PriorityBoost: enabled
[Warning] <ThreadInfo> Thread config not loaded yet. Hence no thread config was found for thread CaptureCrashScreenShot ... using default config.
The thread 0x2060 has exited with code 1 (0x1).
The thread 0x2910 has exited with code 1 (0x1).
The thread 0x2998 has exited with code 1 (0x1).
The thread 0x4e0 has exited with code 1 (0x1).
The program '[6696] GameLauncher.exe' has exited with code 1 (0x1).
This looks like some sort of memory allocation error to me, but do correct me if I am wrong. I followed the above mentioned tutorial to the letter and the codein question is the one form GIT ('release' branch) with no alterations of any kind.

Thank you in advance!

//L
Last edited by robo.cre on Mon Jan 29, 2018 11:49 am, edited 2 times in total.

Re: Potential divide by zero in the GIT source code for Cryengine V.

#3
The solution has already been stated by cry-thomas, I would just like to clarify the points from the commit message;

The divide by zero error is actually intentional, it is a manual crash used for testing purposes.
The compiler error is new from Visual Studio after a recent update, which is why this is in the release branch,
and you can safely use this fix from main, by manually integrating this commit with your local branch.
Uniflare
CRYENGINE Community Coordinator
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Re: Potential divide by zero in the GIT source code for Cryengine V.

#4
Hi Thomas and Flare,
Hi,
I am going to assume that you're compiling against the Release branch which did not received the division-by-zero fix yet but the Main branch did.
https://github.com/CRYTEK/CRYENGINE/com ... 2f077690b3
Indeed I was.
The solution has already been stated by cry-thomas, I would just like to clarify the points from the commit message;

The divide by zero error is actually intentional, it is a manual crash used for testing purposes.
The compiler error is new from Visual Studio after a recent update, which is why this is in the release branch,
and you can safely use this fix from main, by manually integrating this commit with your local branch.
I switched to the main branch in GIT as you suggested and there seems to be a new issue as of this morning. CMake looks for zlib in the SDK folder in a folder named zlib-1.2.11. However, download-sdks.exe downloads it in a folder named zlib-1.2.8. I suppose the numbers signify the version, so I manually changed the name of the folder to zlib-1.2.11 and it got stuck in some other errors in another cpp file. The path name is probably going to be changed in the CMake files so it's no biggie.

This path mismatch and all the errors are probably just because I'm in the main branch, which is the "development area", so as Flare pointed out, I'll switch back to my cloned release branch and manually integrate the fix.

This being said, thank you both a lot for the quick replies and for the help. I'll get back to you if it keeps up the stubbornness. :)

//L

Re: [SOLVED] Potential divide by zero in the GIT source code for Cryengine V.

#5
Hello everyone!

Here I am again with another problem regarding the engine source code. As mentioned before, I've followed that image-based tutorial and with the help I got from Thomas and Flare I was able to compile the engine and everything closes up smoothly. However, I can neither test my engine, nor can I assign it to a project of my own (although I did register it as per instructions, it still seems to not be doing anything and I can't fing the engine in the drop-down list in the switch engine version interface). When I try to test it via setting the Windows Launcher project in Microsoft Visual as StartUp, it gives me one single error: system.cfg file not found then the debugger stops.

Any insight on the matter would be much appreciated!

Best,
//L

Re: Potential divide by zero in the GIT source code for Cryengine V.

#6
If your engine is not showing up in the dropdown menu when switching engine, it means it's not registered yet. You can simply do this by pressing the browse button (the button with "..." as its text) in the Switch Engine dialog, and browsing to the root folder of your engine. Press OK in that folder, and the CryVersionSelector will register a new engine in that location. From there you can launch the game through the .cryproject file.
For debugging the engine with your project with Visual Studio you have to make sure that the Command Arguments are set correctly in the properties of the WindowsLauncher project. To check these, open the properties window of the WindowsLauncher and go to the Debugging category. In here, make sure the Command Arguments are set to:

Code: Select all

-project "path_to_your_cryproject_file"
If a system.cfg file is required in the root folder of the engine you can create this yourself with Notepad. You can add something to it like:

Code: Select all

sys_asserts=1

Re: Potential divide by zero in the GIT source code for Cryengine V.

#7
If your engine is not showing up in the dropdown menu when switching engine, it means it's not registered yet. You can simply do this by pressing the browse button (the button with "..." as its text) in the Switch Engine dialog, and browsing to the root folder of your engine. Press OK in that folder, and the CryVersionSelector will register a new engine in that location. From there you can launch the game through the .cryproject file.
For debugging the engine with your project with Visual Studio you have to make sure that the Command Arguments are set correctly in the properties of the WindowsLauncher project. To check these, open the properties window of the WindowsLauncher and go to the Debugging category. In here, make sure the Command Arguments are set to:

Code: Select all

-project "path_to_your_cryproject_file"
If a system.cfg file is required in the root folder of the engine you can create this yourself with Notepad. You can add something to it like:

Code: Select all

sys_asserts=1
Hi Miron,
Thanks for the reply, I did what you suggested and created the system.cfg and set the command args (they were blank) and it still doesn't debug, it exists after loading the new system.cfg file, outputting System Shutdown!. I think I might be doing something wrong, which path should I give as a command arg? As in, path to which *.cryproject file?

As for the registration, I did what you advised me to and right now the game doesn't start (I have a window openning, but it just remains black) and i can't open it in the editor because it can't find Sandbox.exe - which is understandable, since the file isn't where the cryLauncher is looking for it under ..\engine_root\bin\win_x64. i can only find Game_Server.exe and GameLauncher.exe in there.

Best,
//L

Re: Potential divide by zero in the GIT source code for Cryengine V.

#8
If you compile the release branch from GitHub in "profile" configuration, you can simply:

1. Select all files in the Launcher bin/win_x64/ folder and copy.
2. Paste into your Git bin/win_x64 folder but do not overwrite.

This will copy Sandbox and other required modules. Now you can launch the Sandbox editor with your project.
--

You cannot launch GameLauncher directly. You must provide it a project to launch. Either create a project via the launcher or copy one from the Launcher engine "/Templates/cpp".
Then use the cryproject file from there.

--

Make sure also to copy the engine ".pak" files from the Launcher engine"/engine" folder to your Git engine "/engine" folder.

--

If you still have issues please post your editor/game log file.
Uniflare
CRYENGINE Community Coordinator
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Who is online

Users browsing this forum: No registered users and 0 guests

cron