Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Bugs

[Bug 53690] Calls to semctl() trigger "uninitialized memory" warning from valgrind

 

 

Apache bugs RSS feed   Index | Next | Previous | View Threaded


bugzilla at apache

Aug 9, 2012, 4:19 PM

Post #1 of 2 (65 views)
Permalink
[Bug 53690] Calls to semctl() trigger "uninitialized memory" warning from valgrind

https://issues.apache.org/bugzilla/show_bug.cgi?id=53690

--- Comment #1 from Jeff Trawick <trawick [at] apache> ---
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]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe [at] httpd
For additional commands, e-mail: bugs-help [at] httpd


bugzilla at apache

Aug 9, 2012, 7:16 PM

Post #2 of 2 (59 views)
Permalink
[Bug 53690] Calls to semctl() trigger "uninitialized memory" warning from valgrind [In reply to]

https://issues.apache.org/bugzilla/show_bug.cgi?id=53690

--- Comment #2 from Mikhail T. <mi+apache [at] aldan> ---
(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 :-(

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe [at] httpd
For additional commands, e-mail: bugs-help [at] httpd

Apache bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.