You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Martin Gerdes <ma...@googlemail.com> on 2009/10/29 14:27:31 UTC

[users@httpd] using ProxyHTMLEnable On, mod_proxy_html or xml2enc segfaults

2009/10/29 Nick Kew <ni...@webthing.com>

>
> 2009/10/28 Martin Gerdes <ma...@googlemail.com>
>
>> Background:
>> I am running Apache as provided for Debian Lenny (2.2.9-10+lenny4) as
>> a reverse proxy. To that end, I installed libapache2-mod-proxy-html
>> (3.0.0-1) for URL rewriting.
>> As the original content is in charset ISO-8859-1, I set the option
>> "ProxyHTMLCharsetOut *" to get the webpage output as ISO-8859 instead
>> of UTF-8.
>>
>> Everything worked just fine, except that a certain packet crashed the
>> proxy-html module (Paket went into the proxy, no paket came out;
>> according to the log, a process crashed at precisely that time...)
>>
>> I emailed the developer, who advised me to try the most recent version
>> (3.1.2) for which unfortunately no debian package exists. So I spent
>> half a day figuring out how to update the source debian archive with
>> the most recent source code. I managed it, installed it, and it
>> worked, and the module did not crash anymore. :-)
>>
>
> Hmmm,  I thought I advised getting me a test case that could reproduce
> the crash, and your email on Oct 26th said the problem had gone.
>

Alright, so I simplified a bit :-)
The problem IS gone with the new version. I just failed to check whether the
conversion was still happening - which it turns out it wasn't. That should
have no bearing on the crash though, as the conversion back to ISO-8859-1
happens after the links are replaced.


> However, after continuing to play around with mod-proxy-html I noticed
>> that the output stays as utf-8 (having been converted from ISO-8859-1)
>> instead of being converted back to ISO-8859-1.
>> Note that 3.0.0 worked with precisely the same configuration (except
>> that it did not need xml2enc).
>>
>
> Precisely the same configuration would be incorrect.  You need to switch
> from using apache's generic filter configuration to the new
> ProxyHTMLEnable directive.  Hence the bold
> *Important Note*: Configuration has changed:
> on its front page.
>
> But maybe you've found a docs bug, and I need to add the note
> in more places, for existing users who don't check what you
> already know about!  Where did you check?
>
> I just went to http://apache.webthing.com/mod_proxy_html/ to get the
source code. But I did not reread the page, but just fetched the archive
file.
I did look within the archive for any kind of info, like build instructions,
a readme or changelog, but there wasn't any.
I also distinctly remember looking on the website for a changelog, so an
entry there would have reached me. Other than than: Mea Culpa.

However, I still do not have it working:

Relevant configuration in /etc/apache/apache2.conf:
ProxyHTMLEnable On
ProxyHTMLCharsetOut *
ProxyHTMLExtended On
ProxyHTMLMeta On
ProxyHTMLLogVerbose On
LogLevel info

(the line "SetOutputFilter proxy-html" has been commented out)

>grep -i charset /var/log/apache2/error.log
[Thu Oct 29 13:52:34 2009] [info] [client 192.168.0.9] Got charset
ISO-8859-1 from HTTP headers
multiple times, no other charset is recognized, so that is fine

I can load the login page of the webapp, though it is returned in utf8.
Once I send of the login data, it segfaults. It did NOT do that when I used
SetOutputFilter instead of ProxyHTMLEnable, so I assume that xml2enc
crashes, though that is only conjecture.

Line in apache error log:
"[Thu Oct 29 14:18:22 2009] [notice] child pid 29443 exit signal
Segmentation fault (11)"

It makes me cry, it really does :-(

Re: [users@httpd] using ProxyHTMLEnable On, mod_proxy_html or xml2enc segfaults

Posted by Martin Gerdes <ma...@googlemail.com>.
You solved it! :-)

We have still to test the webapp in its entirety, but it doesn't crash where
it crashed before, AND correctly translates encodings :-)

Thanks a lot for your helpfulness, and the new version!

2009/10/30 Nick Kew <ni...@webthing.com>

> Martin Gerdes wrote:
>
>> Cool. Then I'll cease trying to build a test case for now. That would
>> probably have cost me another day...
>>
>
> I think I've solved it.  Well, I've found and fixed a bug that
> your response would be likely to provoke.  I hope that fixes it!
>
> http://bahumbug.wordpress.com/2009/10/29/another-module-update/
>
> (anyone using my modules should probably subscribe to the
> blog - at least to category "apache" - for updates).
>
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] using ProxyHTMLEnable On, mod_proxy_html or xml2enc segfaults

Posted by Nick Kew <ni...@webthing.com>.
Martin Gerdes wrote:
> Cool. Then I'll cease trying to build a test case for now. That would 
> probably have cost me another day...

