Archived

This topic is now archived and is closed to further replies.

Great Milenko

Access Violation in NTDLL.dll (new operator)

Recommended Posts

ok well I''ve tried tracing this like 100 times... still can''t figure out what is wrong... ok well it happens anytime I try to allocate memory in my dll (well at least anytime I use new to do it don''t know about malloc) but in the exe everything is fine... it dosen''t seem to matter how much or how little I try to allocate it dose it... I''ve traced it time and time again... and this is basicaly how it goes... char*temp=new char[strlen(FileName)+1]; -> return _nh_malloc( cb, 1 ); -> return _nh_malloc_dbg(nSize, nhFlag, _NORMAL_BLOCK, NULL, 0); -> _mlock(_HEAP_LOCK); -> EnterCriticalSection( _locktable[locknum] ); NTDLL!77f8ecf1 -> NTDLL!77f8ecf1() -> 77F8ED61 inc dword ptr [eax+10h] SPLAT! First-chance exception in Amethyst Test.exe (NTDLL.DLL): 0xC0000005: Access Violation. Register At This Point EAX = 00000000 EBX = 00000000 ECX = 0012FFB0 EDX = 77FCD190 ESI = 10020388 EDI = 00000000 EIP = 77F8ED61 ESP = 0012FE00 EBP = 0012FE60 EFL = 00000296 CS = 001B DS = 0023 ES = 0023 SS = 0023 FS = 0038 GS = 0000 OV=0 UP=0 EI=1 PL=1 ZR=0 AC=1 PE=1 CY=0 ok well I can see what the problem is... its refrencing a bad memory location... but what I can''t figure out is exactly what the function does... or more importantly what went wrong that I need to fix to make it work again... Anyone got a clue?

Share this post


Link to post
Share on other sites
Does it blow up on the memory allocation, or sometime later only when memory was allocated?

What service pack of MSVC are you using? I''ve run into a very odd bug myself, and I think it occured right after I intalled sp5 - i figured it was just coincidence, but it sounds similar to your problem.

Magmai Kai Holmlor
- The disgruntled & disillusioned

Share this post


Link to post
Share on other sites
ummm its when the memory is locked... I traced through the half million functions =) that get called while the memory is being locked and it final blows up in one of the functions inside NTDLL.dll....

ummm no service pack as far as I know =) its MSVC 5 Pro.... its never happend before and I can''t think of anything thats changed... go fig....

Share this post


Link to post
Share on other sites