httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 53690] New: Calls to semctl() trigger "uninitialized memory" warning from valgrind
Date Thu, 09 Aug 2012 22:51:05 GMT

          Priority: P3
            Bug ID: 53690
          Keywords: PatchAvailable
           Summary: Calls to semctl() trigger "uninitialized memory"
                    warning from valgrind
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Hardware: All
            Status: NEW
           Version: 2.4.2
         Component: Core
           Product: Apache httpd-2

The warnings looks like this:
==977== Syscall param semctl(IPC_SET, arg.buf) points to uninitialised byte(s)
==977==    at 0x62FA8EA: semctl (in /lib64/
==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 @@
             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).

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message