Re: NPE in psqlodbc30a.dll!PgDtc_set_property caused by pgendlista.dll!IAsyncPG::RequestExec

From: "Inoue, Hiroshi" <inoue(at)tpf(dot)co(dot)jp>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>, "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: NPE in psqlodbc30a.dll!PgDtc_set_property caused by pgendlista.dll!IAsyncPG::RequestExec
Date: 2014-06-13 15:52:49
Message-ID: 539B1E51.10008@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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 {} .

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Inoue, Hiroshi 2014-06-13 16:43:16 Re: Building psqlODBC installers
Previous Message Craig Ringer 2014-06-13 15:07:38 Re: Building psqlODBC installers