[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PuTTY Trouble

From: Kamal Dalal <kamal at banoora dot net>
ahmad khalifa wrote:

ok, now im almost finished... just having some trouble with some realloc()s...

any hints ?
doing reallocs on terminal resize... reallocing a smaller buffer is ok,
but reallocing a bigger buffer gives me some assertion failure about
the mem block not being of the right type...
anyone know anything about that ?
btw, free() then malloc() does the same thing...
btw2, reallocing occurs when i resize the terminal window...


This can happen if the program is writing to memory that was not allocated to it. Usually memory management functions allocate a buffer and pad it with some signature. When this buffer is given back to free or realloc they check the signature to make sure that the program did not write to a region that is outside of the buffer size. If it finds that the signature is bad then it fires an assertion. Make sure that the program does not right outside the range of an allocated buffer.

thanks a lot, that was exactly the problem... some function being called before the realloc stuff... shokran... :)

Hope this helps.

that helped a lot... btw, is this stuff studied in like compiler design courses and books ? or is it self-gained info ? is it like advanced OS topics and stuff ?



STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail