Welcome! Log In Create A New Profile

Advanced

[PATCH]Valgind: a complaint about uninitialized bytes in epoll_data_t

cubicdaiya
July 01, 2013 01:26PM
Hello!

In Debian squeeze 32bit,
Valgrind outputs the following message to nginx.

==17124== Syscall param epoll_ctl(event) points to uninitialised byte(s)
==17124== at 0x418F9CE: epoll_ctl (syscall-template.S:82)
==17124== by 0x805FB35: ngx_event_process_init (ngx_event.c:853)
==17124== by 0x8065A5B: ngx_worker_process_init (ngx_process_cycle.c:973)
==17124== by 0x8065EB8: ngx_worker_process_cycle
(ngx_process_cycle.c:740)
==17124== by 0x8064815: ngx_spawn_process (ngx_process.c:198)
==17124== by 0x8065442: ngx_start_worker_processes
(ngx_process_cycle.c:364)
==17124== by 0x80664A6: ngx_master_process_cycle
(ngx_process_cycle.c:136)
==17124== by 0x804BA45: main (nginx.c:412)
==17124== Address 0xbe995f6c is on thread 1's stack
==17124==
==17124== Syscall param epoll_ctl(event) points to uninitialised byte(s)
==17124== at 0x418F9CE: epoll_ctl (syscall-template.S:82)
==17124== by 0x8063810: ngx_add_channel_event (ngx_channel.c:240)
==17124== by 0x8065B5D: ngx_worker_process_init
(ngx_process_cycle.c:1009)
==17124== by 0x8065EB8: ngx_worker_process_cycle
(ngx_process_cycle.c:740)
==17124== by 0x8064815: ngx_spawn_process (ngx_process.c:198)
==17124== by 0x8065442: ngx_start_worker_processes
(ngx_process_cycle.c:364)
==17124== by 0x80664A6: ngx_master_process_cycle
(ngx_process_cycle.c:136)
==17124== by 0x804BA45: main (nginx.c:412)
==17124== Address 0xbe99601c is on thread 1's stack

The following patch eliminates this warning. Could you take a look at it?

# HG changeset patch
# User Tatsuhiko Kubo <cubicdaiya@gmail.com>
# Date 1372689447 -32400
# Node ID cd8fd5cd74294554bb3777821e8703cf0fdf61d7
# Parent b66ec10e901a6fa0fc19937ceeb52b5ea1fbb706
Valgrind: the complaint about uninitialized bytes in epoll_data_t.

diff -r b66ec10e901a -r cd8fd5cd7429 src/event/modules/ngx_epoll_module.c
--- a/src/event/modules/ngx_epoll_module.c Fri Jun 28 13:55:05 2013 +0400
+++ b/src/event/modules/ngx_epoll_module.c Mon Jul 01 23:37:27 2013 +0900
@@ -417,6 +417,9 @@
}

ee.events = events | (uint32_t) flags;
+
+ ngx_memzero(&ee.data, sizeof(epoll_data_t));
+
ee.data.ptr = (void *) ((uintptr_t) c | ev->instance);

ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,

# environment

## uname -a

Linux squeeze32 2.6.32-5-686 #1 SMP Fri May 10 08:33:48 UTC 2013 i686
GNU/Linux

## nginx -V

nginx version: nginx/1.5.2
built by gcc 4.4.5 (Debian 4.4.5-8)
configure arguments: --with-pcre

--
Tatsuhiko Kubo

E-Mail : cubicdaiya@gmail.com
HP : http://cccis.jp/index_en.html
Twitter : http://twitter.com/cubicdaiya
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH]Valgind: a complaint about uninitialized bytes in epoll_data_t Attachments

cubicdaiya 3005 July 01, 2013 01:26PM

Re: [PATCH]Valgind: a complaint about uninitialized bytes in epoll_data_t

Maxim Dounin 890 July 01, 2013 02:26PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 306
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready