plpython crash (PG 92)

From: Asif Naeem <asif(dot)naeem(at)enterprisedb(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: plpython crash (PG 92)
Date: 2012-04-26 12:32:00
Message-ID: CACDUQd8LYqonSr4egniMZ-ZC0mD_egAdLyx=-FyVOtkQM=nyfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

PFA test case. It used simple select statement to retrieve data via
plpython. It crashes latest pg 9.2 with the following stack trace i.e.

#0 0x000000000073021f in pfree ()
> #1 0x00007fa74b632f7a in PLy_result_dealloc () from
> /home/masif/work/postgresql/postgresql/inst/lib/plpython2.so
> #2 0x00007fa74b2c710b in iter_iternext (iterator=0x1ad7150) at
> Objects/iterobject.c:74
> #3 0x00007fa74b2934db in PyIter_Next (iter=0x1b3c5f0) at
> Objects/abstract.c:3107
> #4 0x00007fa74b630245 in PLy_exec_function () from
> /home/masif/work/postgresql/postgresql/inst/lib/plpython2.so
> #5 0x00007fa74b630c57 in plpython_call_handler () from
> /home/masif/work/postgresql/postgresql/inst/lib/plpython2.so
> #6 0x0000000000583907 in ExecMakeFunctionResult ()
> #7 0x000000000057f146 in ExecProject ()
> #8 0x0000000000596740 in ExecResult ()
> #9 0x000000000057e708 in ExecProcNode ()
> #10 0x000000000057d582 in standard_ExecutorRun ()
> #11 0x000000000064f477 in PortalRunSelect ()
> #12 0x0000000000650778 in PortalRun ()
> #13 0x000000000064ceca in exec_simple_query ()
> #14 0x000000000064ddc7 in PostgresMain ()
> #15 0x000000000060bdd9 in ServerLoop ()
> #16 0x000000000060e9d7 in PostmasterMain ()
> #17 0x00000000005ad360 in main ()

Apparently it is being crashed because of invalid related pointer value of
pfree() *header->context->methods->free_p. It is reproducible with latest
version of python i.e. Python-2.7.3 and Python-3.2.3. Thanks.

Best Regards,
Muhammad Asif Naeem

Attachment Content-Type Size
plpython_crash.sql application/octet-stream 452 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Asif Naeem 2012-04-26 12:38:14 Re: plpython crash (PG 92)
Previous Message Robert Haas 2012-04-26 12:14:04 Re: Temporary tables under hot standby