The warnings looks like this: ==977== Syscall param semctl(IPC_SET, arg.buf) points to uninitialised byte(s) ==977== at 0x62FA8EA: semctl (in /lib64/libc-2.5.so) ==977== by 0x18705C: ap_unixd_set_proc_mutex_perms (unixd.c:251) ==977== by 0x1870E0: ap_unixd_set_global_mutex_perms (unixd.c:284) ==977== by 0x16FC19: ap_global_mutex_create (util_mutex.c:444) ==977== by 0xAE3D17A: rewritelock_create (mod_rewrite.c:2594) ==977== by 0xAE41730: post_config (mod_rewrite.c:4316) ==977== by 0x15F4B3: ap_run_post_config (config.c:105) ==977== by 0x1365C5: main (main.c:696) ==977== Address 0x7ff000430 is on thread 1's stack ==977== Uninitialised value was created by a stack allocation ==977== at 0x186FB1: ap_unixd_set_proc_mutex_perms (unixd.c:227) Because the semid_ds structure on Linux (as well as FreeBSD and, likely, other Unixes) contains some undocumented fields (such as __unused1 or sem_pad2), explicitly setting each one is not portable -- far simpler to just request, that the entire structure be zeroed at the declaration time: --- os/unix/unixd.c 2011-12-18 13:02:21.000000000 -0500 +++ os/unix/unixd.c 2012-08-09 18:40:55.000000000 -0400 @@ -242,5 +242,5 @@ #endif union semun ick; - struct semid_ds buf; + struct semid_ds buf = { 0 }; apr_os_proc_mutex_get(&ospmutex, pmutex); While the warning is benign, it is better to suppress it, then to needlessly worry people attempting to use valgrind to debug some other problem -- the fewer such false alarms, the better. Earlier releases of httpd have the same issue (I've seen it in 2.2.22 myself).
with that I get unixd.c: In function ‘ap_unixd_set_proc_mutex_perms’: unixd.c:244:20: warning: missing braces around initializer [-Wmissing-braces] unixd.c:244:20: warning: (near initialization for ‘buf.sem_perm’) [-Wmissing-braces]
(In reply to comment #1) > unixd.c: In function ‘ap_unixd_set_proc_mutex_perms’: > unixd.c:244:20: warning: missing braces around initializer [-Wmissing-braces] Yeah, the first field of the semid_ds-structure is also a structure (at least on Linux and FreeBSD), so using two layers of braces should work: struct semid_ds buf = {{ 0 }}; If that's not portable enough, then bzero() might be in order: bzero(&buf, sizeof(buf)); however annoying it might be to have a function-call (even if compiler will optimize it away) just to zero-out an automatic variable :-(
committed to trunk as r1442326