NPE in psqlodbc30a.dll!PgDtc_set_property caused by pgendlista.dll!IAsyncPG::RequestExec - Mailing list pgsql-odbc

From Craig Ringer
Subject NPE in psqlodbc30a.dll!PgDtc_set_property caused by pgendlista.dll!IAsyncPG::RequestExec
Date
Msg-id 539A8EDA.8050503@2ndquadrant.com
Whole thread Raw
Responses Re: NPE in psqlodbc30a.dll!PgDtc_set_property caused by pgendlista.dll!IAsyncPG::RequestExec
List pgsql-odbc
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


pgsql-odbc by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: XA registry entries are missing from 64-bit install
Next
From: Heikki Linnakangas
Date:
Subject: Building psqlODBC installers