[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#805190: marked as done (jessie-pu: package libapache2-mod-perl2/2.0.9~1624218-2)



Your message dated Sat, 23 Jan 2016 13:57:15 +0000
with message-id <1453557435.1835.52.camel@adam-barratt.org.uk>
and subject line 8.3 point release cleanup
has caused the Debian Bug report #805190,
regarding jessie-pu: package libapache2-mod-perl2/2.0.9~1624218-2
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
805190: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805190
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: jessie
User: release.debian.org@packages.debian.org
Usertags: pu

Hi, please consider the attached debdiff for a stable update.

Changes:
 libapache2-mod-perl2 (2.0.9~1624218-2+deb8u1) jessie; urgency=medium
 .
   * Apply upstream 2.0.9 patches fixing crashes in
     modperl_interp_unselect(). Thanks to Patrick Matthäi.
     (Closes: #803043)

I understand source-only uploads to stable-p-u aren't supported?
How about source+all?

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru libapache2-mod-perl2-2.0.9~1624218/debian/changelog libapache2-mod-perl2-2.0.9~1624218/debian/changelog
--- libapache2-mod-perl2-2.0.9~1624218/debian/changelog	2014-10-15 09:32:24.000000000 +0300
+++ libapache2-mod-perl2-2.0.9~1624218/debian/changelog	2015-11-15 20:42:37.000000000 +0200
@@ -1,3 +1,11 @@
+libapache2-mod-perl2 (2.0.9~1624218-2+deb8u1) jessie; urgency=medium
+
+  * Apply upstream 2.0.9 patches fixing crashes in
+    modperl_interp_unselect(). Thanks to Patrick Matthäi.
+    (Closes: #803043)
+
+ -- Niko Tyni <ntyni@debian.org>  Sun, 15 Nov 2015 20:42:27 +0200
+
 libapache2-mod-perl2 (2.0.9~1624218-2) unstable; urgency=medium
 
   * Add autopkgtest support.
diff -Nru libapache2-mod-perl2-2.0.9~1624218/debian/patches/0001-Decrement-interp-refcnt-when-freeing-interpreter-in-.patch libapache2-mod-perl2-2.0.9~1624218/debian/patches/0001-Decrement-interp-refcnt-when-freeing-interpreter-in-.patch
--- libapache2-mod-perl2-2.0.9~1624218/debian/patches/0001-Decrement-interp-refcnt-when-freeing-interpreter-in-.patch	1970-01-01 02:00:00.000000000 +0200
+++ libapache2-mod-perl2-2.0.9~1624218/debian/patches/0001-Decrement-interp-refcnt-when-freeing-interpreter-in-.patch	2015-11-15 20:36:06.000000000 +0200
@@ -0,0 +1,53 @@
+From 514800554f704d0fe90fefd70016583099d7944b Mon Sep 17 00:00:00 2001
+From: Steve Hay <stevehay@apache.org>
+Date: Mon, 3 Nov 2014 08:41:03 +0000
+Subject: [PATCH] Decrement interp->refcnt when freeing interpreter in
+ modperl_interp_unselect()
+
+The case where interp->refcnt==1 was not being handled correctly. Prior to r1562772 the refcnt was decremented to 0 but then the function returned early, wrongly not freeing the interpreter, leading to deadlock in the event MPM. Following that change the interpreter was now freed, but the refcnt was wrongly no longer decremented.
+
+This change decrements the refcnt (always) and frees the interpreter as well (unless the refcnt is still > 0). An extra safety check is also made, to return early if the interpreter has already been unselected, although with correct refcnting now, we do not expect this to happen.
+
+This patch is based on investigations and a tentative patch suggested by Richard M Kandarian:
+http://marc.info/?t=140191218700004&r=1&w=2
+
+git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@1636289 13f79535-47bb-0310-9956-ffa450edef68
+---
+ src/modules/perl/modperl_interp.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/src/modules/perl/modperl_interp.c b/src/modules/perl/modperl_interp.c
+index 430a2af..a984006 100644
+--- a/src/modules/perl/modperl_interp.c
++++ b/src/modules/perl/modperl_interp.c
+@@ -273,17 +273,24 @@ apr_status_t modperl_interp_unselect(void *data)
+     modperl_interp_t *interp = (modperl_interp_t *)data;
+     modperl_interp_pool_t *mip = interp->mip;
+ 
+-    MP_ASSERT(interp && MpInterpIN_USE(interp));
++    MP_ASSERT(interp && MpInterpIN_USE(interp) && interp->refcnt > 0);
+     MP_TRACE_i(MP_FUNC, "unselect(interp=%pp): refcnt=%d",
+                interp, interp->refcnt);
+ 
+-    if (interp->refcnt > 1) {
+-        --interp->refcnt;
++    --interp->refcnt;
++
++    if (interp->refcnt > 0) {
+         MP_TRACE_i(MP_FUNC, "interp=0x%lx, refcnt=%d -- interp still in use",
+                    (unsigned long)interp, interp->refcnt);
+         return APR_SUCCESS;
+     }
+ 
++    if (!MpInterpIN_USE(interp)){
++        MP_TRACE_i(MP_FUNC, "interp=0x%pp, refcnt=%d -- interp already not in use",
++                   interp, interp->refcnt);
++        return APR_SUCCESS;
++    }
++
+     MpInterpIN_USE_Off(interp);
+ 
+     modperl_thx_interp_set(interp->perl, NULL);
+-- 
+2.5.1
+
diff -Nru libapache2-mod-perl2-2.0.9~1624218/debian/patches/0002-Initialize-interp-refcnt-to-1-in-modperl_interp_sele.patch libapache2-mod-perl2-2.0.9~1624218/debian/patches/0002-Initialize-interp-refcnt-to-1-in-modperl_interp_sele.patch
--- libapache2-mod-perl2-2.0.9~1624218/debian/patches/0002-Initialize-interp-refcnt-to-1-in-modperl_interp_sele.patch	1970-01-01 02:00:00.000000000 +0200
+++ libapache2-mod-perl2-2.0.9~1624218/debian/patches/0002-Initialize-interp-refcnt-to-1-in-modperl_interp_sele.patch	2015-11-15 20:36:06.000000000 +0200
@@ -0,0 +1,42 @@
+From c7979a708a7be018e5e22680314ea580b2ac2c7a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jan=20Kalu=C5=BEa?= <jkaluza@apache.org>
+Date: Tue, 28 Apr 2015 06:51:12 +0000
+Subject: [PATCH] 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.
+
+
+git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@1676417 13f79535-47bb-0310-9956-ffa450edef68
+---
+ src/modules/perl/modperl_interp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/modules/perl/modperl_interp.c b/src/modules/perl/modperl_interp.c
+index a984006..67dd2e4 100644
+--- a/src/modules/perl/modperl_interp.c
++++ b/src/modules/perl/modperl_interp.c
+@@ -460,7 +460,7 @@ modperl_interp_t *modperl_interp_select(request_rec *r, conn_rec *c,
+     interp = modperl_interp_get(s);
+     MP_TRACE_i(MP_FUNC, "  --> got %pp (perl=%pp)", interp, interp->perl);
+     ++interp->num_requests; /* should only get here once per request */
+-    interp->refcnt = 0;
++    interp->refcnt = 1;
+ 
+     /* set context (THX) for this thread */
+     PERL_SET_CONTEXT(interp->perl);
+-- 
+2.5.1
+
diff -Nru libapache2-mod-perl2-2.0.9~1624218/debian/patches/series libapache2-mod-perl2-2.0.9~1624218/debian/patches/series
--- libapache2-mod-perl2-2.0.9~1624218/debian/patches/series	2014-10-15 09:32:04.000000000 +0300
+++ libapache2-mod-perl2-2.0.9~1624218/debian/patches/series	2015-11-15 20:36:06.000000000 +0200
@@ -15,3 +15,5 @@
 380-Fix-reload.t-as-per-r1565579.-Reported-in-CPAN-RT-96.patch
 420-Mark-failing-tests-in-t-perl-ithreads3.t-as-TODO.patch
 430-Don-t-call-modperl_threaded_mpm-et-al.-from-XS-code.patch
+0001-Decrement-interp-refcnt-when-freeing-interpreter-in-.patch
+0002-Initialize-interp-refcnt-to-1-in-modperl_interp_sele.patch

--- End Message ---
--- Begin Message ---
Version: 8.3

Hi,

The updates referred to in these bugs were included in today's 8.3
Jessie point release.

Regards,

Adam

--- End Message ---

Reply to: