Bug#236882: apache-perl: New patch from mod_perl maintainer
Package: apache-perl Version: 1.3.29.0.2-1 Severity: normal Followup-For: Bug #236882 I brought this up on the mod_perl list and it turns out the upstream patch was indeed a mistake. Here's the message from Geoffrey Young, one of the MP dev folks: Geoffrey Young wrote: -if (!SvTRUE(RETVAL)) { +if (!SvOK(RETVAL)) { ok, the attached patch fixes the problem. it turns out that XS as simple as this RETVAL = Nullsv; if (!SvOK(RETVAL)) { XSRETURN_UNDEF; } dumps core all on its own (without mod_perl's help :) will be fixed in the next release (whenever that is) --Geoff Index: src/modules/perl/Apache.xs === RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v retrieving revision 1.130 diff -u -r1.130 Apache.xs --- src/modules/perl/Apache.xs 1 Dec 2003 17:30:19 - 1.130 +++ src/modules/perl/Apache.xs 9 Mar 2004 18:41:50 - @@ -2084,7 +2084,7 @@ perl_module); TABLE_GET_SET(c-vars, FALSE); } -if (!SvOK(RETVAL)) { +if (!(RETVAL SvOK(RETVAL))) { s = r r-server ? r-server : perl_get_startup_server(); if (s s-module_config) { SvREFCNT_dec(RETVAL); /* in case above did newSV(0) */ -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.4.24 Locale: LANG=C, LC_CTYPE=C Versions of packages apache-perl depends on: hi apache-common 1.3.29.0.2-2 Support files for all Apache webse ii debconf 1.4.14 Debian configuration management sy ii dpkg1.10.19 Package maintenance system for Deb hi libapache-mod-perl 1.29.0.2-2 Integration of perl with the Apach ii libc6 2.3.2.ds1-11 GNU C Library: Shared libraries an ii libdb4.24.2.52-12Berkeley v4.2 Database Libraries [ ii libexpat1 1.95.6-8 XML parsing C library - runtime li ii libmagic1 4.07-2 File type determination library us ii libpam0g0.76-15 Pluggable Authentication Modules l ii libperl5.8 5.8.3-2 Shared Perl library. ii mime-support3.26-1 MIME files 'mime.types' 'mailcap -- debconf information: apache-perl/old-pidfile-set: * apache-perl/server-port: 80 * apache-perl/init: true * apache-perl/enable-suexec: false * apache-perl/document-root: /var/www * apache-perl/upgrade-from-apache-conflict: * apache-perl/server-name: localhost * apache-perl/server-admin: [EMAIL PROTECTED]
Bug#236882: apache-perl: I can reproduce this segfault as well
Package: apache-perl Version: 1.3.29.0.2-1 Severity: normal Followup-For: Bug #236882 I've tracked it down to this bit of code in HTML::Mason::ApacheHandler my $c = $r ? $r : Apache-server; @val = HAS_TABLE_API ? $c-dir_config-get($p) : $c-dir_config($p); It's the call to -dir_config that appears to call the segfault. I'm immediately suspicious of the patch from bug 226131 that was applied to the mod_perl code, as it related to dir_config. But the patch really does look inoccuous. -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.4.24 Locale: LANG=C, LC_CTYPE=C Versions of packages apache-perl depends on: ii apache-common 1.3.29.0.2-1 Support files for all Apache webse ii debconf 1.4.13 Debian configuration management sy ii dpkg1.10.18.1Package maintenance system for Deb ii libapache-mod-perl 1.29.0.2-1 Integration of perl with the Apach ii libc6 2.3.2.ds1-11 GNU C Library: Shared libraries an ii libdb4.24.2.52-12Berkeley v4.2 Database Libraries [ ii libexpat1 1.95.6-8 XML parsing C library - runtime li ii libmagic1 4.07-2 File type determination library us ii libpam0g0.76-15 Pluggable Authentication Modules l ii libperl5.8 5.8.3-2 Shared Perl library. ii mime-support3.26-1 MIME files 'mime.types' 'mailcap -- debconf information: apache-perl/old-pidfile-set: * apache-perl/server-port: 80 * apache-perl/init: true * apache-perl/enable-suexec: false * apache-perl/document-root: /var/www * apache-perl/upgrade-from-apache-conflict: * apache-perl/server-name: localhost * apache-perl/server-admin: [EMAIL PROTECTED]
Bug#236882: apache-perl: The patch from bug 226131 is the culprit!
Package: apache-perl Version: 1.3.29.0.2-1 Severity: normal Followup-For: Bug #236882 I rebuilt the apache packages from the Debian source without the patch provided in bug report 226131, and it starts up fine. Looking at the code being patched, I have absolutely no idea why it would cause a segfault with the patch applied. However, I think the patch may just be incorrect. It's testing if if RETVAL is SvOK, but _all_ SVs are SvOK, whether they are the Nullsv global, or a new SV created via newSV! The point of calling SvOK is to test if the variable in question is an SV* at all, not to test its value. The code is basically broken, because it needs to check to see if it the per-dir-config table contains the given key. If not, it should look at the server's table, I believe. Frankly, I think the original bug (re: dir_config) is _far_ less severe than a segfault, and should be backed out. -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.4.24 Locale: LANG=C, LC_CTYPE=C Versions of packages apache-perl depends on: ii apache-common 1.3.29.0.2-1 Support files for all Apache webse ii debconf 1.4.13 Debian configuration management sy ii dpkg1.10.18.1Package maintenance system for Deb ii libapache-mod-perl 1.29.0.2-1 Integration of perl with the Apach ii libc6 2.3.2.ds1-11 GNU C Library: Shared libraries an ii libdb4.24.2.52-12Berkeley v4.2 Database Libraries [ ii libexpat1 1.95.6-8 XML parsing C library - runtime li ii libmagic1 4.07-2 File type determination library us ii libpam0g0.76-15 Pluggable Authentication Modules l ii libperl5.8 5.8.3-2 Shared Perl library. ii mime-support3.26-1 MIME files 'mime.types' 'mailcap -- debconf information: apache-perl/old-pidfile-set: * apache-perl/server-port: 80 * apache-perl/init: true * apache-perl/enable-suexec: false * apache-perl/document-root: /var/www * apache-perl/upgrade-from-apache-conflict: * apache-perl/server-name: localhost * apache-perl/server-admin: [EMAIL PROTECTED]
Bug#236882: apache-perl: The patch from bug 226131 is the culprit!
On Mon, 8 Mar 2004, Dave Rolsky wrote: patch may just be incorrect. It's testing if if RETVAL is SvOK, but _all_ SVs are SvOK, whether they are the Nullsv global, or a new SV created via newSV! I take it back. Nullsv should not be SvOK, and I'm not so sure about newSV, looking at the core code. Nonetheless, the patch still causes segfaults ;) -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/