From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v7 2/2] fiber: leak slab if unable to bring prots back
Date: Fri, 14 Feb 2020 11:25:18 +0300 [thread overview]
Message-ID: <20200214082518.GU21061@uranus> (raw)
In-Reply-To: <2291dd87-04c7-dd92-d8aa-e56ad46e4681@tarantool.org>
On Fri, Feb 14, 2020 at 12:26:04AM +0100, Vladislav Shpilevoy wrote:
> > --- a/test/unit/fiber_stack.c
> > +++ b/test/unit/fiber_stack.c
> > @@ -59,6 +58,30 @@ main_f(va_list ap)
> > ok(fiber != NULL, "madvise: non critical error on madvise hint");
> > ok(diag_get() != NULL, "madvise: diag is armed after error");
> >
> > + /*
> > + * Check if we leak on fiber descrution.
>
> 1. You probably have meant 'destruction'.
Sharp eyes =) Thanks!
> > +
> > + fiber_attr_delete(fiber_attr);
>
> 2. When I run the test without the fix, I got 'Bus error'.
> Was it intended? In my email I proposed to compare memory
Hmm. Actually not, should not be. I'll dig into, thanks!
> statistics, but crash also looks ok, maybe. If this is what
> you meant. And then there should be a comment saying, that we
> expect fiber_join() to crash when no leak is done, because it
> would put the slab into the cash, where it would be read/written
> against protection. This was not obvious until I reverted your
> patch and run the test.
I'll try to play with statistics again, the error message
was just simplier and faster.
> IMO, problem of that way of testing is that if internals of
> core/fiber.c one day will stop touching stack of a just
> destroyed fiber (for example, a pointer at it would be cached
> somewhere for newer fibers), this test will happily pass, even
> though it perhaps should not. It will pass regardless of what
> happens with a fiber stack unless something tries to read/write
> it.
Thanks for comments!
Cyrill
next prev parent reply other threads:[~2020-02-14 8:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 20:56 [Tarantool-patches] [PATCH v7 0/2] fiber: Handle stack madvise/mprotect errors Cyrill Gorcunov
2020-02-13 20:56 ` [Tarantool-patches] [PATCH v7 1/2] fiber: set diagnostics at madvise/mprotect failure Cyrill Gorcunov
2020-02-13 23:26 ` Vladislav Shpilevoy
2020-02-14 7:54 ` Cyrill Gorcunov
2020-02-14 22:27 ` Vladislav Shpilevoy
2020-02-15 6:57 ` Cyrill Gorcunov
2020-02-15 15:41 ` Vladislav Shpilevoy
2020-02-15 17:55 ` Cyrill Gorcunov
2020-02-13 20:56 ` [Tarantool-patches] [PATCH v7 2/2] fiber: leak slab if unable to bring prots back Cyrill Gorcunov
2020-02-13 23:26 ` Vladislav Shpilevoy
2020-02-14 8:25 ` Cyrill Gorcunov [this message]
2020-02-13 20:57 ` [Tarantool-patches] [PATCH v7 0/2] fiber: Handle stack madvise/mprotect errors Cyrill Gorcunov
2020-02-13 23:26 ` Vladislav Shpilevoy
2020-02-14 7:07 ` Cyrill Gorcunov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200214082518.GU21061@uranus \
--to=gorcunov@gmail.com \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v7 2/2] fiber: leak slab if unable to bring prots back' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox