Board index » cppbuilder » BCB 5, CodeGuard and Win2k

BCB 5, CodeGuard and Win2k

Hi,
I'm using BCB 5 Prof Patch #1 on Win2k SP1 and I've created
an new project (New|Application), left all the project options
to standard except enabling CodeGuard with all options
checked, compiled and executed the project (nothing else!).
After closing the application I was checking the CodeGuard report file.
I was surprised to see mismatched pairs of new/delete
and new[]/delete[] and the difference is always the same:
+5 more new's and +12 more new[]'s, no matter if I add code
to the application or not. BTW the CodeGuard message win
didn't pop up during app's execution, so everything seemed
to be ok.
Now I can't make head or tail of the report file's contents.
Is this a BCB bug ? And if so, where is the bug ?

CodeGuard Protocol:

Called Methods:
 delete (35 times)
 SysFreeMem (276 times)
 SysGetMem (276 times)
 realloc (1 times)
 memcpy (1 times)
 delete[] (2 times)
 free (26 times)
 new[] (14 times)
 new (40 times)
 calloc (5 times)
 malloc (20 times)
Used Resources:
 Object Array (14 Allocs, 13 max)
 Object (40 Allocs, 28 max)
 Memory Block (302 Allocs, 228 max)
Used Modules:
 00400000 07/19/2001 09:01:10 C:\Data\User\projects\general\Project1.exe
 0CD00000 02/03/2000 05:00:00 C:\Programme\Borland\CBuilder5\Bin\CG32.DLL
 32500000 08/07/2000 05:01:00
C:\Programme\Borland\CBuilder5\Bin\CC3250MT.DLL
 40000000 02/03/2000 05:01:00 C:\WINNT\System32\VCL50.BPL
 41000000 02/03/2000 05:00:00
C:\Programme\Borland\CBuilder5\Bin\BORLNDMM.DLL
 6E330000 10/04/2000 15:00:00 C:\WINNT\System32\INDICDLL.dll
 74F90000 10/04/2000 15:00:00 C:\WINNT\System32\WS2HELP.DLL
 74FA0000 10/04/2000 15:00:00 C:\WINNT\System32\WS2_32.DLL
 74FC0000 10/04/2000 15:00:00 C:\WINNT\System32\wsock32.dll
 75000000 10/04/2000 15:00:00 C:\WINNT\system32\mpr.dll
 75260000 10/04/2000 15:00:00 C:\WINNT\System32\oledlg.dll
 75940000 10/04/2000 15:00:00 C:\WINNT\system32\LZ32.DLL
 75DF0000 10/04/2000 15:00:00 C:\WINNT\System32\IMM32.dll
 76B00000 10/04/2000 15:00:00 C:\WINNT\system32\comdlg32.dll
 77580000 10/04/2000 15:00:00 C:\WINNT\system32\SHELL32.DLL
 777F0000 10/04/2000 15:00:00 C:\WINNT\System32\winspool.drv
 77810000 10/04/2000 15:00:00 C:\WINNT\system32\version.dll
 779A0000 10/04/2000 15:00:00 C:\WINNT\system32\oleaut32.dll
 77A40000 10/04/2000 15:00:00 C:\WINNT\system32\ole32.dll
 77B40000 10/04/2000 15:00:00 C:\WINNT\system32\comctl32.dll
 77C60000 10/04/2000 15:00:00 C:\WINNT\system32\SHLWAPI.DLL
 77D30000 10/04/2000 15:00:00 C:\WINNT\system32\RPCRT4.DLL
 77DA0000 10/04/2000 15:00:00 C:\WINNT\system32\advapi32.dll
 77E00000 10/04/2000 15:00:00 C:\WINNT\system32\user32.dll
 77E70000 10/04/2000 15:00:00 C:\WINNT\system32\kernel32.dll
 77F40000 10/04/2000 15:00:00 C:\WINNT\system32\GDI32.DLL
 77F80000 10/04/2000 15:00:00 C:\WINNT\System32\ntdll.dll
 78000000 10/04/2000 15:00:00 C:\WINNT\system32\MSVCRT.DLL
==========================================

Any help is appreciated !
Uwe

 

Re:BCB 5, CodeGuard and Win2k


After carrying out some tests it turned out the reason
for new/delete mismatches is in whether you link the
borland packages statically or dynamically. The problem
occurs only when the bpl/dll's are dynamically linked
to the app like depicted below. Everything is fine when
project options for statically linked lib's are selected,
but the code monsters....
Are there any bug fixes ?
Uwe

