ports/5010: www/w3m 0.5.1 fails to close pipes - and eventually dies

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ports/5010: www/w3m 0.5.1 fails to close pipes - and eventually dies

ttakah
>Number:         5010
>Category:       ports
>Synopsis:       www/w3m 0.5.1 fails to close pipes - and eventually dies
>Confidential:   yes
>Severity:       serious
>Priority:       low
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 08 12:20:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     TAKAHASHI Tamotsu
>Release:        ja-w3m-0.5.1p0-image
>Organization:
net
>Environment:
       
        System      : OpenBSD 3.8
        Architecture: OpenBSD.i386
        Machine     : i386
>Description:
"Hiroshi SAKURAI" (http://vimrc.hp.infoseek.co.jp/) found this bug in w3m-0.5.1.


Summary: w3m tries to "pclose" pipes which were "fdopen"ed (not "popen"ed).

When w3m sees a compressed page (e.g. "Content-Encoding: gzip"),
w3m "fdopen"s a pipe from decompresser ("gzip").
But "pclose" is specified as the pipe's closer.
Thus, so many pipes will remain unclosed that w3m eventually dies.

For more details, read his description (in Japanese language):
http://vimrc.hp.infoseek.co.jp/w3m-pclose.html

>How-To-Repeat:
View many compressed pages (e.g. OpenBSD cvsweb) with w3m.

$ ulimit -n 30
$ w3m http://www.openbsd.org/cgi-bin/cvsweb/src
(visit bin, press "B" (shift + b),
visit distrib, press "B" (shift + b),
visit etc, press "B" (shift + b),
visit games, press "B" (shift + b),
visit gnu, press "B" (shift + b),
visit include, press "B" (shift + b),
and visit kerberosIV)
... voila! w3m only says "No Line", and soon dumps core.


Note that w3m usually removes page-buffers when you hit "B".

>Fix:
--- file.c~ Sat Apr 17 03:47:19 2004
+++ file.c Wed Feb  8 17:58:00 2006
@@ -7891,7 +7891,7 @@
     uf->scheme = SCM_LOCAL;
     }
     UFhalfclose(uf);
-    uf->stream = newFileStream(f1, (void (*)())pclose);
+    uf->stream = newFileStream(f1, (void (*)())fclose);
 }
 
 static FILE *


>Release-Note:
>Audit-Trail:
>Unformatted: