[Pymilter] pymilter segfaults

Stuart D. Gathman stuart at bmsi.com
Thu Dec 4 14:09:34 EST 2008


On Thu, 4 Dec 2008, Stuart D. Gathman wrote:

> 4. But suppose that python code invokes a context method when *not* in
> a callback?  Or suppose that libmilter gets tired of waiting for
> a callback and closes the context asyncronously?  In that case, the libmilter
> context might get destroyed while python is trying to use it, causing
> a segfault.
> 
> Does 4 sound like it might be happening in your milter?  (Does anyone know
> if libmilter might call close while another callback hasn't returned?)

But milter_wrap_close protects against 4 by calling PyEval_AcquireThread
before unlinking from libmilter context and destroying PyThreadState.

And we handle wrap_close getting called before wrap_connect also by
checking if there is a milter_ContextObject.

It seems pretty watertight, but apparently there is a leak or bad
assumption somewhere.

-- 
	      Stuart D. Gathman <stuart at bmsi.com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.



More information about the Pymilter mailing list