Apache crashes with a segmentation fault on a graceful restart triggered by logrotate if mod_python is used with dev-lang/python-2.7.9-r1. Downgrading to dev-lang/python-2.7.7 fixes the behavior. Reproducible: Always Steps to Reproduce: 1. Emerge www-servers/apache-2.2.27-r4, dev-lang/python-2.7.9-r1 and www-apache/mod_python-3.5.0. 2. Enable mod_python and start Apache (vi /etc/conf.d/apache2; /etc/init.d/apache2 start) 3. Do a graceful restart of Apache (/etc/init.d/apache reload) 4. See the error log (less /var/log/apache2/error_log) Actual Results: On start: [error] python_init: Python version mismatch, expected '2.7.7', found '2.7.9'. On restart: [notice] seg fault or similar nasty error detected in the parent process Expected Results: Nothing of the above message.
Backward dependencies are backward. 2.7.7 is on its way out.
Same problem happens with python-3.3.5-r1 but without the python version mismatch message. Is there something else I have to do than using 'eselect python set' to switch and restart apache? Do I need to reemerge something?
mod_python was removed from Fedora long time ago because of issues like this and upstream being dead: http://www.mail-archive.com/devel@lists.fedoraproject.org/msg40878.html Maybe we should treeclean it too
# Michał Górny <mgorny@gentoo.org> (05 Jun 2017) # (on behalf of Treecleaner project) # Abandoned upstream and downstream. Buggy. Segfaults hard on Python # upgrades. Use one of the *CGI modules instead. # Removal in 30 days. Bug #536134. www-apache/mod_python
commit 05f5454a3108c4ffaeae8be59f4a32c74048293c Author: Michał Górny <mgorny@gentoo.org> AuthorDate: Wed Jul 5 12:17:52 2017 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: Wed Jul 5 12:35:12 2017 app-cdr/cdrkit: Remove last-rited pkg, #591778
BTW, recently I tried to switch from apache 2.2. to 2.4 series but because it does not work with mod_python-3.5.0 I stepped back. I would also need to rewrite the web application itself, see https://github.com/GrahamDumpleton/mod_wsgi/issues/446 On the other hand, I can confirm that the following still works after the previously mentioned updgrades and downgrades (hence many recompiles using current Gentoo portage tree): # emerge -pv apache mod_python =dev-lang/python-2.7.15 =dev-lang/python-3.5.5 =dev-lang/python-3.6.5 These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] www-servers/apache-2.2.34:2::gentoo USE="gdbm ssl suexec threads -debug -doc -ldap -libressl (-selinux) -static" APACHE2_MODULES="alias auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid deflate dir disk_cache env expires file_cache filter headers ident imagemap include info log_config log_forensic mem_cache mime mime_magic negotiation rewrite setenvif status userdir usertrack vhost_alias -actions -asis -cern_meta -charset_lite -dav -dav_fs -dav_lock -dbd -dumpio -ext_filter -logio -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -proxy_scgi -reqtimeout -speling -substitute -unique_id -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 0 KiB [ebuild R ] www-apache/mod_python-3.5.0-r1::x-portage USE="-doc -test" PYTHON_TARGETS="python2_7" 0 KiB [ebuild R ] dev-lang/python-2.7.15:2.7::gentoo USE="gdbm ncurses readline sqlite ssl (threads) (wide-unicode) xml (-berkdb) -bluetooth -build -doc -examples -hardened -ipv6 -libressl -tk -wininst" 0 KiB [ebuild R ] dev-lang/python-3.5.5:3.5/3.5m::gentoo USE="gdbm ncurses readline sqlite ssl (threads) xml -build -examples -hardened -ipv6 -libressl -test -tk -wininst" 0 KiB [ebuild R ] dev-lang/python-3.6.5:3.6/3.6m::gentoo USE="gdbm ncurses readline sqlite ssl (threads) xml -build -examples -hardened -ipv6 -libressl -test -tk -wininst" 0 KiB # eselect python list Available Python interpreters, in order of preference: [1] python2.7 [2] python3.4 [3] python3.6 (fallback) [4] python3.5 (fallback) # Luckily I placed the ebuild into local portage. It is just a matter of time when EAPI will be bumped so that the ebuild will stop working. I will leave Gentoo then.