Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WvTlx-0006bS-IS for pgsql-odbc@arkaria.postgresql.org; Fri, 13 Jun 2014 15:52:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WvTlx-00074s-1R for pgsql-odbc@arkaria.postgresql.org; Fri, 13 Jun 2014 15:52:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WvTlv-00071x-Fi for pgsql-odbc@postgresql.org; Fri, 13 Jun 2014 15:52:07 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WvTlr-0003JI-JG for pgsql-odbc@postgresql.org; Fri, 13 Jun 2014 15:52:05 +0000 Received: (qmail 11790 invoked by uid 512); 13 Jun 2014 15:52:02 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 13 Jun 2014 15:52:02 -0000 Received: from unknown (HELO ?192.168.1.8?) (183.76.63.174) by sd.tpf.co.jp with SMTP; 13 Jun 2014 15:52:02 -0000 Message-ID: <539B1E51.10008@tpf.co.jp> Date: Sat, 14 Jun 2014 00:52:49 +0900 From: "Inoue, Hiroshi" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Craig Ringer , "pgsql-odbc@postgresql.org" Subject: Re: NPE in psqlodbc30a.dll!PgDtc_set_property caused by pgendlista.dll!IAsyncPG::RequestExec References: <539A8EDA.8050503@2ndquadrant.com> In-Reply-To: <539A8EDA.8050503@2ndquadrant.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org Hi Craig, (2014/06/13 14:40), Craig Ringer wrote: > Hi folks > > I've been chasing an NPE in psqlODBC while attempting to run a debug > build to help identify an MSDTC / XA issue for a customer. > > In pgenlista.dll, IAsyncPG::RequestExec calls SetDone(...), which clears > the IAsyncPG::dtcconn member. It then calls PgDtc_set_property on the > just-cleared dtcconn member, causing an NPE. Oops you are right. Anyway it would take some time to fix it. I would have to remember the code first. Thanks. Hiroshi Inoue > in msdtc_enlist.cpp: > > if (S_OK != res) > { > SetDone(res); > bReleaseEnlist = true; > } > PgDtc_set_property(dtcconn, prepareRequested, (void *) 0); > > > At the entry point to IAsyncPG::RequestExec, res == S_OK . It gets set > to S_FAIL at: > > if (!PgDtc_two_phase_operation(econn, PREPARE_TRANSACTION, pgxid)) > res = E_FAIL; > > on line 637. I'll look into why that's failing in my environment, but > meanwhile, any attempt to access 'dtcconn' after clearing it is clearly > a bug. > > Presumably the PgDtc_set_property should be done before SetDone, or in > an else {} . -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc