Re: Potential reference miscounts and segfaults in plpython.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Urbański <wulczer(at)wulczer(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Potential reference miscounts and segfaults in plpython.c
Date: 2012-02-20 03:29:39
Message-ID: 17954.1329708579@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?B?SmFuIFVyYmHFhHNraQ==?= <wulczer(at)wulczer(dot)org> writes:
>> On 18/02/12 21:17, Tom Lane wrote:
>>> Dave Malcolm at Red Hat has been working on a static code analysis tool
>>> for Python-related C code. He reports here on some preliminary results
>>> for plpython.c:
>>> https://bugzilla.redhat.com/show_bug.cgi?id=795011

> Here's a patch that fixes everything I was sure was an actual bug. The
> rest of the warnings seem to be caused by the tool not knowing that
> elog(ERROR) throws a longjmp and things like "we never unref this
> object, so it can't disappear mid-execution".

This looks pretty sane to me, but it would probably be better if one of
the more python-savvy committers took responsibility for final review.

My only comment is whether elog(ERROR) is appropriate, ie, do we consider
these to be internal errors that users will never see in practice?
If there's a significant risk of the error being thrown in the field,
it might be better to use ereport, to expose the message for
translation.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2012-02-20 03:38:05 Re: Future of our regular expression code
Previous Message Greg Stark 2012-02-20 03:28:16 Re: Future of our regular expression code