stack corrupt around object or variable at close of Prog.

Discussion in 'C++' started by Jeffrey Baker, Jul 6, 2005.

  1. Hi,
    I am recompiling a program from VC++ 5.0 to VC++.NET interface. C++
    Compliance is tighter. I get the
    error message before the program finished that

    stack corrupt around "obj". - this being an object from
    a statement like obj = new Class;

    Does anyone have a clue?

    Regards,
    Jeffrey Baker
     
    Jeffrey Baker, Jul 6, 2005
    #1
    1. Advertising

  2. Jeffrey  Baker

    Howard Guest

    "Jeffrey Baker" <> wrote in message
    news:52Vye.18411$...
    > Hi,
    > I am recompiling a program from VC++ 5.0 to VC++.NET interface. C++
    > Compliance is tighter. I get the
    > error message before the program finished that
    >
    > stack corrupt around "obj". - this being an object from
    > a statement like obj = new Class;
    >
    > Does anyone have a clue?
    >


    You'd need to ask on a microsoft newsgroup or check their documentation if
    you want to know what their error message means precisely.

    But it sounds like you've trashed memory somewhere. One line of code isn't
    likely to help us determine where that might have occurred, however. Have
    you tried debugging the program and watching how your arrays and pointers
    are used? Some likely culprits for memory corruption are using an
    uninitialized or deleted pointer, or writing beyond the bounds of an array.

    -Howard
     
    Howard, Jul 6, 2005
    #2
    1. Advertising

  3. "Howard" <> wrote in message
    news:tfVye.1092045$...
    >
    > "Jeffrey Baker" <> wrote in message
    > news:52Vye.18411$...
    >> Hi,
    >> I am recompiling a program from VC++ 5.0 to VC++.NET interface. C++
    >> Compliance is tighter. I get the
    >> error message before the program finished that
    >>
    >> stack corrupt around "obj". - this being an object from
    >> a statement like obj = new Class;
    >>
    >> Does anyone have a clue?
    >>

    >
    > You'd need to ask on a microsoft newsgroup or check their documentation if
    > you want to know what their error message means precisely.
    >
    > But it sounds like you've trashed memory somewhere. One line of code
    > isn't likely to help us determine where that might have occurred, however.
    > Have you tried debugging the program and watching how your arrays and
    > pointers are used?

    I did try a debug and found a argument to come up with the answer. Looks
    like this:
    an =obj->get( y,in[j], start[j]);

    Message is : Run-Time Check Failure #2 - Stack around the variable 'start'
    was corrupted.

    Jeff
    Some likely culprits for memory corruption are using an
    > uninitialized or deleted pointer, or writing beyond the bounds of an
    > array.
    >
    > -Howard
    >
    >
     
    Jeffrey Baker, Jul 6, 2005
    #3
  4. Hello,

    I found my io file had to many items. Ran ok with a smaller file. It went
    over the compilers default limits to start.

    Regards,
    Jeff

    "Howard" <> wrote in message
    news:tfVye.1092045$...
    >
    > "Jeffrey Baker" <> wrote in message
    > news:52Vye.18411$...
    >> Hi,
    >> I am recompiling a program from VC++ 5.0 to VC++.NET interface. C++
    >> Compliance is tighter. I get the
    >> error message before the program finished that
    >>
    >> stack corrupt around "obj". - this being an object from
    >> a statement like obj = new Class;
    >>
    >> Does anyone have a clue?
    >>

    >
    > You'd need to ask on a microsoft newsgroup or check their documentation if
    > you want to know what their error message means precisely.
    >
    > But it sounds like you've trashed memory somewhere. One line of code
    > isn't likely to help us determine where that might have occurred, however.
    > Have you tried debugging the program and watching how your arrays and
    > pointers are used? Some likely culprits for memory corruption are using
    > an uninitialized or deleted pointer, or writing beyond the bounds of an
    > array.
    >
    > -Howard
    >
    >
     
    Jeffrey Baker, Jul 6, 2005
    #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. Piet
    Replies:
    0
    Views:
    579
  2. pratham
    Replies:
    3
    Views:
    731
    sloan
    Aug 31, 2006
  3. -intl.com
    Replies:
    1
    Views:
    380
    Martin Gregorie
    Oct 22, 2006
  4. Sven
    Replies:
    2
    Views:
    5,162
    tragomaskhalos
    Nov 30, 2007
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    921
    Iñaki Baz Castillo
    Jan 12, 2010
Loading...

Share This Page