fricas in pipe, and SIGPIPE

3 views
Skip to first unread message

Qian Yun

unread,
Apr 29, 2026, 8:35:01 AM (2 days ago) Apr 29
to fricas-devel
If we use FriCAS inside a pipe, and does not take all of its output,
such as:

echo '1+1' | fricas -nosman | head -n 4

Then we will be sent to debugger:

debugger invoked on a SB-INT:BROKEN-PIPE in thread
#<THREAD tid=847801 "main thread" RUNNING {1200038003}>:
Couldn't write to #<SB-SYS:FD-STREAM for "standard output" {12010AC3E3}>:
Broken pipe

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit from the current thread.

(SB-IMPL::FLUSH-OUTPUT-BUFFER #<SB-SYS:FD-STREAM for "standard output"
{12010AC3E3}>)


=====

What's the right thing to do here? Terminate the whole process
on SIGPIPE?

To achieve, we can use
(sb-sys:enable-interrupt sb-unix:sigpipe :default)
in "fricas_init".

- Qian

Reply all
Reply to author
Forward
0 new messages