On 11/09/2010 09:54 PM, Stefan Fritsch wrote: > On Thursday 04 November 2010, Graham Leggett wrote: >> On 03 Nov 2010, at 10:28 PM, Stefan Fritsch wrote: >>> Strange, I have these problems only with prefork, not with event. >>> But with event I get a segfault in the reslist cleanup code. >>> >>> Can somebody cross-check this? >> This smelled like a pool lifetime issue, and looking closer it >> looked like we were cleaning up a brigade after we had returned >> the backend to the pool. The attached patch stops the crash, and >> it seems to run at a sensible speed again (I suspect the late >> cleanup of the brigade was sending the code into a spin). Can you >> give it a try? >> >> One proxy test still fails though: >> >> t/modules/proxy.............ok 7/15# Failed test 10 in t/modules/ >> proxy.t at line 34 >> t/modules/proxy.............FAILED test 10 >> Failed 1/15 tests, 93.33% okay >> >> This fails because the first bucket of the response has been >> corrupted: >> >> graham-leggetts-macbook-pro-3:httpd-test minfrin$ curl >> http://localhost:8536/reverse/modules/cgi/nph-102.pl sl/2.3.9-dev >> OpenS >> >> I've seen this a few weeks ago and it went away, so I suspect this >> isn't proxy that's doing it. Need to dig further. > > The fix in r1030855 is wrong: ap_proxy_buckets_lifetime_transform is > not copying the data but only creates transient buckets from the data > in the buckets in bb. If you then destroy bb before passing pass_bb, > the data where the buckets in pass_bb point gets freed and later gets > overwritten.
Good catch. I reviewed the code again and then remembered the idea why we use transient buckets: If everything goes well and the data is sent out by ap_pass_brigade no copying of the contents of the buckets is needed. Only if things are buffered somewhere down the chain, the according filter needs to set the buckets aside (which causes copying). So I guess with the approach to release the backend connection immediately we will loose this advantage. That is regrettable. I guess an easy solution would be to use heap buckets instead of transient buckets. Regards Rüdiger