* [tarantool-patches] [PATCH] sql: fix lemon memory leak reported by ASAN
@ 2019-01-05 13:13 Alexander Turenko
2019-01-09 7:20 ` [tarantool-patches] " Kirill Yukhin
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Turenko @ 2019-01-05 13:13 UTC (permalink / raw)
To: Nikita Pettik; +Cc: Alexander Turenko, tarantool-patches
It catched by ASAN at build time (lemon is executed to generate
parse.[ch]), so tarantool couldn't be built with -DENABLE_ASAN=ON.
---
no issue
https://github.com/tarantool/tarantool/tree/Totktonada/fix-lemon-memleak
extra/lemon.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/extra/lemon.c b/extra/lemon.c
index 66e425f68..1efaac9e6 100644
--- a/extra/lemon.c
+++ b/extra/lemon.c
@@ -598,8 +598,11 @@ struct acttab {
/* Free all memory associated with the given acttab */
void acttab_free(acttab *p){
- free( p->aAction );
- free( p->aLookahead );
+ assert(p);
+ if (p->aAction)
+ free( p->aAction );
+ if (p->aLookahead)
+ free( p->aLookahead );
free( p );
}
@@ -4255,6 +4258,7 @@ void ReportTable(
}
}
fprintf(out, "};\n"); lineno++;
+ acttab_free(pActtab);
/* Output the yy_shift_ofst[] table */
n = lemp->nxstate;
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tarantool-patches] Re: [PATCH] sql: fix lemon memory leak reported by ASAN
2019-01-05 13:13 [tarantool-patches] [PATCH] sql: fix lemon memory leak reported by ASAN Alexander Turenko
@ 2019-01-09 7:20 ` Kirill Yukhin
2019-01-09 8:57 ` Alexander Turenko
0 siblings, 1 reply; 4+ messages in thread
From: Kirill Yukhin @ 2019-01-09 7:20 UTC (permalink / raw)
To: tarantool-patches; +Cc: Nikita Pettik, Alexander Turenko
Hello,
On 05 Jan 16:13, Alexander Turenko wrote:
> It catched by ASAN at build time (lemon is executed to generate
> parse.[ch]), so tarantool couldn't be built with -DENABLE_ASAN=ON.
> ---
>
> no issue
> https://github.com/tarantool/tarantool/tree/Totktonada/fix-lemon-memleak
I've pushed your patch into 2.1 branch.
Should we propose a patch to SQLite?
--
Regards, Kirill Yukhin
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tarantool-patches] Re: [PATCH] sql: fix lemon memory leak reported by ASAN
2019-01-09 7:20 ` [tarantool-patches] " Kirill Yukhin
@ 2019-01-09 8:57 ` Alexander Turenko
2019-01-09 11:39 ` n.pettik
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Turenko @ 2019-01-09 8:57 UTC (permalink / raw)
To: Kirill Yukhin; +Cc: tarantool-patches, Nikita Pettik
On Wed, Jan 09, 2019 at 10:20:15AM +0300, Kirill Yukhin wrote:
> Hello,
> On 05 Jan 16:13, Alexander Turenko wrote:
> > It catched by ASAN at build time (lemon is executed to generate
> > parse.[ch]), so tarantool couldn't be built with -DENABLE_ASAN=ON.
> > ---
> >
> > no issue
> > https://github.com/tarantool/tarantool/tree/Totktonada/fix-lemon-memleak
> I've pushed your patch into 2.1 branch.
>
> Should we propose a patch to SQLite?
It is not so important unless you are using ASAN and I think in SQLite
it only run in the maintainer mode.
SQLite requires to sign-off dedication document before contribute. The
patch I think is not enough reason to do that.
WBR, Alexander Turenko.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tarantool-patches] Re: [PATCH] sql: fix lemon memory leak reported by ASAN
2019-01-09 8:57 ` Alexander Turenko
@ 2019-01-09 11:39 ` n.pettik
0 siblings, 0 replies; 4+ messages in thread
From: n.pettik @ 2019-01-09 11:39 UTC (permalink / raw)
To: tarantool-patches; +Cc: Alexander Turenko, Kirill Yukhin
> On 9 Jan 2019, at 10:57, Alexander Turenko <alexander.turenko@tarantool.org> wrote:
>
> On Wed, Jan 09, 2019 at 10:20:15AM +0300, Kirill Yukhin wrote:
>> Hello,
>> On 05 Jan 16:13, Alexander Turenko wrote:
>>> It catched by ASAN at build time (lemon is executed to generate
>>> parse.[ch]), so tarantool couldn't be built with -DENABLE_ASAN=ON.
>>> ---
>>>
>>> no issue
>>> https://github.com/tarantool/tarantool/tree/Totktonada/fix-lemon-memleak
>> I've pushed your patch into 2.1 branch.
>>
>> Should we propose a patch to SQLite?
>
> It is not so important unless you are using ASAN and I think in SQLite
> it only run in the maintainer mode.
>
> SQLite requires to sign-off dedication document before contribute. The
> patch I think is not enough reason to do that.
You can simply write to sqlite dev list about it:
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-09 11:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-05 13:13 [tarantool-patches] [PATCH] sql: fix lemon memory leak reported by ASAN Alexander Turenko
2019-01-09 7:20 ` [tarantool-patches] " Kirill Yukhin
2019-01-09 8:57 ` Alexander Turenko
2019-01-09 11:39 ` n.pettik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox