From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4B7579C8.3010303@domain.hid> Date: Fri, 12 Feb 2010 16:54:48 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <4B757217.3060406@domain.hid> <4B757306.5070102@domain.hid> <4B7575B9.2060707@domain.hid> In-Reply-To: <4B7575B9.2060707@domain.hid> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-core] Yet another ((weak)) bug List-Id: Xenomai life and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: xenomai-core Jan Kiszka wrote: > Gilles Chanteperdrix wrote: >> Jan Kiszka wrote: >>> Hi Gilles, >>> >>> this one requires some fixing too: >>> >>> xeno_sem_heap is marked weak. xeno_init_sem_heaps is called once per >>> initialized skin. It unmaps any existing heap and creates a new one. >>> That's already fragile during constructor run, but it's lethal during >>> process runtime, ie. when using dlopen. >>> >>> I think the solution is to handle forks separately and only remap in >>> that case. Digging in this direction now. >>> >>> BTW, what triggers the re-run of xeno_init_sem_heaps after a fork so far? >> It must be done for the child process to get a private heap different >> from the parent process. I would guess it is handled by pthread_atfork. > > Ah, only the POSIX skin does that. However, sem-heaps must not be > POSIX-only. OK, patch in the make. Actually, xeno_skin_bind_opt should call pthread_atfork, since the child process should be bound again, whatever the skin. -- Gilles.