segmentation fault

41 views
Skip to first unread message

k bx

unread,
Jul 20, 2011, 6:10:33 AM7/20/11
to mod...@googlegroups.com
Hi! We are using Ubuntu Server 10.04 with latest updates and it's apache+mod_wsgi. And recently it sometimes started to raise segmentation fault's. So we managed to connect to process with gdb and see stack trace on error:

[Switching to Thread 0x7f748f10c700 (LWP 28215)]
0x00007f74941a8b8a in ap_add_common_vars (r=0x7f747c1218a8) at /build/buildd/apache2-2.2.14/server/util_script.c:242
242     /build/buildd/apache2-2.2.14/server/util_script.c: No such file or directory.
        in /build/buildd/apache2-2.2.14/server/util_script.c
(gdb) bt
#0  0x00007f74941a8b8a in ap_add_common_vars (r=0x7f747c1218a8) at /build/buildd/apache2-2.2.14/server/util_script.c:242
#1  0x00007f7491462ec6 in wsgi_build_environment () from /usr/lib/apache2/modules/mod_wsgi.so
#2  0x00007f7491464861 in wsgi_hook_handler () from /usr/lib/apache2/modules/mod_wsgi.so
#3  0x00007f74941a2380 in ap_run_handler (r=0x7f747c1218a8) at /build/buildd/apache2-2.2.14/server/config.c:159
#4  0x00007f74941a5ce8 in ap_invoke_handler (r=0x7f747c1218a8) at /build/buildd/apache2-2.2.14/server/config.c:373
#5  0x00007f74941b35e8 in ap_process_request (r=0x7f747c1218a8) at /build/buildd/apache2-2.2.14/modules/http/http_request.c:282
#6  0x00007f74941b0498 in ap_process_http_connection (c=0x7f7494f49360) at /build/buildd/apache2-2.2.14/modules/http/http_core.c:190
#7  0x00007f74941a9f38 in ap_run_process_connection (c=0x7f7494f49360) at /build/buildd/apache2-2.2.14/server/connection.c:43
#8  0x00007f74941b8e82 in process_socket (thd=<value optimized out>, dummy=<value optimized out>) at /build/buildd/apache2-2.2.14/server/mpm/worker/worker.c:544
#9  worker_thread (thd=<value optimized out>, dummy=<value optimized out>) at /build/buildd/apache2-2.2.14/server/mpm/worker/worker.c:894
#10 0x00007f74938deeb3 in ?? () from /usr/lib/libapr-1.so.0
#11 0x00007f749369e9ca in start_thread () from /lib/libpthread.so.0
#12 0x00007f74933fb70d in clone () from /lib/libc.so.6
#13 0x0000000000000000 in ?? ()

What can it be? Thank you.

Graham Dumpleton

unread,
Jul 20, 2011, 6:14:48 AM7/20/11
to mod...@googlegroups.com
What version of mod_wsgi?

Are you using mod_python in same Apache?

Are you using mod_php in same Apache?

Are you using mod_ssl?

If using SSL, can you upgrade to newer Apache version?

Graham

> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/f3NWDcWo1YYJ.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to
> modwsgi+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.
>

k bx

unread,
Jul 20, 2011, 7:04:14 AM7/20/11
to mod...@googlegroups.com
Sorry didn't mention that.

mod_wsgi from apache (2.2.14, maybe Ubuntu's patches). No mod_python, no mod_php, no mod_ssl.

среда, 20 июля 2011 г. 13:14:48 UTC+3 пользователь Graham Dumpleton написал:

k bx

unread,
Jul 20, 2011, 7:04:37 AM7/20/11
to mod...@googlegroups.com
Oh, I mean mod_wsgi 3.3

Graham Dumpleton

unread,
Jul 20, 2011, 7:10:53 AM7/20/11
to mod...@googlegroups.com
The only time I have seen it crash in that particular spot it was
caused by another Apache module, I thought mod_ssl, but could be one
of the LDAP modules. The other module was adding to the
req.subprocess_env table in Apache, which is what that function is
processing, an entry where the value was NULL rather than an empty
string. This would cause Apache to crash. I'll have a quick look to
see if can find old email but may be hard to find. As such, only
recommendation can suggest is to update Apache first and see if it
goes away.

Graham

2011/7/20 k bx <kos...@gmail.com>:

> https://groups.google.com/d/msg/modwsgi/-/nDBTTHHcIzcJ.

k bx

unread,
Jul 20, 2011, 8:06:52 AM7/20/11
to mod...@googlegroups.com
ok, line above http://www.google.com/codesearch#lfs-jRjrQ3s/tags/2.2.14/server/util_script.c&type=cs&l=241 c->remote_addr is NULL, that's why if fails. But why is it NULL?

k bx

unread,
Jul 20, 2011, 10:10:36 AM7/20/11
to mod...@googlegroups.com
maybe I should also mention that crash happens in one of 2 threads controlled by StartServers directive (and not ones created by mod_wsgi).

k bx

unread,
Jul 21, 2011, 5:27:42 PM7/21/11
to mod...@googlegroups.com
We haven't really figured out what was that, but disabling rpaf helped, and then our sysadmin saw small missconfiguration of rpaf (that leaded on specific url that x-forwarded-for was not sent), turned it on again, but with a bit different config. Anyway we could not reproduce this bug in local environment, and it's gone in production, so let's consider it solved?
Reply all
Reply to author
Forward
0 new messages