Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 536134 - www-apache/mod_python-3.5.0 with >dev-lang/python-2.7.7 - [error] python_init: Python version mismatch, expected '2.7.7', found '2.7.9'.
Summary: www-apache/mod_python-3.5.0 with >dev-lang/python-2.7.7 - [error] python_init...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Deadline: 2017-07-05
Assignee: Michael Weber (RETIRED)
URL:
Whiteboard:
Keywords: PMASKED
Depends on: 591788
Blocks:
  Show dependency tree
 
Reported: 2015-01-09 14:48 UTC by Kevin Woldt
Modified: 2019-07-21 17:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Woldt 2015-01-09 14:48:06 UTC
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.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2015-01-09 16:48:58 UTC
Backward dependencies are backward. 2.7.7 is on its way out.
Comment 2 Kevin Woldt 2015-01-19 19:19:27 UTC
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?
Comment 3 Pacho Ramos gentoo-dev 2016-02-08 19:10:31 UTC
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
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-06-05 16:24:01 UTC
# 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
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-07-05 10:38:09 UTC
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
Comment 6 Martin Mokrejš 2019-07-21 17:52:08 UTC
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.