Re: crash when ICAPModXact::parseHead throws

2006-10-25 Thread Gernot Tenchio
On Tue, 24 Oct 2006 08:12:25 -0600
Alex Rousskov <[EMAIL PROTECTED]> wrote:

> If you can reproduce with squid3-icap, please note that the above stack
> trace is missing the first 11 frames. You said that Squid crashes. How
> does it crash? What compiler are you using?

I was using a homebrewed gcc-3.4.6. After recompiling with gcc-4.1.1 it works
as expected.

Gernot


Re: crash when ICAPModXact::parseHead throws

2006-10-24 Thread Alex Rousskov
On Tue, 2006-10-24 at 07:55 +0200, Gernot Tenchio wrote:

> I see random crashes because ICAPModXact::parseHead throws an
> exception. This always happens if there are no headers to parse at all
> (maybe because of a bug on the server side).
> 
> #11 0x08113ce9 in __cxa_throw ()
> #12 0x0813ca7f in Throw ()
> #13 0x0813f435 in ICAPModXact::parseHead ()
> #14 0x08141f5e in ICAPModXact::parseIcapHead ()
> #15 0x0814229a in ICAPModXact::parseHeaders ()
> #16 0x08142675 in ICAPModXact::parseMore ()
> #17 0x081427ae in ICAPModXact::handleCommRead ()
> #18 0x08146161 in ICAPXaction::noteCommRead ()
> #19 0x081462cd in ICAPXaction_noteCommRead ()
> #20 0x080ed2cc in commio_call_callback ()
> #21 0x080ed318 in commio_call_callbacks ()
> #22 0x080efa19 in CommDispatcher::dispatch ()
> #23 0x0808b815 in EventLoop::runOnce ()
> #24 0x0808b941 in EventLoop::run ()
> #25 0x080bd877 in main ()

Throwing in exception is expected under exceptional conditions such as a
parsing failure. The exception should be caught by noteCommRead,
terminating the ICAP transaction. I have just tested it by throwing an
exception unconditionally in parseHead, and it seems to work: The ICAP
transaction terminates and the HTTP client gets an "ICAP protocol error"
response from Squid.

This is all with squid3-icap branch. I have not tested with HEAD and
would not be surprised if terminated ICAP transactions are not handled
well there.

If you can reproduce with squid3-icap, please note that the above stack
trace is missing the first 11 frames. You said that Squid crashes. How
does it crash? What compiler are you using?

Thank you,

Alex.