As reported in http://gcc.gnu.org/ml/fortran/2011-02/msg00108.html futex_wait is very much broken since http://gcc.gnu.org/ml/gcc-patches/2010-10/msg00256.html There are two problems: 1) the arm futex.h version is broken, as it doesn't pass NULL as the timeout parameter to FUTEX_WAIT or FUTEX_WAIT|FUTEX_PRIVATE. This means the parameter contains random garbage, if it happens to be NULL, fine, otherwise it could contain some valid pointer and risk that the futex times out or it can contain invalid address and thus the syscall can EFAULT right away. 2) as wait.h includes "futex.h", the CPU specific futex.h versions are no longer used.
Created attachment 23334 [details] gcc46-pr47731.patch Untested fix.
Author: jakub Date: Mon Feb 14 15:08:23 2011 New Revision: 170133 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170133 Log: PR libgomp/47731 * config/linux/futex.h (futex_wait): Pass NULL as timeout argument to FUTEX_WAIT futex syscall. * config/linux/wait.h: Include <futex.h> instead of "futex.h". Modified: trunk/libgomp/ChangeLog trunk/libgomp/config/linux/futex.h trunk/libgomp/config/linux/wait.h
Fixed.