8 Jan 2003 18:23
Garbage collector bug
I have written a program in ANSI C that is supposed to work under any platform and for any C compiler. After checking that it does work under Windows and various UNIX system, I released it. Than I got a report that it doesn't work properly when compiled using gcc, which uses built-in garbage collector. After some investigation, I understood that there happened the following problem : At some stage of program's running there where 2 memory blocks A and B, A holding pointers to B. Than A was reallocated : A = realloc(A,...). A was copied to another location holding the same data and the same pointers to B. But, the data in B have changed! It shouldn't have happened and it doesn't happen with other compilers. I suspect, that the garbage collector thinks that nobody points to B while A is being reallocated and frees B. Regards, Nadel Alexander NDS phone : 02-5894632 fax : 02-5894825 __________________________________________________________ Information contained in this email message is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to(Continue reading)
Thanks, Hans.
Mike
> From: "Boehm, Hans" <
RSS Feed