姜戈 + dbxml +阿帕奇=问题。有什么解决办法吗?

发布于 2024-08-09 19:16:04 字数 6500 浏览 11 评论 0原文

我正在尝试使用 WSGI 设置 Django 应用程序。效果很好。但是,我的 Django 应用程序中使用 BDB XML 的部分遇到了一些问题。我的 Apache 配置如下:

Listen 8000
WSGISocketPrefix /tmp/wsgi
<VirtualHost *:8000>
    ServerName <server name>
    DocumentRoot <path to doc root>

    LogLevel info

    WSGIScriptAlias / <path to wsgi>
    WSGIApplicationGroup %{GLOBAL}
    WSGIDaemonProcess debug threads=1
    WSGIProcessGroup debug
</VirtualHost>

但是,我仍然收到以下错误:

DB_ENV->repmgr_stat interface requires an environment configured for the replication subsystem
[error] child died with signal 11

我的环境打开为:

environment = DBEnv()

environment.open(
    <absolute db env path>,
    DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL,
    0
)

我正在使用:

  • python 2.6.2
  • apache 2.2
  • ubuntu 9.04
  • dbxml 2.5.13 从源代码编译(所以 libdb-4.8,bsddb3 ,所有爵士乐)

我看到 Apache 似乎链接到 libdb-4.6。这是一个问题吗?

ldd /usr/sbin/apache2 | grep libdb
libdb-4.6.so => /usr/lib/libdb-4.6.so (0xb7c01000)

已更新

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb5a48b90 (LWP 12700)]
0x00000000 in ?? ()
(gdb) thread apply all bt

Thread 4 (Thread 0xb6a67b90 (LWP 12698)):
#0  0xb7f11422 in __kernel_vsyscall ()
#1  0xb7de07b1 in select () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7ea5bcf in apr_sleep () from /usr/lib/libapr-1.so.0
#3  0xb6d7afee in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#4  0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0
#5  0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 3 (Thread 0xb6249b90 (LWP 12699)):
#0  0xb7f11422 in __kernel_vsyscall ()
#1  0xb7de07b1 in select () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7ea5bcf in apr_sleep () from /usr/lib/libapr-1.so.0
#3  0xb6d7ab39 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#4  0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0
#5  0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread 0xb5a48b90 (LWP 12700)):
#0  0x00000000 in ?? ()
#1  0xb4f03b5e in DbXml::XmlManager::XmlManager () from /home/jason/dbxml-2.5.13/install/lib/libdbxml-2.5.so
#2  0xb501b29b in _wrap_new_XmlManager (self=0x0, args=0xac66fcc) at dbxml_python_wrap.cpp:5183
#3  0xb6b77aed in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0
#4  0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#5  0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#6  0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#7  0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0
#8  0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#9  0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#10 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#11 0xb6b9ae03 in ?? () from /usr/lib/libpython2.6.so.1.0
#12 0xb6b90f55 in ?? () from /usr/lib/libpython2.6.so.1.0
#13 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#14 0xb6bd7618 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#15 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#16 0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0
#17 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#18 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#19 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#20 0xb6bd3a34 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#21 0xb6b44a7d in PyInstance_New () from /usr/lib/libpython2.6.so.1.0
#22 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#23 0xb6bd7618 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#24 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#25 0xb6b61969 in ?? () from /usr/lib/libpython2.6.so.1.0
#26 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#27 0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#28 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#29 0xb6b61969 in ?? () from /usr/lib/libpython2.6.so.1.0
#30 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#31 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#32 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#33 0xb6b9b483 in ?? () from /usr/lib/libpython2.6.so.1.0
#34 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#35 0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#36 0xb6bdab4f in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#37 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#38 0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0
#39 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#40 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#41 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#42 0xb6b9b483 in ?? () from /usr/lib/libpython2.6.so.1.0
#43 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#44 0xb6bd3a34 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#45 0xb6d7172d in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#46 0xb6d7539f in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#47 0xb6d7e1d8 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#48 0xb6d7a42c in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#49 0xb6d7a8bd in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#50 0xb6d7a9c5 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#51 0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0
#52 0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#53 0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb7460b00 (LWP 12697)):
#0  0xb7f11422 in __kernel_vsyscall ()
#1  0xb7e75300 in sigwait () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb7ea3f3b in apr_signal_thread () from /usr/lib/libapr-1.so.0
#3  0xb6d7b48d in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#4  0xb6d7bc98 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#5  0xb6d79632 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#6  0xb7e9a2c9 in apr_proc_other_child_alert () from /usr/lib/libapr-1.so.0
#7  0x08092202 in ap_mpm_run ()
#8  0x080673c8 in main ()
#0  0x00000000 in ?? ()

I'm trying to set up a Django application using WSGI. That works fine. However, I am having some issues with part of my Django app that uses BDB XML. My Apache config is as follows:

Listen 8000
WSGISocketPrefix /tmp/wsgi
<VirtualHost *:8000>
    ServerName <server name>
    DocumentRoot <path to doc root>

    LogLevel info

    WSGIScriptAlias / <path to wsgi>
    WSGIApplicationGroup %{GLOBAL}
    WSGIDaemonProcess debug threads=1
    WSGIProcessGroup debug
