CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2005
    Location
    Bangalore, India
    Posts
    99

    how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x000000

    HI,
    Plase tell me how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x00000000".The memory could not be "read". My Application is using Hp Printer to print. First time its printing fine. Second or third time i am getting this problem.
    Thanks.

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x000000

    You are trying to reference a "null" object. Use the debugger to trap where this is occuring, and rectify the problem
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Aug 2005
    Location
    Bangalore, India
    Posts
    99

    Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x000000

    Thanks
    TheCPUWizard
    HOW CAN i DEBUB THE PROBLEM IS OCCURING IN RELEASE MOD NOT IN DEBUG MODE.

  4. #4
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x000000

    just put MessageBox() in your code and run the Project . before that Suggest you run your Project and Check all the Condition for memory allocation and free them .
    Thanx

  5. #5
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x000000

    Quote Originally Posted by laserwave
    Thanks
    TheCPUWizard
    HOW CAN i DEBUB THE PROBLEM IS OCCURING IN RELEASE MOD NOT IN DEBUG MODE.
    It's possible to put debugging information into a Release build but it may or may not help you. Writing an error handling class that is enabled by default in Debug mode, disabled in Release mode - but which can be optionally re-enabled is by far the best way to debug Release build problems. Unfortunately, it's often dificult to add such a class to a program 'after the event'. It's much better if you write with the assumption that there'll be bugs and set traps to catch them.

    Just to give you a bit more info - this kind of problem is almost always caused by not realising that a pointer needs something to point to. You can't use a pointer like this - although people often do....

    Code:
    MyObj* ptr;
    
        ptr->PerformSomeAction();
    In the above example, the pointer is unitialised (i.e. its value is meaningless). It could (by accident) be pointing to a valid object - or it could point to zero memory - or to some completely random memory. The results of using it are unpredictable but usually catastrophic. This kind of thing is even more dangerous:-

    Code:
    MyObj* ptr;
    
        if (ptr)
            ptr->PerformSomeAction();
    In a Debug build, the compiler usually initialises the pointer to a known value. Fortunately, Visual C++ doesn't initialise to NULL - but some compilers do. Therefore that code might behave completely differently in a Release build from how it behaved in the Debug build.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  6. #6
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x000000

    Quote Originally Posted by laserwave
    HOW CAN i DEBUB THE PROBLEM IS OCCURING IN RELEASE MOD NOT IN DEBUG MODE.
    Take a look at this FAQ...

  7. #7
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x000000

    Quote Originally Posted by laserwave
    HOW CAN i DEBUB THE PROBLEM IS OCCURING IN RELEASE MOD NOT IN DEBUG MODE.
    The above suggestions are all good ones, but what about the simplest (to implement) of all. Just use Windbg and degug the executable code itself. With a stack trace in place, it should be fairly simple to isolate the issue and put some of the previous suggestions to use, if the root cause of the problem does not immediately reveal itself....

    [edit: Please note that deguging is quite similar to debubing ]
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  8. #8
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x00

    Quote Originally Posted by humptydumpty
    just put MessageBox() in your code and run the Project . before that Suggest you run your Project and Check all the Condition for memory allocation and free them .
    Thanx
    huh???

    As was suggested, add debug information to a release build and run that in the debugger.

  9. #9
    Join Date
    Dec 2005
    Posts
    642

    Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x00

    Address 0x7c911e58 is in ntdll!RtlpCoalesceFreeBlocks. This suggests your application is causing a heap corruption.

  10. #10
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x00

    Quote Originally Posted by googler
    Address 0x7c911e58 is in ntdll!RtlpCoalesceFreeBlocks.
    Huh? How can you assert something like this? That address might correspond to "ntdll!RtlpCoalesceFreeBlocks" on your machine, and in your specific instance executing one specific executable - but is most likely to be totally different on different machines, with a different memory configuration at that moment.

  11. #11
    Join Date
    Dec 2005
    Posts
    642

    Post Re: how to fix this problem "The instruction at "0x7c911e58"referenced memory at"0x00

    Quote Originally Posted by gstercken
    Huh? How can you assert something like this?
    It was an educated guess. 32-bit ntdll.dll hasn't changed since August 4th, 2004, and these address ranges are reserved for Microsoft's system dlls.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured