Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache2 crash with mod_wsgi and python #284

Closed
Zitrax opened this issue Mar 25, 2018 · 3 comments
Closed

Apache2 crash with mod_wsgi and python #284

Zitrax opened this issue Mar 25, 2018 · 3 comments

Comments

@Zitrax
Copy link

Zitrax commented Mar 25, 2018

I am trying to setup a webserver in docker but currently the apache process segfaults.

I am on ubuntu 16.04 with apache 2.4.18 and mod_wsgi 4.3.0.

Backtrace:

#0  0x00007ff0263cb944 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#1  0x00007ff026454046 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#2  0x00007ff0263d0167 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#3  0x00007ff0263d0dfb in _PyObject_GC_Malloc () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#4  0x00007ff0263d0ead in _PyObject_GC_New () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#5  0x00007ff026456b2c in PyDict_New () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#6  0x00007ff026459510 in PyDict_Copy () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#7  0x00007ff0263c7767 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#8  0x00007ff0263bf173 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#9  0x00007ff026408273 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#10 0x00007ff02640902f in _PyObject_CallFunction_SizeT () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#11 0x00007ff02639aeb9 in init_io () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#12 0x00007ff026443985 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#13 0x00007ff026444390 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#14 0x00007ff0264455ea in PyImport_ImportModuleLevel () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#15 0x00007ff0263af8b8 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#16 0x00007ff026408273 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#17 0x00007ff0264de487 in PyEval_CallObjectWithKeywords () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#18 0x00007ff0263a47e6 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#19 0x00007ff0264df05c in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#20 0x00007ff0263a0da9 in PyEval_EvalCode () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#21 0x00007ff026442244 in PyImport_ExecCodeModuleEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#22 0x00007ff026442c1f in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#23 0x00007ff026444390 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#24 0x00007ff0264455ea in PyImport_ImportModuleLevel () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#25 0x00007ff0263af8b8 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#26 0x00007ff026408273 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#27 0x00007ff0264de487 in PyEval_CallObjectWithKeywords () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#28 0x00007ff0263a47e6 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#29 0x00007ff0264df05c in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#30 0x00007ff0263a0da9 in PyEval_EvalCode () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#31 0x00007ff026442244 in PyImport_ExecCodeModuleEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#32 0x00007ff026442c1f in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#33 0x00007ff026444390 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#34 0x00007ff0264455ea in PyImport_ImportModuleLevel () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#35 0x00007ff0263af8b8 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#36 0x00007ff026408273 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#37 0x00007ff0264de487 in PyEval_CallObjectWithKeywords () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#38 0x00007ff0263a47e6 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#39 0x00007ff0264df05c in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#40 0x00007ff0263a0da9 in PyEval_EvalCode () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#41 0x00007ff026442244 in PyImport_ExecCodeModuleEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#42 0x00007ff026442c1f in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#43 0x00007ff026444390 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#44 0x00007ff0264455ea in PyImport_ImportModuleLevel () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#45 0x00007ff0263af8b8 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#46 0x00007ff026408273 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#47 0x00007ff0264de487 in PyEval_CallObjectWithKeywords () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#48 0x00007ff0263a47e6 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#49 0x00007ff0264df05c in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#50 0x00007ff0263a0da9 in PyEval_EvalCode () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#51 0x00007ff026442244 in PyImport_ExecCodeModuleEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#52 0x00007ff026442c1f in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#53 0x00007ff026444390 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#54 0x00007ff0264455ea in PyImport_ImportModuleLevel () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#55 0x00007ff0263af8b8 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#56 0x00007ff026408273 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#57 0x00007ff0264de487 in PyEval_CallObjectWithKeywords () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#58 0x00007ff0263a47e6 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#59 0x00007ff0264df05c in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#60 0x00007ff0263a0da9 in PyEval_EvalCode () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#61 0x00007ff026442244 in PyImport_ExecCodeModuleEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#62 0x00007ff026895f85 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#63 0x00007ff026899476 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#64 0x00007ff0268a3d34 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#65 0x00007ff0268a653b in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#66 0x00007ff02a3b948e in apr_proc_other_child_alert () from /usr/lib/x86_64-linux-gnu/libapr-1.so.0
#67 0x00007ff0272e5e29 in ?? () from /usr/lib/apache2/modules/mod_mpm_event.so
#68 0x00005608a49d646e in ap_run_mpm ()
#69 0x00005608a49cf400 in main ()

Apache modules:

# apache2ctl -M
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 expires_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_event_module (shared)
 negotiation_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 status_module (shared)
 wsgi_module (shared)

The site have these wsgi related settings:

WSGIApplicationGroup %{GLOBAL}
WSGIProcessGroup tapp-main
WSGIDaemonProcess tapp-main processes=2 \
                                      threads=25 \
                                      home=/usr/share/tapp \
                                      python-path=/etc/tapp/main:/usr/share/tapp \
                                      user=tapp \
                                      group=tapp
WSGIImportScript /usr/share/tapp/wsgistartup.py \
                         process-group=tapp-main \
                         application-group=%{GLOBAL}
WSGIScriptAlias / /usr/share/tapp/wsgi.py
WSGIPassAuthorization On

I am not sure how to further debug this, any clues?

@GrahamDumpleton
Copy link
Owner

Version 4.3.0 is quite old and there have been 50+ releases since then. Use the latest version. There is no point trying to debug an older version.

@Zitrax
Copy link
Author

Zitrax commented Mar 25, 2018

Yes upgrading did work, I updated whole ubuntu though so unclear if it was mod_wsgi by itself or some other involved component.

Anyway the update was from Ubuntu 16.04 to 17.10 which changed mod_wsgi from 4.3.0 to 4.5.17 and apache from 2.4.18 to 2.4.27.

@Zitrax Zitrax closed this as completed Mar 25, 2018
@GrahamDumpleton
Copy link
Owner

So you are only 10 versions behind now. :-)

Using operating system packages for mod_wsgi from Ubuntu is usually not the best idea. At least they aren't the five years out of date as they were a few years ago. Especially when using Docker where it is much easier to install, you are better off ignoring system package for mod_wsgi and use mod_wsgi-express instead.

See:

When using mod_wsgi-express the Apache configuration is done for you, with various best practices that you likely aren't following, being applied automatically. A large part of the reason for mod_wsgi-express is to make it easier to deploy WSGI application inside of Docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants