Page 1 of 1

BZFS under VC8

Posted: Fri Feb 24, 2006 9:38 pm
by huw
In my previous thread I managed to get everything to compile. So far everything works except for bzfs.

When bzfs (and lots of the other modules for that matter) compile they spit out errors stating that strings have been changed because the code is deprecated.

If I start a p3 optimised version of bzfs it will just crash. However a debug build gives the following error:

Code: Select all

Debug Assertion Failed!
Program: C:\program......\bzfs.exe
File setvbuf.c
Line: 64

Expression: ((2 <=size) && (size <= INT_MAX))

For information....
Is this a problem with code or the way I have compiled it?

Posted: Fri Feb 24, 2006 11:06 pm
by JeffM
I found that the optimised versions were unstable, that is why we went back to "balanced".

build a debug version, run it in the debuger and see where it crashes.

Posted: Fri Feb 24, 2006 11:15 pm
by huw
The error above is the error given by the debug version.

The release and optimised builds just crash straight away

Posted: Mon Mar 06, 2006 5:19 pm
by huw
This error still occurs in todays CVS build

Posted: Mon Mar 06, 2006 5:35 pm
by JeffM
RUN it in the debuger, and see where it crashes. Just building a debug version tells you nothing, you have to USE the debuger with it to see what code has the problem

Posted: Mon Mar 06, 2006 6:20 pm
by huw
Error codes:

Code: Select all

'bzfs.exe': Loaded 'C:\Documents and Settings\Administrator\My Documents\bzflag\Copy of bzflag\src\bzfs\debug\bzfs.exe', Symbols loaded.
'bzfs.exe': Loaded 'NOT_AN_IMAGE', No symbols loaded.
'bzfs.exe': Unloaded 'NOT_AN_IMAGE'
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\ntdll.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\kernel32.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\ws2_32.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\advapi32.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\rpcrt4.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\msvcrt.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\ws2help.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\winmm.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\gdi32.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\user32.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcp80d.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\Documents and Settings\Administrator\My Documents\bzflag\Copy of bzflag\src\bzfs\debug\libcurl.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\shell32.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\shlwapi.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\WinSxS\wow64_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.1830_x-ww_0213CDC8\comctl32.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\ole32.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\Program Files (x86)\MessengerPlus! 3\MsgPlusLoader.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\MSCTF.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\Program Files\Logitech\SetPoint\x86\GameHook32.DLL', No symbols loaded.
'bzfs.exe': Loaded 'C:\Program Files\Logitech\SetPoint\x86\lgscroll32.dll', Binary was not built with debug information.
'bzfs.exe': Loaded 'C:\Program Files\Logitech\SetPoint\x86\msvcr80.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\Program Files\Logitech\SetPoint\x86\msvcp80.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\ntmarta.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\samlib.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\wldap32.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\Program Files\Logitech\SetPoint\x86\HOOKDLL32.DLL', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\mslbui.dll', No symbols loaded.
'bzfs.exe': Loaded 'C:\WINDOWS\SysWOW64\oleaut32.dll', No symbols loaded.
bzfs.exe has triggered a breakpoint
The program '[1288] bzfs.exe: Native' has exited with code 0 (0x0).
Debug window(s) pic:

Image

Any help :?:

Posted: Mon Mar 06, 2006 7:39 pm
by JeffM
no no no, thats just logs. It just shows what was loaded.

you need to break when it crashes and see what C++ code has a problem. This is not something some magic log or text file will just show you. You have to use your C++ knowledge and the debuger to activly track down what is acusing the crash. You set breakpoints around where it's crashing and then step thru the code line by line to see what is wrong.

perhaps you should learn how to use the debuger.

This is something you have to do. not something where you paste an error and we say "oh change that". This is real world development, and debuging.

Posted: Mon Mar 06, 2006 8:23 pm
by mistake
I don't know much about MSVC 8 and its changes to previous version, but it looks that there is the following code in the main() function:

Code: Select all

setvbuf(stdout,(char *)NULL, _IOLBF, 0);
that causes problems with the new msvcr or msvcrt library in that size (the last parameter) is constrained between 2 and INT_MAX.
This is what help says:
Buffer size in bytes. Allowable range: 2 <= size <= INT_MAX (2147483647). Internally, the value supplied for size is rounded down to the nearest multiple of 2.
Maybe in the new version, instead of returning a non-zero value, it throws an exception (ASSERTION), atleast in the debug version.

But I think that the crash for the release build is not due to this code, since assertions are switched off and i doubt that passing an illegal size corrupts the inner state of the crt libraries.

@huwnet: comment the lines saying

Code: Select all

setvbuf(stdout,(char *)NULL, _IOLBF, 0);
setvbuf(stderr,(char *)NULL, _IOLBF, 0);
and see where it goes from there.
or simply wait until Jeff has migrated to MSVC 8 himself.

Posted: Mon Mar 06, 2006 9:42 pm
by huw
mistake, thanks commenting out the lines removed the problems.

Could this or a similar fix please be commited?

Posted: Mon Mar 06, 2006 10:56 pm
by JeffM
that code shoudl not even be called for windows. I have commited a changethat will fix it.

I won't be migrating to VC8. I will not co-exist with 7.1 well.

Posted: Tue Mar 07, 2006 4:48 pm
by huw
Thanks.

/me goes off to update CVS