Error diagnosis

Discussion in 'C++' started by SteveB, Nov 27, 2006.

  1. SteveB

    SteveB Guest

    Hello All

    We have an app that was written a few years ago in which the developers

    wrote an entire exception handling system.


    I have a problem with the following line if code:


    OutStream << L" (+ " << std::dec <<
    static_cast<DWORD>(Disp64) << L" bytes), ";


    This is throwing the following exception:


    Run-Time Check Failure #2 - Stack around the variable 'stIHM' was
    corrupted.


    I was wondering if anyone could interpret what the line of code is
    actually doing and what the error means - a Google search has proved
    fruitless


    Thanks


    Steve
    SteveB, Nov 27, 2006
    #1
    1. Advertising

  2. SteveB

    Daniel T. Guest

    "SteveB" <> wrote:

    > We have an app that was written a few years ago in which the
    > developers
    >
    > wrote an entire exception handling system.
    >
    > I have a problem with the following line if code:
    >
    > OutStream << L" (+ " << std::dec <<
    > static_cast<DWORD>(Disp64) << L" bytes), ";
    >
    >
    > This is throwing the following exception:
    >
    > Run-Time Check Failure #2 - Stack around the variable 'stIHM' was
    > corrupted.
    >
    > I was wondering if anyone could interpret what the line of code is
    > actually doing and what the error means - a Google search has proved
    > fruitless


    What the line of code is actually doing depends on what type OutStream
    is and how the op<<'s have been defined.

    Based on the wording, I assume the error means that some piece of code
    is clobbering your stack (i.e., writing to memory it doesn't have rights
    to.) To find the real meaning, you will have to investigate your code
    and or ask in a newsgroup that discusses your runtime system.

    --
    To send me email, put "sheltie" in the subject.
    Daniel T., Nov 27, 2006
    #2
    1. Advertising

  3. SteveB wrote:
    > Hello All
    >
    > We have an app that was written a few years ago in which the developers
    >
    > wrote an entire exception handling system.
    >
    >
    > I have a problem with the following line if code:
    >
    >
    > OutStream << L" (+ " << std::dec <<
    > static_cast<DWORD>(Disp64) << L" bytes), ";
    >
    >
    > This is throwing the following exception:
    >
    >
    > Run-Time Check Failure #2 - Stack around the variable 'stIHM' was
    > corrupted.
    >
    >
    > I was wondering if anyone could interpret what the line of code is
    > actually doing and what the error means - a Google search has proved
    > fruitless


    My bet is that you overwrite memory somewhere else and here
    only the error is discovered.

    <OT>You might want to use a tool such as electricfence or valgrind
    to find the exact spot.
    </OT>

    HTH,
    - J.
    Jacek Dziedzic, Nov 27, 2006
    #3
  4. SteveB

    SteveB Guest

    Jacek Dziedzic wrote:
    > SteveB wrote:
    > > Hello All
    > >
    > > We have an app that was written a few years ago in which the developers
    > >
    > > wrote an entire exception handling system.
    > >
    > >
    > > I have a problem with the following line if code:
    > >
    > >
    > > OutStream << L" (+ " << std::dec <<
    > > static_cast<DWORD>(Disp64) << L" bytes), ";
    > >
    > >
    > > This is throwing the following exception:
    > >
    > >
    > > Run-Time Check Failure #2 - Stack around the variable 'stIHM' was
    > > corrupted.
    > >
    > >
    > > I was wondering if anyone could interpret what the line of code is
    > > actually doing and what the error means - a Google search has proved
    > > fruitless

    >
    > My bet is that you overwrite memory somewhere else and here
    > only the error is discovered.
    >
    > <OT>You might want to use a tool such as electricfence or valgrind
    > to find the exact spot.
    > </OT>
    >
    > HTH,
    > - J.


    I'll look into these apps, thanks

    Steve
    SteveB, Nov 28, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hfk0
    Replies:
    2
    Views:
    21,629
  2. JavaQueries
    Replies:
    1
    Views:
    3,614
    John C. Bollinger
    Mar 1, 2005
  3. Hats
    Replies:
    0
    Views:
    554
  4. Guest
    Replies:
    1
    Views:
    322
    Walter Wang [MSFT]
    Aug 2, 2006
  5. mich
    Replies:
    2
    Views:
    310
    Jarek Zgoda
    Oct 19, 2007
Loading...

Share This Page