Re: mysql_fdw crash

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: 066ce286(at)free(dot)fr
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: mysql_fdw crash
Date: 2018-11-20 10:47:56
Message-ID: CAFj8pRDcu34k+JpUi-PGvqjmpZZhe0HTSu-0ViuUnhN1vM1XoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

út 20. 11. 2018 v 11:09 odesílatel <066ce286(at)free(dot)fr> napsal:

> Hi,
>
> I do have a reproductible crash with mysql_fdw when executing a plpgsql
> function. I'm running pg 11.1 with current mysql_fdw, but I had the same
> crash with the pg 9.6 and mysql_fdw provided with ubuntu packages.
>
> From psql side :
>
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
> !>
>
> In syslog :
>
> Nov 20 10:52:58 sact2Dev kernel: [322982.294765] postgres[10364]: segfault
> at 0 ip 00007fc8ab7b5350 sp 00007ffc4312a4f0 error 6 in
> mysql_fdw.so[7fc8ab7ac000+d000]
>
> I've located the crash cause on the line :
>
> *param_types[i] = exprType(param_expr);
>
> ( file mysql_fdw.c ; function prepare_query_params() ; in the forEach()
> loop)
>
> I've recompiled the fdw with a -g option. Could you please tell me (or
> point me a documentation) how to have a core dump from the segfaulted lib ;
> so that I can open it in a debugger to inspect variable contents ?
>
>
In this case the most simply technique is attaching to live postgresql
session by gdb

I use a small script that run gdb and attach first postgresql session

#!/bin/bash

PID=`ps ax|grep postgres | grep 'postgres: .*idle$' | awk '{print $1}'`

gdb /usr/local/pgsql/bin/postmaster -p $PID

When gdb will be active, then use command c, and then run query in session.
gdb should to catch segfault.

Regards

Pavel

> Or any advice ?
>
> Thank you.
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-11-20 11:07:12 Re: Continue work on changes to recovery.conf API
Previous Message Alvaro Herrera 2018-11-20 10:41:53 Re: Psql patch to show access methods info