Uwe Markert schrieb:

Quote

> Hi,
> I'm using BCB 5 Prof Patch #1 on Win2k SP1 and I've created
> an new project (New|Application), left all the project options
> to standard except enabling CodeGuard with all options
> checked, compiled and executed the project (nothing else!).
> After closing the application I was checking the CodeGuard report file.
> I was surprised to see mismatched pairs of new/delete
> and new[]/delete[] and the difference is always the same:
> +5 more new's and +12 more new[]'s, no matter if I add code
> to the application or not. BTW the CodeGuard message win
> didn't pop up during app's execution, so everything seemed
> to be ok.
> Now I can't make head or tail of the report file's contents.
> Is this a BCB bug ? And if so, where is the bug ?

> CodeGuard Protocol:

> Called Methods:
>  delete (35 times)
>  SysFreeMem (276 times)
>  SysGetMem (276 times)
>  realloc (1 times)
>  memcpy (1 times)
>  delete[] (2 times)
>  free (26 times)
>  new[] (14 times)
>  new (40 times)
>  calloc (5 times)
>  malloc (20 times)
> Used Resources:
>  Object Array (14 Allocs, 13 max)
>  Object (40 Allocs, 28 max)
>  Memory Block (302 Allocs, 228 max)
> Used Modules:
>  00400000 07/19/2001 09:01:10 C:\Data\User\projects\general\Project1.exe
>  0CD00000 02/03/2000 05:00:00 C:\Programme\Borland\CBuilder5\Bin\CG32.DLL
>  32500000 08/07/2000 05:01:00
> C:\Programme\Borland\CBuilder5\Bin\CC3250MT.DLL
>  40000000 02/03/2000 05:01:00 C:\WINNT\System32\VCL50.BPL
>  41000000 02/03/2000 05:00:00
> C:\Programme\Borland\CBuilder5\Bin\BORLNDMM.DLL
>  6E330000 10/04/2000 15:00:00 C:\WINNT\System32\INDICDLL.dll
>  74F90000 10/04/2000 15:00:00 C:\WINNT\System32\WS2HELP.DLL
>  74FA0000 10/04/2000 15:00:00 C:\WINNT\System32\WS2_32.DLL
>  74FC0000 10/04/2000 15:00:00 C:\WINNT\System32\wsock32.dll
>  75000000 10/04/2000 15:00:00 C:\WINNT\system32\mpr.dll
>  75260000 10/04/2000 15:00:00 C:\WINNT\System32\oledlg.dll
>  75940000 10/04/2000 15:00:00 C:\WINNT\system32\LZ32.DLL
>  75DF0000 10/04/2000 15:00:00 C:\WINNT\System32\IMM32.dll
>  76B00000 10/04/2000 15:00:00 C:\WINNT\system32\comdlg32.dll
>  77580000 10/04/2000 15:00:00 C:\WINNT\system32\SHELL32.DLL
>  777F0000 10/04/2000 15:00:00 C:\WINNT\System32\winspool.drv
>  77810000 10/04/2000 15:00:00 C:\WINNT\system32\version.dll
>  779A0000 10/04/2000 15:00:00 C:\WINNT\system32\oleaut32.dll
>  77A40000 10/04/2000 15:00:00 C:\WINNT\system32\ole32.dll
>  77B40000 10/04/2000 15:00:00 C:\WINNT\system32\comctl32.dll
>  77C60000 10/04/2000 15:00:00 C:\WINNT\system32\SHLWAPI.DLL
>  77D30000 10/04/2000 15:00:00 C:\WINNT\system32\RPCRT4.DLL
>  77DA0000 10/04/2000 15:00:00 C:\WINNT\system32\advapi32.dll
>  77E00000 10/04/2000 15:00:00 C:\WINNT\system32\user32.dll
>  77E70000 10/04/2000 15:00:00 C:\WINNT\system32\kernel32.dll
>  77F40000 10/04/2000 15:00:00 C:\WINNT\system32\GDI32.DLL
>  77F80000 10/04/2000 15:00:00 C:\WINNT\System32\ntdll.dll
>  78000000 10/04/2000 15:00:00 C:\WINNT\system32\MSVCRT.DLL
> ==========================================

> Any help is appreciated !
> Uwe

Other Threads