[Sbcl-help] couldn't create pipe: "Too many open files"

13 views
Skip to first unread message

Jeff Cunningham

unread,
Aug 23, 2023, 5:19:32 PM8/23/23
to sbcl...@lists.sourceforge.net
I'm getting an error:

'SB-EXT:RUN-PROGRAM error processing :ERROR argument:
couldn't create pipe: "Too many open files"'

The code in question is examining a collection of files by running an external program on them, but serially, and all are executing without errors so far as I can tell.

Any idea how I might go about dealing with this?

Thanks.

-- Jeff









_______________________________________________
Sbcl-help mailing list
Sbcl...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help

Stas Boukarev

unread,
Aug 23, 2023, 6:12:49 PM8/23/23
to Jeff Cunningham, sbcl...@lists.sourceforge.net
Try sb-ext:process-close? 

Jeff Cunningham

unread,
Aug 23, 2023, 6:40:45 PM8/23/23
to Stas Boukarev, sbcl...@lists.sourceforge.net
I'm trying that now. So far so good, but then it was running quite a bit
before that showed up so it might take awhile to know if that did it.

I guess I never thought about the process returned by
sb-ext:run-program needing to be explicitly closed before it goes out
of scope. So it would be the GC doing it otherwise? And if there's a
build up before the GC triggers I assume that could cause pipes to run
out?

Thanks for the tip.

-- Jeff

Stas Boukarev

unread,
Aug 23, 2023, 8:04:59 PM8/23/23
to Jeff Cunningham, sbcl...@lists.sourceforge.net
I can't tell you off hand what run-program is doing specifically, but the fd limit can quickly outrun the gc frequency.

Teemu Likonen

unread,
Sep 11, 2023, 1:25:21 AM9/11/23
to Jeff Cunningham, Stas Boukarev, sbcl...@lists.sourceforge.net
* 2023-08-23 18:40:14-0400, Jeff Cunningham wrote:

> I guess I never thought about the process returned by
> sb-ext:run-program needing to be explicitly closed before it goes out
> of scope. So it would be the GC doing it otherwise? And if there's a
> build up before the GC triggers I assume that could cause pipes to run
> out?

This is new to me too. I have never closed the process object. I have
closed the streams, though. Usually I use only the output stream.

What is the difference between closing the streams and closing the
process object?

--
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: 6965F03973F0D4CA22B9410F0F2CAE0E07608462
signature.asc

Jeff Cunningham

unread,
Sep 11, 2023, 11:16:48 AM9/11/23
to Teemu Likonen, sbcl...@lists.sourceforge.net
Well, closing the returned process eliminated my problem. It might be
that I could have just closed the streams. Interesting thought,
perhaps I'll switch as an experiment and see if the problem remains
gone or not.




On Mon, 11 Sep 2023 07:59:49 +0300
Teemu Likonen <tlik...@iki.fi> wrote:

> * 2023-08-23 18:40:14-0400, Jeff Cunningham wrote:
>
> > I guess I never thought about the process returned by
> > sb-ext:run-program needing to be explicitly closed before it goes out
> > of scope. So it would be the GC doing it otherwise? And if there's a
> > build up before the GC triggers I assume that could cause pipes to run
> > out?
>
> This is new to me too. I have never closed the process object. I have
> closed the streams, though. Usually I use only the output stream.
>
> What is the difference between closing the streams and closing the
> process object?
>



Reply all
Reply to author
Forward
0 new messages