>On Fri, 14 Mar 2014 21:22:35 +0100
>Richard Z <r...@linux-m68k.org> wrote:

> I have meanwhile got a few more of those crashes, mine happen always
> in offline mode. It was trigered by logrotate because polipo was
> accidentally put into offline mode for logrotation

I have been looking at the code in client.c, I think I see the problem.

Let's start with httpClientNoticeRequest(). It gets passed the request
(whatever that is), it parses it and gets (1) the handle for the object
contained within and (2) some sort of a reference to a "connection". It
then fills the object from disk (using objectFillFromDisk()) and calls
httpServeObject() with the above connection. httpServeObject() then
proceeds to extract the request from the connection, extracts the
object from the request, fills it up from disk for the second time and
then proceeds to deallocate it, allocate a new object that it
"attaches" to the request and proceeds to call
httpClientNoticeRequest() with that request.

So, a bit of memory gets allocated, filled with data twice and then
deallocated all the while the stack keeps on growing.

This hypothesis is testable. If it won't inconvenience you too much
(and you still have at least one coredump around), can you please
test the following values:

A. from the httpClientNoticeRequest() stack:
  1. request
  2. request->connection
B. from the httpServeObject() stack:
  1. connection
  2. connection->request

If ((A1 == B2) && (B1 == A2)), then we have successfully isolated the
infinite loop for at least one of the two crashes.

If that truly *is* the loop, then it is obvious the problem is in the
defective data structure. We would then need to study the data
structures and see where, why and how do they get deformed.

-- 
Svi moji e-mailovi su kriptografski potpisani. Proverite ih.
All of my e-mails are cryptographically signed. Verify them.
--
You don't need an AI for a robot uprising.
Humans will do just fine.

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Polipo-users mailing list
Polipo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/polipo-users

Reply via email to