0

I am building up a program and it works fine past few days. When I run it today it shows this Unhandled exception at 0x7770efc8 in LHM.exe: 0xC0000005: Access violation writing location 0x00440f48.

ntdl.dll!7770fb12()
In the call stack below, it indicates that frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll.

And I found the ntdl.dll!7770fb12() is 7770FB12 push esi in the Disassembly.

Is there anyway I can solve this problem?

Ashton
  • 83
  • 1
  • 3
  • 12
  • Need... more... context... – Mark Garcia Jul 05 '13 at 07:41
  • You'll need to post the source code where the problem occurs. – Roger Rowland Jul 05 '13 at 07:41
  • 1
    @RogerRowland since his stack sounds corrupted I'd wager he doesn't know. Best bet is to debug into it and see where it is when it gets the access violation, or look for anything that might be improperly writing to a buffer. – The Forest And The Trees Jul 05 '13 at 07:50
  • This problem came up when I start debugging mode. I have got no idea where or when I goes wrong.. – Ashton Jul 05 '13 at 07:51
  • @TheForestAndtheTrees Yeah. I'm a new programmer. How do I locate the source code where the problem occurs? – Ashton Jul 05 '13 at 08:07
  • Does it only happen in debug? Do you see anything down the stack trace (that's on the debug menu in visual studio) that you recognise as your code? – doctorlove Jul 05 '13 at 08:46
  • @Doctorlove everything works fine. It builds fine, compiled fine but when i run in debugging mode this error pops out. – Ashton Jul 05 '13 at 09:15
  • You should connect a debugger and load the missing symbols from the Microsoft server (just a simple setting in the MSVC debugger) to get a better call stack. – Werner Henze Jul 05 '13 at 10:00
  • @Ashton does this error popup before even entering main()? if so, then my best bet would hunting down static variables ( and their initializers ) – Najzero Jul 05 '13 at 11:11

2 Answers2

2

Even if the call stack doesn't show any specific location with a call in your code eventually leading to ntdll.dll, in most cases you can pinpoint the call by stepping through your code from the beginning. If your code is too big, try to set breakpoints randomly and narrow it down continuously.

This is some very basic and maybe crude debugging procedure but it helps me alot...

thomiel
  • 2,467
  • 22
  • 37
0

'Frames below may be incorrect' is definitely not a sign of corrupted stack. It is easily solvable if you load the public symbols for ntdll from MS servers (done easily from the IDE - say, right click ntdll at the 'modules' window).

A deeper dive is available here.

Ofek Shilon
  • 14,734
  • 5
  • 67
  • 101