Re: forking heap question



>Neither do I think it's possible. Yet, it is so. Maybe a failed malloc()

no its not. virtual address spaces make it so. children have no access
to their parent's address space. global variables make no difference.

>or free() makes the child access a gtk widget it's not supposed to, via
>some globally defined variable. This is the offending code executed by
>the child (the complete file is xtree_cpy.c from program xftree of the
>xfce desktop environment with CVS at sourceforge.net):
>
>The recursive call makes the parent fail quickly. The non recursive call
>also makes it
>fail, as long as the child executes it the subroutined enough number of
>times. 

have you checked that the recursion bottoms out? if the child uses all
of available RAM (physical and swap), the parent will make
a malloc call that returns NULL.



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