</VirtualHost>

However, I'm still getting the following error:

DB_ENV->repmgr_stat interface requires an environment configured for the replication subsystem
[error] child died with signal 11

My environment is opened as:

environment = DBEnv()

environment.open(
    <absolute db env path>,
    DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL,
    0
)

I am using:

  • python 2.6.2
  • apache 2.2
  • ubuntu 9.04
  • dbxml 2.5.13 compiled from source (so libdb-4.8, bsddb3, all that jazz)

I see Apache seems to link to libdb-4.6. Is this a problem?

ldd /usr/sbin/apache2 | grep libdb
libdb-4.6.so => /usr/lib/libdb-4.6.so (0xb7c01000)

Updated

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb5a48b90 (LWP 12700)]
0x00000000 in ?? ()
(gdb) thread apply all bt

Thread 4 (Thread 0xb6a67b90 (LWP 12698)):
#0  0xb7f11422 in __kernel_vsyscall ()
#1  0xb7de07b1 in select () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7ea5bcf in apr_sleep () from /usr/lib/libapr-1.so.0
#3  0xb6d7afee in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#4  0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0
#5  0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 3 (Thread 0xb6249b90 (LWP 12699)):
#0  0xb7f11422 in __kernel_vsyscall ()
#1  0xb7de07b1 in select () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7ea5bcf in apr_sleep () from /usr/lib/libapr-1.so.0
#3  0xb6d7ab39 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#4  0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0
#5  0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread 0xb5a48b90 (LWP 12700)):
#0  0x00000000 in ?? ()
#1  0xb4f03b5e in DbXml::XmlManager::XmlManager () from /home/jason/dbxml-2.5.13/install/lib/libdbxml-2.5.so
#2  0xb501b29b in _wrap_new_XmlManager (self=0x0, args=0xac66fcc) at dbxml_python_wrap.cpp:5183
#3  0xb6b77aed in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0
#4  0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#5  0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#6  0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#7  0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0
#8  0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#9  0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#10 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#11 0xb6b9ae03 in ?? () from /usr/lib/libpython2.6.so.1.0
#12 0xb6b90f55 in ?? () from /usr/lib/libpython2.6.so.1.0
#13 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#14 0xb6bd7618 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#15 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#16 0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0
#17 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#18 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#19 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#20 0xb6bd3a34 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#21 0xb6b44a7d in PyInstance_New () from /usr/lib/libpython2.6.so.1.0
#22 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#23 0xb6bd7618 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#24 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#25 0xb6b61969 in ?? () from /usr/lib/libpython2.6.so.1.0
#26 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#27 0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#28 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#29 0xb6b61969 in ?? () from /usr/lib/libpython2.6.so.1.0
#30 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#31 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#32 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#33 0xb6b9b483 in ?? () from /usr/lib/libpython2.6.so.1.0
#34 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#35 0xb6bd70b5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#36 0xb6bdab4f in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#37 0xb6bdb910 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#38 0xb6b6187a in ?? () from /usr/lib/libpython2.6.so.1.0
#39 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#40 0xb6b427a8 in ?? () from /usr/lib/libpython2.6.so.1.0
#41 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#42 0xb6b9b483 in ?? () from /usr/lib/libpython2.6.so.1.0
#43 0xb6b3198c in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#44 0xb6bd3a34 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#45 0xb6d7172d in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#46 0xb6d7539f in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#47 0xb6d7e1d8 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#48 0xb6d7a42c in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#49 0xb6d7a8bd in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#50 0xb6d7a9c5 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#51 0xb7ea38ec in ?? () from /usr/lib/libapr-1.so.0
#52 0xb7e6d4ff in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#53 0xb7de849e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb7460b00 (LWP 12697)):
#0  0xb7f11422 in __kernel_vsyscall ()
#1  0xb7e75300 in sigwait () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb7ea3f3b in apr_signal_thread () from /usr/lib/libapr-1.so.0
#3  0xb6d7b48d in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#4  0xb6d7bc98 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#5  0xb6d79632 in ?? () from /usr/lib/apache2/modules/mod_wsgi.so
#6  0xb7e9a2c9 in apr_proc_other_child_alert () from /usr/lib/libapr-1.so.0
#7  0x08092202 in ap_mpm_run ()
#8  0x080673c8 in main ()
#0  0x00000000 in ?? ()

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一桥轻雨一伞开 2024-08-16 19:16:04

第一步是设置:

LogLevel info

并查看错误日志记录以验证它实际上正在主解释器中运行。为此,在加载 WSGI 脚本的消息中记录的应用程序组应该是空字符串。

唯一要做的就是以守护进程模式运行并附加 gdb 并尝试捕获堆栈跟踪以协助调试。请参阅:

http://code.google.com/p/modwsgi/wiki/调试技术#Debugging_Crashes_With_GDB

A first step would to set:

LogLevel info

and look at error logging to verify it is actually being run in main interpreter. For that the application group logged should be empty string in message where WSGI script is loaded.

Only other thing to do is to run in daemon mode and attach gdb and try and capture stack trace to assist in debugging. See:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文