redirect fails within HTTPS vhost #1

Open
fanto666 opened this Issue Nov 16, 2010 · 5 comments

Projects

None yet

2 participants

@fanto666

when I have SSL virtual host with an alias and have UseCanonicalName On, asking for the alias causes segmentation fault.

...we have wildcard certificate and even some old aliases not matching the certificate, we want people to use the new name so displayed errors are not an issue, we just neet the redirect to succeed.

tried with apache 2.2.16, mod_common_redirect 0.1 and 0.1.1.

@hollow
Owner

please run apache with gdb to get a backtrace. it is possible to force apache into single thread mode as described here: http://httpd.apache.org/dev/debugging.html

@fanto666

Program received signal SIGSEGV, Segmentation fault.
0x00002aaaac85b972 in strlen () from /lib/libc.so.6
(gdb) backtrace
#0 0x00002aaaac85b972 in strlen () from /lib/libc.so.6
#1 0x00002aaaabb56ceb in apr_pstrcat () from /usr/lib/libapr-1.so.0
#2 0x00002aaab2106d07 in ?? () from /vservers/svc/usr/lib64/apache2/modules/mod_common_redirect.so

I hope this'll help at least a bit.
If needed, I can recompile apache and mod_common_redirect and try running them unstripped to get more debugging informations

@fanto666

#0 0x00002aaaac85b972 in strlen () from /lib/libc.so.6
#1 0x00002aaaabb56ceb in apr_pstrcat () from /usr/lib/libapr-1.so.0
#2 0x00002aaab2107b9a in cr_construct_url (r=0xc71930, host=0x71d0b8 "webmail.gts.sk", scheme=0xffffffffb189322b <Address 0xffffffffb189322b out of bounds>) at mod_common_redirect.c:29
#3 0x00002aaab2107cc5 in cr_post_read_request (r=0xc71930) at mod_common_redirect.c:57

and the proper virtual host:

<VirtualHost svc.gts.sk:443>
ServerName webmail.gts.sk
ServerAlias webmail.nextra.sk
ServerAlias webmail-beta.gts.sk
ServerAlias webmail.gtsnextra.sk webmail.gtsi.sk
SSLEngine on
DocumentRoot [hidden]
</VirtualHost>

@hollow
Owner

i've cleanuped up the url construction, though i doubt that it'll fix your problem. i've also added another debug log statement, to check the values in cr_construct_url. please test and paste the debug output from the apache log here. thanks!

@fanto666

#0 0x00002aaaac85b972 in strlen () from /lib/libc.so.6
#1 0x00002aaaabb58d2c in apr_vformatter () from /usr/lib/libapr-1.so.0
#2 0x00002aaaabb59c20 in apr_vsnprintf () from /usr/lib/libapr-1.so.0
#3 0x000000000043ebd5 in log_error_core ()
#4 0x000000000043faf1 in ap_log_rerror ()
#5 0x00002aaab2107b82 in cr_construct_url (r=0xc71be0, host=0x71d0b8 "webmail.gts.sk", scheme=0xffffffffb189322b

) at mod_common_redirect.c:22
#6 0x00002aaab2107cb3 in cr_post_read_request (r=0xc71be0) at mod_common_redirect.c:57
#7 0x000000000042ca30 in ap_run_post_read_request ()

the only thing I see in addition to ssl engine initialization is:

[Mon Nov 29 16:44:53 2010] [debug] mod_common_redirect.c(41): [client 195.168.3.66] cr_post_read_request: checking common redirects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment