Re: crash bug on closed connection

From: "Inoue, Hiroshi" <inoue(at)tpf(dot)co(dot)jp>
To: Jade Koskela <jkoskela0(at)gmail(dot)com>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: crash bug on closed connection
Date: 2014-10-15 19:23:38
Message-ID: 543EC9BA.1020901@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi Jade,

Could you please try the attached patch?

regards,
Hiroshi Inoue

On 2014/10/15 14:38, Jade Koskela wrote:
> Here is the end of the log.
> I've done some debugging, when CC_send_query_append is called here, it
> correctly identifies that there was an error, and exits the function.
>
> res = CC_send_query_append(conn, self->stmt_with_params, qryi, qflag,
> SC_get_ancestor(self), appendq); (statement.c:2069)
>
> The result which is returned is not handled correctly (statement.c:2078)
>
> if (appendq)
> {
> QResultClass *qres, *nres;
>
> if ( res->rstatus == PORES_EMPTY_QUERY && !res->next)
> res = NULL;
>
> for (qres = res; qres;)
> {
> if (qres->command && strnicmp(qres->command, fetch_cmd, 5) == 0)
> {
> res = qres;
> break;
> }
> nres = qres->next;
> if (nres && QR_get_notice(qres) != NULL)
> {
> if (QR_command_successful(nres) &&
> QR_command_nonfatal(qres))
> {
> QR_set_rstatus(nres, PORES_NONFATAL_ERROR);
> }
> QR_add_notice(nres, QR_get_notice(qres));
> }
> qres->next = NULL;
> QR_Destructor(qres);
> qres = nres;
> }
> }
>
> There is only a single result, with result.next == NULL.
> This part of the code calls the destructor on the only result, but res
> is still left pointing at it. After that fun things happen.
> It gets a long way before it actually crashes in
> Exec_with_parameters_resolved.

Attachment Content-Type Size
fix_a_crash.patch text/x-diff 3.5 KB

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Inoue, Hiroshi 2014-10-15 23:59:12 Re: crash bug on closed connection
Previous Message Bala krishna Devasani 2014-10-15 15:41:55 PostgreSQL crash at SQLColAttribute()