Mod_wsgi工作进程分段错误(11)

2024-03-11

我的 django 应用程序有问题,该应用程序由 apache/mod_wsgi 托管。我在应用程序中添加了一些 matplotlib 代码,apache 工作进程现在崩溃了。

我将这个问题简化为以下内容:

  • 没有任何 matplotlib 导入应用程序可以正常工作
  • 当“import matplotlib”添加到应用程序中的任何位置时,工作进程会因段错误而终止,并且用户看不到来自服务器的回复
  • “import matplotlib”在命令行 python 解释器中工作得很好 - 段错误仅发生在 apache 进程中

这是日志条目:

[Tue May 24 08:29:08 2011] [notice] child pid 17576 exit signal Segmentation fault (11)

我无法在其他计算机上重现问题。 我尝试删除 (rm site-packages/matplotli*) 并安装不同版本的 matplotlib (0.99.3、1.0.0、1.0.1) 我尝试在 virtualenv 中安装所有模块,并从 .wsgi 脚本指向 virtualenv。

我试过这个:错误:子 pid 6695 退出信号分段错误 (11) https://stackoverflow.com/questions/6079726/error-child-pid-6695-exit-signal-segmentation-fault-11 I read http://code.google.com/p/modwsgi/wiki/ http://code.google.com/p/modwsgi/wiki/以及。

任何有关如何调试/解决此问题的指示将不胜感激。

(我什至准备移动到任何其他服务器(paste/cherrypy + apache mod_proxy 等)来消除问题。)

这是我的阿帕奇设置:

/usr/sbin/httpd -V

Server version: Apache/2.2.15 (Unix)
Server built:   Apr 10 2010 11:21:07
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.3.9, APR-Util 1.3.10
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

/usr/sbin/httpd -l

Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

/usr/sbin/httpd -M

Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_file_module (shared)
 authn_alias_module (shared)
 authn_anon_module (shared)
 authn_dbm_module (shared)
 authn_default_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 authz_owner_module (shared)
 authz_groupfile_module (shared)
 authz_dbm_module (shared)
 authz_default_module (shared)
 ldap_module (shared)
 authnz_ldap_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 env_module (shared)
 ext_filter_module (shared)
 mime_magic_module (shared)
 expires_module (shared)
 deflate_module (shared)
 headers_module (shared)
 usertrack_module (shared)
 setenvif_module (shared)
 mime_module (shared)
 dav_module (shared)
 status_module (shared)
 autoindex_module (shared)
 info_module (shared)
 dav_fs_module (shared)
 vhost_alias_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 actions_module (shared)
 speling_module (shared)
 userdir_module (shared)
 alias_module (shared)
 rewrite_module (shared)
 wsgi_module (shared)
 ssl_module (shared)
Syntax OK

阿帕奇配置

<VirtualHost *:443>

    ServerName              somesite.com
    DocumentRoot            "/somedir"

    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptAlias / /somedir/production.wsgi

    <..>

</VirtualHost>

在你说你读过的维基百科中,你应该已经找到:

http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Debugging_Crashes_With_GDB http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Debugging_Crashes_With_GDB

作为旁注,建议您不要使用预分叉/嵌入模式。如果您被迫使用 prefork MPM,请使用 mod_wsgi 守护进程模式。读:

http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html

出于某些原因。

其他人已经让 matplotlib 与 mod_wsgi 一起工作,所以不能立即明显看出问题是什么。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Mod_wsgi工作进程分段错误(11) 的相关文章

