dcsimg
Access Violation error when trying to delete pointers(using delete) in C++.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mahankali_Praveena
Posted On:   Thursday, May 11, 2006 12:33 AM

I am delevoping a dll in C++. I am using pointers. I have allocated memory to a pointer using "new". After its usage, I am deallocating memory using "delete". I am getting an Access Violation error when I do "delete". code: char* cptr = new char[200]; ......... ....... .... delete[]cptr; It would be a great help if any one can guide me how to overcome this problem, as it is a show stopper. Error Log: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x77F83AED Function=RtlSizeH   More>>

I am delevoping a dll in C++.
I am using pointers.

I have allocated memory to a pointer using "new".
After its usage, I am deallocating memory using "delete".

I am getting an Access Violation error when I do "delete".

code:

char* cptr = new char[200];
.........
.......
....

delete[]cptr;

It would be a great help if any one can guide me how to overcome this problem, as it is a show stopper.



Error Log:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x77F83AED
Function=RtlSizeHeap+0x7D7
Library=C:WINNTSystem32
tdll.dll

Dynamic libraries:
0x00400000 - 0x0040B000 C:Program FilesJavaj2re1.4.2_06 injavaw.exe
0x77F50000 - 0x77FF7000 C:WINNTSystem32
tdll.dll
0x77E60000 - 0x77F46000 C:WINNTsystem32kernel32.dll
0x77DD0000 - 0x77E5D000 C:WINNTsystem32ADVAPI32.dll
0x78000000 - 0x78087000 C:WINNTsystem32RPCRT4.dll
0x77D40000 - 0x77DCD000 C:WINNTsystem32USER32.dll
0x7F000000 - 0x7F042000 C:WINNTsystem32GDI32.dll
0x77C10000 - 0x77C63000 C:WINNTsystem32MSVCRT.dll
0x76390000 - 0x763AC000 C:WINNTSystem32IMM32.DLL
0x629C0000 - 0x629C8000 C:WINNTSystem32LPK.DLL
0x72FA0000 - 0x72FFA000 C:WINNTSystem32USP10.dll
0x08000000 - 0x08139000 C:Program FilesJavaj2re1.4.2_06 inclientjvm.dll
0x76B40000 - 0x76B6C000 C:WINNTSystem32WINMM.dll
0x10000000 - 0x10007000 C:Program FilesJavaj2re1.4.2_06 inhpi.dll
0x003E0000 - 0x003EE000 C:Program FilesJavaj2re1.4.2_06 inverify.dll
0x008A0000 - 0x008B9000 C:Program FilesJavaj2re1.4.2_06 injava.dll
0x003F0000 - 0x003FD000 C:Program FilesJavaj2re1.4.2_06 inzip.dll
0x02EA0000 - 0x02ED7000 D:PlatinumlibDCC_EBAPIWrapper.dll
0x02EF0000 - 0x02F02000 C:WINNTSystem32EBAPI.dll
0x02F10000 - 0x02F21000 C:WINNTSystem32eEBUtil.DLL
0x02F50000 - 0x02F71000 C:WINNTSystem32eEBAPI.DLL
0x73000000 - 0x73023000 C:WINNTSystem32WINSPOOL.DRV
0x71B20000 - 0x71B31000 C:WINNTsystem32MPR.dll
0x03070000 - 0x0307F000 C:Program FilesJavaj2re1.4.2_06 in
et.dll
0x71AB0000 - 0x71AC5000 C:WINNTSystem32WS2_32.dll
0x71AA0000 - 0x71AA8000 C:WINNTSystem32WS2HELP.dll
0x76C90000 - 0x76CB2000 C:WINNTsystem32imagehlp.dll
0x6D510000 - 0x6D58D000 C:WINNTsystem32DBGHELP.dll
0x77C00000 - 0x77C07000 C:WINNTsystem32VERSION.dll
0x76BF0000 - 0x76BFB000 C:WINNTSystem32PSAPI.DLL

Heap at VM Abort:
Heap
def new generation total 576K, used 266K [0x10010000, 0x100b0000, 0x104f0000)
eden space 512K, 48% used [0x10010000, 0x1004da00, 0x10090000)
from space 64K, 30% used [0x100a0000, 0x100a4eb0, 0x100b0000)
to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000)
tenured generation total 1408K, used 182K [0x104f0000, 0x10650000, 0x14010000)
the space 1408K, 12% used [0x104f0000, 0x1051d9b0, 0x1051da00, 0x10650000)
compacting perm gen total 4096K, used 1917K [0x14010000, 0x14410000, 0x18010000)
the space 4096K, 46% used [0x14010000, 0x141ef698, 0x141ef800, 0x14410000)

Local Time = Thu May 11 10:52:11 2006
Elapsed Time = 15
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode)
#

   <<Less
About | Sitemap | Contact