Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. (Another) Debug VS Release crash - help needed!

(Another) Debug VS Release crash - help needed!

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpvisual-studiocomdebugging
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JonCage
    wrote on last edited by
    #1

    Okay, I've been struggling with this problem for the best part of a week now. If I don't find a solution soon, my PC's going for a flying lesson :mad: I'm developing an MFC app, in VC++ 6.0 with the latest service patch applied, running on Windows NT. The program works fine in debug mode, but dies a horrible death in debug mode. "The instruction at "0x00918ec3" referenced memory at "0x00002301". The memory could not be "written". Here's what I've tried so far... 1) Message boxes to try and pinpoint where the crash is occurring. After a bit of trial and error, the crash appears to occur sometime after a call in the application part of the code 'MyApp.cpp' : 'if (!ProcessShellCommand(cmdInfo))'. The crash occurs after this call is made, but before it returns. The last part of my own code that is called (as far as I can tell) is 'OnInitialUpdate' which is within the view. Now as far as I can see, it looks like the crash isn't happening in any of my code. No doubt it's somthing I've done, I just can't see where I did it! 2) Having drawn a blank with my usual method of release-mode debugging, I turned to google. I've read most of the debugging tutorials here on codeproject now and thought this might herald an answer, but the crash address doesn't appear to be relevent to either the program itself or any of the .dlls it loads (I used dependancy walker to have a look at what it uses). Their base addresses seem to be in the range 0x5F400000 (MFC42.dll) to 0x780C0000 (MSVCP60.dll) - nowhere near "0x00918ec3"! Have I missed / mis-understood anything obvious? What should I try next? I'd appreciate any suggestions you may have - thanks very much in advance! Success is 99% failure

    A A P 3 Replies Last reply
    0
    • J JonCage

      Okay, I've been struggling with this problem for the best part of a week now. If I don't find a solution soon, my PC's going for a flying lesson :mad: I'm developing an MFC app, in VC++ 6.0 with the latest service patch applied, running on Windows NT. The program works fine in debug mode, but dies a horrible death in debug mode. "The instruction at "0x00918ec3" referenced memory at "0x00002301". The memory could not be "written". Here's what I've tried so far... 1) Message boxes to try and pinpoint where the crash is occurring. After a bit of trial and error, the crash appears to occur sometime after a call in the application part of the code 'MyApp.cpp' : 'if (!ProcessShellCommand(cmdInfo))'. The crash occurs after this call is made, but before it returns. The last part of my own code that is called (as far as I can tell) is 'OnInitialUpdate' which is within the view. Now as far as I can see, it looks like the crash isn't happening in any of my code. No doubt it's somthing I've done, I just can't see where I did it! 2) Having drawn a blank with my usual method of release-mode debugging, I turned to google. I've read most of the debugging tutorials here on codeproject now and thought this might herald an answer, but the crash address doesn't appear to be relevent to either the program itself or any of the .dlls it loads (I used dependancy walker to have a look at what it uses). Their base addresses seem to be in the range 0x5F400000 (MFC42.dll) to 0x780C0000 (MSVCP60.dll) - nowhere near "0x00918ec3"! Have I missed / mis-understood anything obvious? What should I try next? I'd appreciate any suggestions you may have - thanks very much in advance! Success is 99% failure

      A Offline
      A Offline
      antlers
      wrote on last edited by
      #2

      Almost certainly you are overwriting the stack somewhere before you call ProcessShellCommand. If you can't find the mistake by inspection (get someone else's eyes on it) and you don't want to invest in something like BoundsChecker or Purify, you might try a technique I've used in similar situations: Comment out suspect code until the crash goes away, then uncomment some until the crash comes back, and use a binary search to narrow down onto your mistake.

      1 Reply Last reply
      0
      • J JonCage

        Okay, I've been struggling with this problem for the best part of a week now. If I don't find a solution soon, my PC's going for a flying lesson :mad: I'm developing an MFC app, in VC++ 6.0 with the latest service patch applied, running on Windows NT. The program works fine in debug mode, but dies a horrible death in debug mode. "The instruction at "0x00918ec3" referenced memory at "0x00002301". The memory could not be "written". Here's what I've tried so far... 1) Message boxes to try and pinpoint where the crash is occurring. After a bit of trial and error, the crash appears to occur sometime after a call in the application part of the code 'MyApp.cpp' : 'if (!ProcessShellCommand(cmdInfo))'. The crash occurs after this call is made, but before it returns. The last part of my own code that is called (as far as I can tell) is 'OnInitialUpdate' which is within the view. Now as far as I can see, it looks like the crash isn't happening in any of my code. No doubt it's somthing I've done, I just can't see where I did it! 2) Having drawn a blank with my usual method of release-mode debugging, I turned to google. I've read most of the debugging tutorials here on codeproject now and thought this might herald an answer, but the crash address doesn't appear to be relevent to either the program itself or any of the .dlls it loads (I used dependancy walker to have a look at what it uses). Their base addresses seem to be in the range 0x5F400000 (MFC42.dll) to 0x780C0000 (MSVCP60.dll) - nowhere near "0x00918ec3"! Have I missed / mis-understood anything obvious? What should I try next? I'd appreciate any suggestions you may have - thanks very much in advance! Success is 99% failure

        A Offline
        A Offline
        Anders Molin
        wrote on last edited by
        #3

        You are probably doing some wild write, that is, writing at memory you dont have allocated... Any chance you are writing a single byte too much into a buffer somehwere? When compiling a debug version there is left some extra space at the begining and end of buffers, so you might not notice it there. Try some of the CRT debug functions, they are pretty good at tracking such things... - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application[^]

        My Photos[^]

        2 1 Reply Last reply
        0
        • A Anders Molin

          You are probably doing some wild write, that is, writing at memory you dont have allocated... Any chance you are writing a single byte too much into a buffer somehwere? When compiling a debug version there is left some extra space at the begining and end of buffers, so you might not notice it there. Try some of the CRT debug functions, they are pretty good at tracking such things... - Anders Money talks, but all mine ever says is "Goodbye!" ShotKeeper, my Photo Album / Organizer Application[^]

          My Photos[^]

          2 Offline
          2 Offline
          224917
          wrote on last edited by
          #4

          do you have any commandline parameters set in ide...


          greatest thing is to do wot others think you cant
          suhredayan@omniquad.com

          messenger :suhredayan@hotmail.com

          J 1 Reply Last reply
          0
          • 2 224917

            do you have any commandline parameters set in ide...


            greatest thing is to do wot others think you cant
            suhredayan@omniquad.com

            messenger :suhredayan@hotmail.com

            J Offline
            J Offline
            JonCage
            wrote on last edited by
            #5

            Nope, no parameters are set. I think the framework creates a new document within the call though so I guess somewhere in there, I'm doing something dodgy. I'll have another look tomorrow (if I get over this stupid tummy bug!). Success is 99% failure

            1 Reply Last reply
            0
            • J JonCage

              Okay, I've been struggling with this problem for the best part of a week now. If I don't find a solution soon, my PC's going for a flying lesson :mad: I'm developing an MFC app, in VC++ 6.0 with the latest service patch applied, running on Windows NT. The program works fine in debug mode, but dies a horrible death in debug mode. "The instruction at "0x00918ec3" referenced memory at "0x00002301". The memory could not be "written". Here's what I've tried so far... 1) Message boxes to try and pinpoint where the crash is occurring. After a bit of trial and error, the crash appears to occur sometime after a call in the application part of the code 'MyApp.cpp' : 'if (!ProcessShellCommand(cmdInfo))'. The crash occurs after this call is made, but before it returns. The last part of my own code that is called (as far as I can tell) is 'OnInitialUpdate' which is within the view. Now as far as I can see, it looks like the crash isn't happening in any of my code. No doubt it's somthing I've done, I just can't see where I did it! 2) Having drawn a blank with my usual method of release-mode debugging, I turned to google. I've read most of the debugging tutorials here on codeproject now and thought this might herald an answer, but the crash address doesn't appear to be relevent to either the program itself or any of the .dlls it loads (I used dependancy walker to have a look at what it uses). Their base addresses seem to be in the range 0x5F400000 (MFC42.dll) to 0x780C0000 (MSVCP60.dll) - nowhere near "0x00918ec3"! Have I missed / mis-understood anything obvious? What should I try next? I'd appreciate any suggestions you may have - thanks very much in advance! Success is 99% failure

              P Offline
              P Offline
              Paul Ranson
              wrote on last edited by
              #6

              You can do a release build with debugging information. Single stepping can be 'odd' and the debugger can get confused about variable names (sometimes they have been optimised away, for example) but being able to see the call stack etc can be invaluable. Paul

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups