In writing the Perl interface to tipools, I've found one segfault. If one uses modperl_tipool_putback_data and tries to putback something that was never part of the pool, modperl_tipool_putback_base will segfault here:
tipool->idle = modperl_list_prepend(tipool->idle, listp);
Following patch fixes this.
Gozer.
Index: src/modules/perl/modperl_tipool.c
===================================================================
RCS file:
/home/gozer/mirror/cvs.apache.org/modperl-2.0-cvs/src/modules/perl/modperl_tipool.c,v
retrieving revision 1.6
diff -u -b -B -r1.6 modperl_tipool.c
--- src/modules/perl/modperl_tipool.c 4 Mar 2001 18:49:39 -0000 1.6
+++ src/modules/perl/modperl_tipool.c 7 Mar 2002 08:04:19 -0000
@@ -286,6 +286,12 @@
tipool->busy = modperl_list_remove_data(tipool->busy, data, &listp);
}
+ if(!listp) {
+ /*XXX: Attempt to putback something that was never there */
+ modperl_tipool_unlock(tipool);
+ return;
+ }
+
tipool->idle = modperl_list_prepend(tipool->idle, listp);
tipool->in_use--;
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'
msg02435/pgp00000.pgp
Description: PGP signature
