From: Paul M. <pa...@sa...> - 2005-04-07 00:44:31
|
I'm getting assertion failures in sema_down and sema_up in coregrind/linux/sema.c in valgrind-2.4.0. Since core_os.h defines FUTEX_SEMA to 0, we are using the pipe-based semaphores, not the futex-based ones. (Why? do the futex-based ones not work?) Looking at sema_up/down, I can't see how it can possibly work correctly in the presence of fork(). If the client does a fork(), we do a fork() too, while holding the semaphore. The parent and all its descendents end up using the same pipe (assuming they don't do an execv*), and after a fork, both parent and child will think they hold the token and are entitled to do an up. Consequently we can end up with lots of tokens in the pipe (and I see that happening). What was the intention here? How was this supposed to work? This is on PPC, but this problem isn't PPC-specific AFAICS. Paul. |