I think I've solved it.  Well, I've found and fixed a bug that
your response would be likely to provoke.  I hope that fixes it!

http://bahumbug.wordpress.com/2009/10/29/another-module-update/

(anyone using my modules should probably subscribe to the
blog - at least to category "apache" - for updates).

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] using ProxyHTMLEnable On, mod_proxy_html or xml2enc segfaults

Posted by Martin Gerdes <ma...@googlemail.com>.
Cool. Then I'll cease trying to build a test case for now. That would
probably have cost me another day...
Small correction of the problem description: I mistakingly wrote that the
login page was served in utf8. This is incorrect: It was correctly
translated to ISO-8859-1 :-). So if you manage to fix the segfault, I'll
have a working solution. *yippie*

A scheduling info:
I won't be in the company during the next week, so I'll be unable to test
out solutions during that time.
I will still be able to respond to emails / messages to the list, though.

2009/10/29 Nick Kew <ni...@webthing.com>

>
> On 29 Oct 2009, at 14:00, Martin Gerdes wrote:
>
>  Allright, I will try.
>>
>> Stuff I can tell you immediately:
>>
>> The packet that causes the crash looks like this (sniffed with tcpdump):
>>
>> HTTP/1.1 302 Moved Temporarily
>> Server: Apache-Coyote/1.1
>> Location:
>> http://localhost:50100/dwhfe/app/start/StartPageSelector.htm;jsessionid=B6B4331C1C0C14A7BE964B89E1E76150
>> Content-Language: de-DE
>> Content-Length: 0
>> Date: Thu, 29 Oct 2009 13:47:48 GMT
>>
>
> That's just given me an idea.  I don't have time to follow up on it just
> now,
> but bug me if I haven't replied again by about Sunday.
>
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] using ProxyHTMLEnable On, mod_proxy_html or xml2enc segfaults

Posted by Nick Kew <ni...@webthing.com>.
On 29 Oct 2009, at 14:00, Martin Gerdes wrote:

> Allright, I will try.
>
> Stuff I can tell you immediately:
>
> The packet that causes the crash looks like this (sniffed with  
> tcpdump):
>
> HTTP/1.1 302 Moved Temporarily
> Server: Apache-Coyote/1.1
> Location: http://localhost:50100/dwhfe/app/start/StartPageSelector.htm;jsessionid=B6B4331C1C0C14A7BE964B89E1E76150
> Content-Language: de-DE
> Content-Length: 0
> Date: Thu, 29 Oct 2009 13:47:48 GMT

That's just given me an idea.  I don't have time to follow up on it  
just now,
but bug me if I haven't replied again by about Sunday.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] using ProxyHTMLEnable On, mod_proxy_html or xml2enc segfaults

Posted by Martin Gerdes <ma...@googlemail.com>.
Still have not managed to simplify it. I have managed to set up a simple
proxy using a virtual host, but I have yet to figure out how to fake those
http options.
Interestingly, I could get a simple sample page translated back into
ISO-8859-1 in this setup. This at least tells me that my self build package
works _in principle_.

Thought I'd send you the output of the crash with Loglevel debug. Maybe that
already tells you something:

[Thu Oct 29 16:07:14 2009] [debug] mod_proxy_http.c(60): proxy: HTTP:
canonicalising URL
//localhost:50100/dwhfe/pub/Authentication.htm;jsessionid=19D1CEB65AF823413A8D2885D4CFA2F7
[Thu Oct 29 16:07:14 2009] [debug] proxy_util.c(1488): [client 192.168.0.9]
proxy: http: found worker http://localhost:50100/dwhfe/ for
http://localhost:50100/dwhfe/pub/Authentication.htm;jsessionid=19D1CEB65AF823413A8D2885D4CFA2F7,
referer:
http://192.168.0.100:443/testdwh/pub/Authentication.htm;jsessionid=19D1CEB65AF823413A8D2885D4CFA2F7
[Thu Oct 29 16:07:14 2009] [debug] mod_proxy.c(966): Running scheme http
handler (attempt 0)
[Thu Oct 29 16:07:14 2009] [debug] mod_proxy_http.c(1937): proxy: HTTP:
serving URL
http://localhost:50100/dwhfe/pub/Authentication.htm;jsessionid=19D1CEB65AF823413A8D2885D4CFA2F7
[Thu Oct 29 16:07:14 2009] [debug] proxy_util.c(1990): proxy: HTTP: has
acquired connection for (localhost)
[Thu Oct 29 16:07:14 2009] [debug] proxy_util.c(2046): proxy: connecting
http://localhost:50100/dwhfe/pub/Authentication.htm;jsessionid=19D1CEB65AF823413A8D2885D4CFA2F7to
localhost:50100
[Thu Oct 29 16:07:14 2009] [debug] proxy_util.c(2139): proxy: connected
/dwhfe/pub/Authentication.htm;jsessionid=19D1CEB65AF823413A8D2885D4CFA2F7 to
localhost:50100
[Thu Oct 29 16:07:14 2009] [debug] proxy_util.c(2291): proxy: HTTP: fam 2
socket created to connect to localhost
[Thu Oct 29 16:07:14 2009] [debug] proxy_util.c(2386): proxy: HTTP:
connection complete to 127.0.0.1:50100 (localhost)
[Thu Oct 29 16:07:15 2009] [debug] proxy_util.c(1071): ppr: real:
http://localhost:50100/dwhfe/
[Thu Oct 29 16:07:15 2009] [debug] mod_proxy_http.c(1710): proxy: start body
send
[Thu Oct 29 16:07:15 2009] [notice] child pid 4210 exit signal Segmentation
fault (11)

