Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WvKER-0007i6-Mt for pgsql-odbc@arkaria.postgresql.org; Fri, 13 Jun 2014 05:40:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WvKEP-0001Al-R7 for pgsql-odbc@arkaria.postgresql.org; Fri, 13 Jun 2014 05:40:53 +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 1WvKEO-0001Ab-O2 for pgsql-odbc@postgresql.org; Fri, 13 Jun 2014 05:40:52 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WvKEL-0000Sq-9u for pgsql-odbc@postgresql.org; Fri, 13 Jun 2014 05:40:50 +0000 Received: from ayaki.localdomain (58-7-65-205.dyn.iinet.net.au [58.7.65.205]) by mrelayeu.kundenserver.de (node=mreue101) with ESMTP (Nemesis) id 0MJTPH-1WsqBh0PJD-0032iK; Fri, 13 Jun 2014 07:40:47 +0200 Message-ID: <539A8EDA.8050503@2ndquadrant.com> Date: Fri, 13 Jun 2014 13:40:42 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: "pgsql-odbc@postgresql.org" Subject: NPE in psqlodbc30a.dll!PgDtc_set_property caused by pgendlista.dll!IAsyncPG::RequestExec X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:spwbr7i0I3jtYO0mCqsm3itQmWtOME7r660WZU3d1du 5QrGSWjTTWZk/USY5mXLHhQgPIL/Q6bhhbBtG+BzMSeeuzQ/4P v4tf1zk0vv1Ru2xw9h+PwGrrNG5QC4v95/bAqiPq2DPlJYUvHi qGnxvaYLSAxQrMqzgqFs1+T6uPZK1WGPVKFO136kiKZjzeaJCQ FtIpz54oSxCHgRwakBe7oHwsne14QDpnrlCzncDI14e4AQYT3A Y+xR5ulNZRFqXtovd0CiLy8L7rkmjRioNb3pTxFLanBD2Fx1qq UmzRsiY7xC+Rde5ffrR0aYkcIhFGuBJKGi6R4feXfBMgjkk1F9 e1mpeEpxEKQhWg67GtdnyyX+Cs9NLfp26PzLciTPz X-Pg-Spam-Score: -1.9 (-) 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 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. 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 {} . -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc