Cliff Woolley wrote:
On Fri, 21 May 2004, Stas Bekman wrote:


I understand all that, but I guess I fail to pass the point across. It is not
a problem that I encounter in my code. On the contrary I'm writing tests that
exercise, both valid and invalid ways the API can be called. API that hangs
when called in invalid way is a problem. Don't you think?

APR_BUCKET_INSERT_BEFORE(fb, db);


The thing is, it would not be this macro that hangs. All this macro can
do is segfault (if one of the pointers is null, meaning the brigade was
previously corrupted), or do what it's supposed to do (though in doing so
it could potentially corrupt some other brigade, which is what happens
here -- if the bucket being inserted is still in a brigade, as db is, then
that brigade will be corrupted by this operation).

Do you suggest that the sample program that I posted doesn't hang in that macro, but after it? I didn't step through to check, just saw that when I remove it or fix the order things work just fine, so it could be just so. I need to check that.


The only way to detect
that such corruption will occur is to check the entire ring... that's a
linear time checking operation tacked on to a constant time insertion
operation... not acceptable. :)

Absolutely!

However, if you compile with bucket
debugging turned on, those validity checks WILL be done.

I guess that works for me. If in the future someone reports a problem, I can suggest to them what you've prescribed above. It's just that there could be other reasons for the hanging, which is usually hard to figure out w/o being in the user's shoes.


Thanks Cliff and Joe.

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to