随机推荐

  • 使用 PowerShell,如何让 Write-Debug 输出显示在控制台中?

    我正在学习 PowerShell 并正在使用写主机 https learn microsoft com en gb powershell module Microsoft PowerShell Utility Write Host检查新 P
  • NHibernate - 根据子属性过滤结果

    我有这段代码获取所有启用的组及其子组 我遇到的问题是 孩子们也可以被禁用 但我无法流畅地 nhibernate 只获取其中的组all儿童已启用 我认为这是可能的 但如何实现呢 public class Group public bool I
  • 在 Python 类中序列化 @property 方法

    在序列化 Django 模型类时 有没有办法将任何 property 定义传递到 json 序列化器 example class FooBar object Model name models CharField property def
  • 带有 pdf 黑色闪烁的 iframe(闪烁)

    我的页面上有一个带有 pdf 的 iframe 并尝试在滚动 iframe 时禁用主窗口的滚动 这是它的代码 iframe mouseover function var html html html data previous overfl
  • htaccess 将除一页之外的所有页面从 html 重定向到 php

    我的网站设置为 htaccess 将所有页面从 html 定向到 php 如下所示 RewriteEngine On RewriteBase RewriteCond HTTP HOST website com RewriteRule htt
  • 当 iPad 处于纵向方向时缩小 Mobile Safari 视口宽度?-

    我正在开发一个网站 该网站设计为在 iPad 上以横向模式查看时效果最佳 一切都是 1024px 宽 div 容器 然而 我仍然需要缩小视口 这样当用户将 iPad 转为纵向时 用户不必缩小或水平滚动来查看页面上的所有内容 目前我有这个标签
  • 正则表达式匹配任何包含特定字母或更多字母的单词?

    我需要一个正则表达式来匹配任何包含字母的单词 m a h d以任何顺序在一起 所以 Mohamed Hamada and Mahmoud匹配 但是hammer不匹配 我尝试执行以下操作 我是正则表达式的新手 Regex reg new Re
  • 索引和长度必须引用字符串内的位置?

    我想获取前 50 个字母 所以我使用了subString函数来获取它 如您所见 我使用以下代码来获取它 但不幸的是它不起作用并且出现错误消息 索引和长度必须引用字符串中的位置 那么还有其他方法可以修复吗 因为用户是控制数据输入的人 有时他会
  • float 到 long 转换时出错[重复]

    这个问题在这里已经有答案了 我猜这是由于浮点和准确性造成的 但我只是想检查一下以确保没有遗漏任何其他内容 我有一个 1007 62 的浮点数 存储在 info Amount 中 该浮点数乘以 100 并转换为 long 此时我得到的值为 1
  • 集合类型属性的设置器

    集合类型属性是否需要设置器 Type 1 class Company private IList
  • uWSGI、Flask、sqlalchemy 和 postgres:SSL 错误:解密失败或坏记录 mac

    我正在尝试使用 uWSGI Nginx 设置一个应用程序网络服务器 它使用 SQLAlchemy 运行 Flask 应用程序来与 Postgres 数据库进行通信 当我向网络服务器发出请求时 所有其他响应都将是 500 错误 错误是 Tra
  • Java日期更改格式[重复]

    这个问题在这里已经有答案了 我正在尝试更改格式Date对象 我尝试这样做 for Date date dates DateFormat formatter new SimpleDateFormat yyyy MM dd String for
  • 将 Python 枚举编码为 JSON

    我有一本字典 其中一些键是 Enum 实例 enum Enum 的子类 我正在尝试使用自定义 JSON 编码器类将字典编码为 JSON 字符串 如下所示文档 https docs python org 3 library json html
  • 创建卷的 Docker 容器后,本地主机上的权限更改为 1000

    我的容器使用外部卷创建后 权限变为1000 drwxr x 71000 10004096 三月 02 01 13 my domain 每次我需要更改它我的用户 AS docker 由 root 用户安装 我怎样才能避免这种情况 有人可以写点
  • 将 Jython 与 Maven 结合使用

    我有一个 Maven 模块 它依赖于我通过 jython 代码访问的各种其他 Maven 依赖项 我现在已经完成了 我想将项目编译为 jar 或者甚至只是运行它而不编译 但我不知道从哪里开始 有谁知道如何运行一些 py 文件来访问其他包中的
  • MYSQL - 使用 while 循环更新

    declare c int set c 1 while c lt 700 do update users set profile display name concat substring first name 1 1 last name
  • .NET Core 更新迁移正在尝试再次重新创建表

    我首先正在开发 net core 3 项目代码 在此步骤中 我在表中添加了 2 列 然后我通过此代码 CLI 对解决方案进行了迁移添加 dotnet ef startup project MyApi Api migrations add a
  • mysql.service 丢失但显示在列表中 - 安装失败

    我使用的是 Ubuntu 17 04 长话短说 在与 MariaDB 进行了一些斗争之后 我遵循了一些关于如何完全地从我的家庭服务器中删除 MySQL 和 MariaDB 现在我无法重新安装mysql server 当我尝试时出现此错误 F
  • 非 ANSI 文件的 TStringList 行为

    在我的应用程序中 当我想要导入文件时 我使用 TStringList 但是 当有人从Excel导出数据时 文件编码是UCS 2 Little Endian TStringList无法读取数据 有什么方法可以验证这种情况 识别文本编码并向用户
  • Mod_wsgi工作进程分段错误(11)

    我的 django 应用程序有问题 该应用程序由 apache mod wsgi 托管 我在应用程序中添加了一些 matplotlib 代码 apache 工作进程现在崩溃了 我将这个问题简化为以下内容 没有任何 matplotlib 导入