Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] popen: add missing ev_io initialization
@ 2020-03-23  7:24 Cyrill Gorcunov
  2020-03-23 10:32 ` Nikita Pettik
  0 siblings, 1 reply; 4+ messages in thread
From: Cyrill Gorcunov @ 2020-03-23  7:24 UTC (permalink / raw)
  To: tml

Otherwise it left unitialized and in result
may not work depending on dirty data got from
memory.

Fixes #4811

Reported-by: Nikita Pettik <korablev@tarantool.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
branch gorcunov/gh-4811-popen-coio

 src/lib/core/popen.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c
index a0630e3d9..99bd69b74 100644
--- a/src/lib/core/popen.c
+++ b/src/lib/core/popen.c
@@ -115,12 +115,8 @@ handle_new(struct popen_opts *opts)
 
 	rlist_create(&handle->list);
 
-	/*
-	 * No need to initialize the whole ios structure,
-	 * just set fd value to mark as unused.
-	 */
 	for (i = 0; i < lengthof(handle->ios); i++)
-		handle->ios[i].fd = -1;
+		coio_create(&handle->ios[i], -1);
 
 	say_debug("popen: alloc handle %p command '%s' flags %#x",
 		  handle, handle->command, opts->flags);
-- 
2.20.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Tarantool-patches] [PATCH] popen: add missing ev_io initialization
  2020-03-23  7:24 [Tarantool-patches] [PATCH] popen: add missing ev_io initialization Cyrill Gorcunov
@ 2020-03-23 10:32 ` Nikita Pettik
  2020-03-23 10:44   ` Nikita Pettik
  0 siblings, 1 reply; 4+ messages in thread
From: Nikita Pettik @ 2020-03-23 10:32 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: tml

On 23 Mar 10:24, Cyrill Gorcunov wrote:
> Otherwise it left unitialized and in result
> may not work depending on dirty data got from
> memory.
> 
> Fixes #4811
> 
> Reported-by: Nikita Pettik <korablev@tarantool.org>
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> ---

Hi,

Applying the patch does not fix the problem, but reproduce it
each time unit/ suite is executed :)

> branch gorcunov/gh-4811-popen-coio
> 
>  src/lib/core/popen.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c
> index a0630e3d9..99bd69b74 100644
> --- a/src/lib/core/popen.c
> +++ b/src/lib/core/popen.c
> @@ -115,12 +115,8 @@ handle_new(struct popen_opts *opts)
>  
>  	rlist_create(&handle->list);
>  
> -	/*
> -	 * No need to initialize the whole ios structure,
> -	 * just set fd value to mark as unused.
> -	 */
>  	for (i = 0; i < lengthof(handle->ios); i++)
> -		handle->ios[i].fd = -1;
> +		coio_create(&handle->ios[i], -1);
>  
>  	say_debug("popen: alloc handle %p command '%s' flags %#x",
>  		  handle, handle->command, opts->flags);
> 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Tarantool-patches] [PATCH] popen: add missing ev_io initialization
  2020-03-23 10:32 ` Nikita Pettik
@ 2020-03-23 10:44   ` Nikita Pettik
  2020-03-23 11:09     ` Cyrill Gorcunov
  0 siblings, 1 reply; 4+ messages in thread
From: Nikita Pettik @ 2020-03-23 10:44 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: tml

On 23 Mar 10:32, Nikita Pettik wrote:
> On 23 Mar 10:24, Cyrill Gorcunov wrote:
> > Otherwise it left unitialized and in result
> > may not work depending on dirty data got from
> > memory.
> > 
> > Fixes #4811
> > 
> > Reported-by: Nikita Pettik <korablev@tarantool.org>
> > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> > ---
> 
> Hi,
> 
> Applying the patch does not fix the problem, but reproduce it
> each time unit/ suite is executed :)

Sorry, I was wrong, still fails occasionally.
 
> > branch gorcunov/gh-4811-popen-coio
> > 
> >  src/lib/core/popen.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> > 
> > diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c
> > index a0630e3d9..99bd69b74 100644
> > --- a/src/lib/core/popen.c
> > +++ b/src/lib/core/popen.c
> > @@ -115,12 +115,8 @@ handle_new(struct popen_opts *opts)
> >  
> >  	rlist_create(&handle->list);
> >  
> > -	/*
> > -	 * No need to initialize the whole ios structure,
> > -	 * just set fd value to mark as unused.
> > -	 */
> >  	for (i = 0; i < lengthof(handle->ios); i++)
> > -		handle->ios[i].fd = -1;
> > +		coio_create(&handle->ios[i], -1);
> >  
> >  	say_debug("popen: alloc handle %p command '%s' flags %#x",
> >  		  handle, handle->command, opts->flags);
> > 
> > 2.20.1
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Tarantool-patches] [PATCH] popen: add missing ev_io initialization
  2020-03-23 10:44   ` Nikita Pettik
@ 2020-03-23 11:09     ` Cyrill Gorcunov
  0 siblings, 0 replies; 4+ messages in thread
From: Cyrill Gorcunov @ 2020-03-23 11:09 UTC (permalink / raw)
  To: Nikita Pettik; +Cc: tml

On Mon, Mar 23, 2020 at 10:44:19AM +0000, Nikita Pettik wrote:
> On 23 Mar 10:32, Nikita Pettik wrote:
> > On 23 Mar 10:24, Cyrill Gorcunov wrote:
> > > Otherwise it left unitialized and in result
> > > may not work depending on dirty data got from
> > > memory.
> > > 
> > > Fixes #4811
> > > 
> > > Reported-by: Nikita Pettik <korablev@tarantool.org>
> > > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> > > ---
> > 
> > Hi,
> > 
> > Applying the patch does not fix the problem, but reproduce it
> > each time unit/ suite is executed :)
> 
> Sorry, I was wrong, still fails occasionally.

Been investigating it more -- this patch is redundant actually
and doesn't change anything thus could be dropped. Continue
diggin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-23 11:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23  7:24 [Tarantool-patches] [PATCH] popen: add missing ev_io initialization Cyrill Gorcunov
2020-03-23 10:32 ` Nikita Pettik
2020-03-23 10:44   ` Nikita Pettik
2020-03-23 11:09     ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox