POSIX.1-2001 says: RETURN VALUE If initstate() is called with size less than 8, it shall return NULL. glibc sets errno to EINVAL for this case, but does not return NULL, thus violating the standard.
Created attachment 6990 [details] Test case Test case to demonstrate the bug $ ./a.out 0x35b1fb00a0 errno=22
Thanks, fixed for glibc 2.18 now. commit 9ce3b2cbd245abedc6cff147a1b91566e340edb1 Author: Andreas Jaeger <aj@suse.de> Date: Mon Apr 29 21:02:16 2013 +0200