Woops, forget to paste in the kill -USR2 and the gdb afterwards.

fed:polipo-20080907 1035$ kill -USR2 19698
fed:polipo-20080907 1036$ gdb polipo 19698
GNU gdb Red Hat Linux (6.6-45.fc8rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
Attaching to program: /home/fming/download/polipo-20080907/polipo, process
19698
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0x00110416 in __kernel_vsyscall ()
(gdb) break server.c:540
Breakpoint 1 at 0x805ec3d: file server.c, line 540.
Missing separate debuginfos, use: debuginfo-install glibc.i686
(gdb) c
Continuing.
DNS: Host not found
Host this.url.noexist lookup failed: Host not found (131072).

Breakpoint 1, httpServerConnectionDnsHandler (status=-131072,
request=0xbf9ee558)
    at server.c:541
541             connection->connecting = 0;
(gdb) print *message
$1 = {refcount = 10, next = 0x0, length = 51, string = "H"}
(gdb) print "%s\n", message->string
$2 = "H"
(gdb) printf "%s\n", message->string
Host this.url.noexist lookup failed: Host not found

On Thu, Apr 23, 2009 at 11:01 AM, Ming Fu <[email protected]> wrote:

> Hi,
>
> I found the polipo grow bigger in memory footage upon bombed with url of
> non-exist dns.
> Each failed dns lookup will create an atom struct with the error message.
> The reference count of the atom
>
> int
>
> httpServerConnectionDnsHandler(int status, GethostbynameRequestPtr request)
> {
>     HTTPConnectionPtr connection = request->data;
>
>     httpSetTimeout(connection, -1);
>
>     if(status <= 0) {
>         AtomPtr message;
>
>         message = internAtomF("Host %s lookup failed: %s",
>                               request->name ?
>                               request->name->string : "(unknown)",
>                               request->error_message ?
>
>                               request->error_message->string :
>                               pstrerror(-status));
>         do_log(L_ERROR, "Host %s lookup failed: %s (%d).\n",
>                request->name ?
>
>                scrub(request->name->string) : "(unknown)",
>                request->error_message ?
>                request->error_message->string :
>                pstrerror(-status), -status);
>
>         connection->connecting = 0;
>         if(connection->server->request)
>             httpServerAbortRequest(connection->server->request, 1, 504,
>                                    retainAtom(message));
>
>         httpServerAbort(connection, 1, 502, message);
>         return 1;
>     }
>
> Below are the gdb traces from polipo-20080907. I use wget to feed polipo
> with url "this.url.noexist"
>
> # export http_proxy=127.0.0.1:7070
> # wget this.url.noexist
>
> I feed it with the same bad url and see the atom reference count increase
> every time.
> I also tried to detach gdb from the polipo and send it a USR2 signal to see
> if clean up the objects can free up the atom. It doesn't.
> See the two gdb of the same process, and the kill -USR2 in between.
>
> Any in depth explanation of what does the httpServerAbortRequest() and
> httpServerAbort() do will be helpful for me to track down the root of the
> problem.
>
> Thanks
> Ming
>
> (gdb) break server.c:540
> Breakpoint 1 at 0x805ec3d: file server.c, line 540.
> Missing separate debuginfos, use: debuginfo-install glibc.i686
> (gdb) c
> Continuing.
> DNS: Host not found
> Host this.url.noexist lookup failed: Host not found (131072).
>
> Breakpoint 1, httpServerConnectionDnsHandler (status=-131072,
> request=0xbf9ee558)
>     at server.c:541
> 541             connection->connecting = 0;
> (gdb) print *message
> $1 = {refcount = 5, next = 0x0, length = 51, string = "H"}
> (gdb) printf "%s", message.string
> Host this.url.noexist lookup failed: Host not found(gdb)
> (gdb) c
> Host this.url.noexist lookup failed: Host not foundContinuing.
> DNS: Host not found
> Host this.url.noexist lookup failed: Host not found (131072).
>
> Breakpoint 1, httpServerConnectionDnsHandler (status=-131072,
> request=0xbf9ee558)
>     at server.c:541
> 541             connection->connecting = 0;
> (gdb) printf "%s", message.string
> Host this.url.noexist lookup failed: Host not found(gdb) printf "%s",
> message.string
> (gdb) printf "%s", message.string
> Host this.url.noexist lookup failed: Host not found(gdb)
> Host tprintf "%s", message.string
> Host this.url.noexist lookup failed: Host not found(gdb) c
> Host this.url.noexist lookup failed: Host not foundContinuing.
> DNS: Host not found
> Host this.url.noexist lookup failed: Host not found (131072).
>
> Breakpoint 1, httpServerConnectionDnsHandler (status=-131072,
> request=0xbf9ee558)
>     at server.c:541
> 541             connection->connecting = 0;
> (gdb) print *message
> $2 = {refcount = 7, next = 0x0, length = 51, string = "H"}
> (gdb) printf "%s", message.string
> Host this.url.noexist lookup failed: Host not found(gdb) c
> Continuing.
> DNS: Host not found
> Host this.url.noexist lookup failed: Host not found (131072).
>
> Breakpoint 1, httpServerConnectionDnsHandler (status=-131072,
> request=0xbf9ee558)
>     at server.c:541
> 541             connection->connecting = 0;
> (gdb) print *message
> $3 = {refcount = 8, next = 0x0, length = 51, string = "H"}
> (gdb) printf "%s", message.string
> Host this.url.noexist lookup failed: Host not found(gdb)
> (gdb) c
> Host this.url.noexist lookup failed: Host not foundContinuing.
> DNS: Host not found
> Host this.url.noexist lookup failed: Host not found (131072).
>
> Breakpoint 1, httpServerConnectionDnsHandler (status=-131072,
> request=0xbf9ee558)
>     at server.c:541
> 541             connection->connecting = 0;
> (gdb) print *message
> $4 = {refcount = 9, next = 0x0, length = 51, string = "H"}
> (gdb) printf "%s", message.string
> Host this.url.noexist lookup failed: Host not found(gdb) c
> Continuing.
>
>
>
>
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Polipo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/polipo-users

Reply via email to