I'll continue to try to build a simple test case, but I have to figure a bit
more stuff out for that...

2009/10/29 Martin Gerdes <ma...@googlemail.com>

> Allright, I will try.
>
> Stuff I can tell you immediately:
>
> The packet that causes the crash looks like this (sniffed with tcpdump):
>
> HTTP/1.1 302 Moved Temporarily
> Server: Apache-Coyote/1.1
> Location:
> http://localhost:50100/dwhfe/app/start/StartPageSelector.htm;jsessionid=B6B4331C1C0C14A7BE964B89E1E76150
> Content-Language: de-DE
> Content-Length: 0
> Date: Thu, 29 Oct 2009 13:47:48 GMT
>
> That packet goes into the apache proxy, and does not come out of it, with
> the apache error log reporting the segfault.
> No entries immediately prior to the segfault in the log file, with verbose
> logging turned on, and loglevel info.
>
> Will now test whether I can put the same content into a static website
> getting the same crash...
>
> 2009/10/29 Nick Kew <ni...@webthing.com>
>
>> Martin Gerdes wrote:
>>
>>
>>  I can load the login page of the webapp, though it is returned in utf8.
>>> Once I send of the login data, it segfaults. It did NOT do that when I
>>> used SetOutputFilter instead of ProxyHTMLEnable, so I assume that xml2enc
>>> crashes, though that is only conjecture.
>>>
>>> Line in apache error log:
>>> "[Thu Oct 29 14:18:22 2009] [notice] child pid 29443 exit signal
>>> Segmentation fault (11)"
>>>
>>
>> In that case, we're back to step one.  Construct a minimal test case
>> that reproduces the fault, so I can get a handle on it.
>>
>> --
>> Nick Kew
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>

Re: [users@httpd] using ProxyHTMLEnable On, mod_proxy_html or xml2enc segfaults

Posted by Martin Gerdes <ma...@googlemail.com>.
Allright, I will try.

Stuff I can tell you immediately:

The packet that causes the crash looks like this (sniffed with tcpdump):

HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Location:
http://localhost:50100/dwhfe/app/start/StartPageSelector.htm;jsessionid=B6B4331C1C0C14A7BE964B89E1E76150
Content-Language: de-DE
Content-Length: 0
Date: Thu, 29 Oct 2009 13:47:48 GMT

That packet goes into the apache proxy, and does not come out of it, with
the apache error log reporting the segfault.
No entries immediately prior to the segfault in the log file, with verbose
logging turned on, and loglevel info.

Will now test whether I can put the same content into a static website
getting the same crash...

2009/10/29 Nick Kew <ni...@webthing.com>

> Martin Gerdes wrote:
>
>  I can load the login page of the webapp, though it is returned in utf8.
>> Once I send of the login data, it segfaults. It did NOT do that when I
>> used SetOutputFilter instead of ProxyHTMLEnable, so I assume that xml2enc
>> crashes, though that is only conjecture.
>>
>> Line in apache error log:
>> "[Thu Oct 29 14:18:22 2009] [notice] child pid 29443 exit signal
>> Segmentation fault (11)"
>>
>
> In that case, we're back to step one.  Construct a minimal test case
> that reproduces the fault, so I can get a handle on it.
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] using ProxyHTMLEnable On, mod_proxy_html or xml2enc segfaults

Posted by Nick Kew <ni...@webthing.com>.
Martin Gerdes wrote:

> I can load the login page of the webapp, though it is returned in utf8.
> Once I send of the login data, it segfaults. It did NOT do that when I 
> used SetOutputFilter instead of ProxyHTMLEnable, so I assume that 
> xml2enc crashes, though that is only conjecture.
> 
> Line in apache error log:
> "[Thu Oct 29 14:18:22 2009] [notice] child pid 29443 exit signal 
> Segmentation fault (11)"

In that case, we're back to step one.  Construct a minimal test case
that reproduces the fault, so I can get a handle on it.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org