Welcome! Log In Create A New Profile

Advanced

Re: Fixed use-of-uninitialized-value inside ngx_epoll_test_rdhup.

Maxim Dounin
June 18, 2020 10:44AM
Hello!

On Wed, Jun 17, 2020 at 06:55:36PM -0700, Thibault Charbonnier wrote:

> # HG changeset patch
> # User Thibault Charbonnier <thibaultcha@me.com>
> # Date 1592445047 25200
> # Wed Jun 17 18:50:47 2020 -0700
> # Node ID 3b1e0c7867c40fc82455b5c5dbf1d2e1521c1c8b
> # Parent 8cf31489b479b689b7ff4a9601ce24c914d0394c
> Fixed use-of-uninitialized-value inside ngx_epoll_test_rdhup.
>
> An issue detected by Valgrind.
>
> diff -r 8cf31489b479 -r 3b1e0c7867c4 src/event/modules/ngx_epoll_module.c
> --- a/src/event/modules/ngx_epoll_module.c Mon Jun 15 17:35:26 2020 -0400
> +++ b/src/event/modules/ngx_epoll_module.c Wed Jun 17 18:50:47 2020 -0700
> @@ -473,6 +473,8 @@
> return;
> }
>
> + ngx_memzero(&ee, sizeof(struct epoll_event));
> +
> ee.events = EPOLLET|EPOLLIN|EPOLLRDHUP;
>
> if (epoll_ctl(ep, EPOLL_CTL_ADD, s[0], &ee) == -1) {

What makes you think that there is a use of uninitialized value
here?

Note that Valgrind tends to complain about "use of ..." for each
and every bit of uninitialized data passed to the kernel, even if
the data is not used. While there are no objections to adding
ngx_memzero() to silence these Valgrind complaints, these changes
are to be documented as fixing Valgrid complaints, not real
problems, see 5245:711fa02afae8 and 5252:982678c5c270 for examples.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Fixed use-of-uninitialized-value inside ngx_epoll_test_rdhup.

Thibault Charbonnier 60 June 17, 2020 09:58PM

Re: Fixed use-of-uninitialized-value inside ngx_epoll_test_rdhup.

Maxim Dounin 20 June 18, 2020 10:44AM



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

Online Users

Guests: 47
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready