/[Apache-SVN]
ViewVC logotype

Revision 1676417


Jump to revision: Previous Next
Author: jkaluza
Date: Tue Apr 28 06:51:12 2015 UTC (8 years, 11 months ago)
Changed paths: 1
Log Message:
Initialize interp->refcnt to 1 in modperl_interp_select.

Reasoning:
1. All calls of MP_INTERPa do not increment interp->refcnt, so refcnt
   used to be 0 before this commit. But there is always matching
   MP_INTERP_PUTBACK, which calls modperl_interp_unselect which decreases
   the refcnt, so it was possible to get negative refcnt or crash with
   threaded MPMs, because reference counting has been broken.
2. modperl_interp_select increases the refcount if it finds the PerlInterp in
   ccfg, so it makes sense to increase it (it means set to 1) during
   initialization too. Otherwise the refcnt would be incremented for the caller
   in some cases, but wouldn't be in other.

This commit fixes the crash seen on worker MPM when PerlInterp has been used
by two threads and the first one freed PerlInterp during
modperl_interp_unselect.


Changed paths

Path Details
Directoryperl/modperl/trunk/src/modules/perl/modperl_interp.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26