From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id A9DC92B9A2 for ; Thu, 25 Apr 2019 04:58:36 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sdW1DoHJRmUN for ; Thu, 25 Apr 2019 04:58:36 -0400 (EDT) Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 688B525C58 for ; Thu, 25 Apr 2019 04:58:36 -0400 (EDT) Date: Thu, 25 Apr 2019 11:58:33 +0300 From: Kirill Yukhin Subject: [tarantool-patches] Re: [PATCH] sql: update ptr to VDBE after its creation in sql_txn Message-ID: <20190425085833.swi457llz2l4yaa5@tarantool.org> References: <20190415232522.10188-1-korablev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190415232522.10188-1-korablev@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Nikita Pettik Hello, On 16 Apr 02:25, Nikita Pettik wrote: > VDBE object is used in struct sql_txn to add new autoincrement ids in > sequence_next(). List of these ids is returned later as a query > execution result. sql_txn is created once SQL statement is executed > inside transaction and exists till commit or rollback. After its > creation it contains pointer to current VDBE. Each VDBE is freed after > statement is executed. Hence, after first SQL statement within > transaction is executed, sql_txn will point to freed memory (dangling > pointer). This leads to crash in the next processed statement. Fix to > this bug is simple: we must re-assign pointer to VDBE in sql_txn before > VDBE execution. > > Closes #4157 > --- > Branch: https://github.com/tarantool/tarantool/tree/np/gh-4157-fix-autoincrement-in-transaction > Issue: https://github.com/tarantool/tarantool/issues/4157 I've checked your patch into 2.1 and master branches. -- Regards, Kirill Yukhin