chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-janitors] #833: neuromorpho and 9ML-toolkit's http-fetch tr


From: Chicken Trac
Subject: Re: [Chicken-janitors] #833: neuromorpho and 9ML-toolkit's http-fetch tries to close output ports using close-input-port (was: neuromorpho's http-fetch tries to close output ports using close-input-port)
Date: Sun, 13 May 2012 16:00:05 -0000

#833: neuromorpho and 9ML-toolkit's http-fetch tries to close output ports using
close-input-port
-------------------------+--------------------------------------------------
  Reporter:  sjamaan     |       Owner:  iraikov
      Type:  defect      |      Status:  new    
  Priority:  minor       |   Milestone:         
 Component:  extensions  |     Version:  4.7.x  
Resolution:              |    Keywords:         
-------------------------+--------------------------------------------------
Description changed by sjamaan:

Old description:

> Neuromorpho uses {{{close-input-port}}} twice in the {{{http-fetch}}}
> procedure, once for an input port and once for an output port. It looks
> like this means the network connection will never be closed (in Unit tcp
> both ports need to be closed before the underlying FD is closed).
>
> Simple fix:
>
> {{{
> Index: neuromorpho.scm
> ===================================================================
> --- neuromorpho.scm     (revision 26685)
> +++ neuromorpho.scm     (working copy)
> @@ -251,7 +251,7 @@
>                                     (d "reading chunks ...~%")
>                                     (let ([data (read-chunks in)])
>                                       (close-input-port in)
> -                                     (close-input-port out)
> +                                     (close-output-port out)
>                                       (if (not (file-exists? dest))
> (mkdir dest))
>                                       (d "writing to ~s~%" filepath)
>                                       (with-output-to-file filepath (cut
> display data) )
> @@ -261,7 +261,7 @@
>                                     (d "reading data ...~%")
>                                     (let ([data (read-string #f in)])
>                                       (close-input-port in)
> -                                     (close-input-port out)
> +                                     (close-output-port out)
>                                       (if (not (file-exists? dest))
> (mkdir dest))
>                                       (d "writing to ~s~%" filepath)
>                                       (with-output-to-file filepath (cut
> display data) binary:)
> }}}
>
> By the way, neuromorpho has no documentation on the wiki. This means it
> also won't show up on api.call-cc.org. Since this egg has an official
> release it would be nice if there was at least some documentation.
>
> This bug was found by the scrutinizer, see http://tests.call-
> cc.org/master/linux/x86/2012/05/12/salmonella-
> report/install/neuromorpho.html

New description:

 Neuromorpho uses {{{close-input-port}}} twice in the {{{http-fetch}}}
 procedure, once for an input port and once for an output port. It looks
 like this means the network connection will never be closed (in Unit tcp
 both ports need to be closed before the underlying FD is closed).

 9ML-toolkit seems to have an exact copy of that code, which shows the same
 problem: http://parenteses.org/mario/misc/specialize-report/install/9ML-
 toolkit.html

 Simple fix:

 {{{
 Index: neuromorpho.scm
 ===================================================================
 --- neuromorpho.scm     (revision 26685)
 +++ neuromorpho.scm     (working copy)
 @@ -251,7 +251,7 @@
                                     (d "reading chunks ...~%")
                                     (let ([data (read-chunks in)])
                                       (close-input-port in)
 -                                     (close-input-port out)
 +                                     (close-output-port out)
                                       (if (not (file-exists? dest)) (mkdir
 dest))
                                       (d "writing to ~s~%" filepath)
                                       (with-output-to-file filepath (cut
 display data) )
 @@ -261,7 +261,7 @@
                                     (d "reading data ...~%")
                                     (let ([data (read-string #f in)])
                                       (close-input-port in)
 -                                     (close-input-port out)
 +                                     (close-output-port out)
                                       (if (not (file-exists? dest)) (mkdir
 dest))
                                       (d "writing to ~s~%" filepath)
                                       (with-output-to-file filepath (cut
 display data) binary:)
 }}}

 By the way, neuromorpho has no documentation on the wiki. This means it
 also won't show up on api.call-cc.org. Since this egg has an official
 release it would be nice if there was at least some documentation.

 This bug was found by the scrutinizer, see http://tests.call-
 cc.org/master/linux/x86/2012/05/12/salmonella-
 report/install/neuromorpho.html

--

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/833#comment:1>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]