Broken pipe when writing to external program's stream

Bug #1857250 reported by Martin Buchmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Undecided
Unassigned

Bug Description

Maybe this is related to bug # 1405921 but I see a dependency on the OS version which is not reported there. I want to write data to an external instance of ffmpeg to create some videos for visualization. While the code is working on a Linux setup of the original author and on macOS 10.13. it fails on macOS 10.15. with the following error:

Couldn't write to #<SB-SYS:FD-STREAM for "descriptor 7" {100227EB23}>:
  Broken pipe

I made sure that SBCL is allowed to access the hard drive and control other programs in macOS' security settings. Everything works for a simple example as given in Edi Weitz' book (http://weitz.de/cl-recipes/, page 688) but not for the code below.

Please let me know if I can provide anymore information.

This is how far I could boil it down:

-- minimal.lisp

;; Using external-program
(ql:quickload "external-program")

;; The size of the video
(defparameter *width* 640)
(defparameter *height* 480)

;; Setting up ffmpeg
(defparameter *ffmpeg-args*
  (list "-loglevel" "debug"
        "-nostats"
        "-nostdin"
        "-f" "rawvideo"
        "-s" (format nil "~Dx~D" *width* *height*)
        "-pix_fmt" "bgra"
        "-r" (format nil "~D" 25)
        "-i" "-"
        "-an"
        "-f" "mp4"
        "-pix_fmt" "yuv420p"
        "-c:v" "libx264"
        "-profile:v" "main"
        "-level" "3.1"
        "-y"
        "out.mp4"))

;; Make sure ffmpeg is installed and found in $PATH
(defparameter *p*
  (external-program:start "ffmpeg" *ffmpeg-args*
                          :input :stream :output t :error :output))
;; I get a running process after this line

(let ((buffer (make-array (* *width* *height* 4)
                          :element-type '(unsigned-byte 8) :initial-element 255)
              ;; 0 means a complete black frame
              ;; 255 means a complete white frame
              ))

  (dotimes (i 50)
    (write-sequence buffer (external-program:process-input-stream *p*))
    (format t ";;; Frame: ~,20D~%" i)))

(close (external-program:process-input-stream *p*))

-- SBCL's version

$ sbcl --version
SBCL 1.5.9

-- OS

$ uname -a
Darwin Martins-MBP.fritz.box 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64

--

*features*

(:OSICAT-FD-STREAMS CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64
 CFFI-FEATURES:UNIX CFFI-FEATURES:DARWIN :CFFI CFFI-SYS::FLAT-NAMESPACE
 ALEXANDRIA.1.0.0::SEQUENCE-EMPTYP :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF3.3
 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-MACOSX :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :X86-64 :64-BIT :ALIEN-CALLBACKS
 :ANSI-CL :AVX2 :BSD :C-STACK-IS-CONTROL-STACK :CALL-SYMBOL :COMMON-LISP
 :COMPACT-INSTANCE-HEADER :COMPARE-AND-SWAP-VOPS :CYCLE-COUNTER :DARWIN
 :FP-AND-PC-STANDARD-SAVE :GENCGC :IEEE-FLOATING-POINT :IMMOBILE-CODE
 :IMMOBILE-SPACE :INODE64 :INTEGER-EQL-VOP :LINKAGE-TABLE :LITTLE-ENDIAN
 :MACH-EXCEPTION-HANDLER :MACH-O :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-DLADDR
 :OS-PROVIDES-DLOPEN :OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T
 :PACKAGE-LOCAL-NICKNAMES :RELOCATABLE-HEAP :SB-CORE-COMPRESSION :SB-DOC
 :SB-EVAL :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SIMD-PACK-256
 :SB-SOURCE-LOCATIONS :SB-THREAD :SB-UNICODE :SB-XREF-FOR-INTERNALS :SBCL
 :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-FIXED-OBJECTS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-VECTORS
 :STACK-GROWS-DOWNWARD-NOT-UPWARD :UNDEFINED-FUN-RESTARTS :UNIX
 :UNWIND-TO-FRAME-AND-CALL-VOP)

description: updated
Revision history for this message
Stas Boukarev (stassats) wrote :

Can you redo it without using external-program?

Revision history for this message
Martin Buchmann (martin-b77) wrote :

I tried with using sb-ext:run-program directly:

(defparameter *p*
  (sb-ext:run-program "/opt/local/bin/ffmpeg" *ffmpeg-args*
                          :input :stream :output t :error :output :wait nil))

(let ((buffer (make-array (* *width* *height* 4)
                          :element-type '(unsigned-byte 8) :initial-element 255)
              ;; 0 means a complete black frame
              ;; 255 means a complete white frame
              ))

  (dotimes (i 50)
    (write-sequence buffer (sb-ext::process-input *p*))
    (format t ";;; Frame: ~,20D~%" i)))

But get the same error, at least it looks similar to me:

Couldn't write to #<SB-SYS:FD-STREAM for "descriptor 16" {1001C3ED73}>:
  Broken pipe

Revision history for this message
Stas Boukarev (stassats) wrote :

And... can't reproduce.

Changed in sbcl:
status: New → Incomplete
Revision history for this message
Martin Buchmann (martin-b77) wrote :

Hmm, I am sorry! I don't know why it is working with macOS 10.13. and not with macOS 10.15. anymore for me. If there is anything I could do to provide more information I would be happy to do so. I was hoping that someone with more insights in the SBCL interna could tell what's going on.

Revision history for this message
Stas Boukarev (stassats) wrote :

Are ffmpeg version the same? Maybe the newer ffmpeg doesn't understand your arguments or inputs.

Revision history for this message
Martin Buchmann (martin-b77) wrote :
Download full text (3.8 KiB)

FFmpeg is the same on both machines:

ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.8)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --disable-securetransport --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil 56. 31.100 / 56. 31.100
  libavcodec 58. 54.100 / 58. 54.100
  libavformat 58. 29.100 / 58. 29.100
  libavdevice 58. 8.100 / 58. 8.100
  libavfilter 7. 57.100 / 7. 57.100
  libavresample 4. 0. 0 / 4. 0. 0
  libswscale 5. 5.100 / 5. 5.100
  libswresample 3. 5.100 / 3. 5.100
  libpostproc 55. 5.100 / 55. 5.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-nostats' ... matched as option 'stats' (print progress report during encoding) with argument 0.
Reading option '-nostdin' ... matched as option 'stdin' (enable or disable interaction on standard input) with argument 0.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rawvideo'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '640x480'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'bgra'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '25'.
Reading option '-i' ... matched as input url with argument '-'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mp4'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-profile:v' ... matched as option 'profile' (set profile) with argument 'main'.
Reading option '-level' ... matched as AVOption 'level' with argument '3.1'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'out.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option nostats (print progress report during encoding) with argument 0.
Applying option nostdin (enable or disable interaction on...

Read more...

Revision history for this message
Stas Boukarev (stassats) wrote :

Can you replicate it on CCL?

Revision history for this message
Martin Buchmann (martin-b77) wrote :
Download full text (3.3 KiB)

Hmm, I really think this is more complex than I could handle...

I installed ccl on macOS 10.15.2 but it fails also:

The value 255 is not of the expected type CHARACTER.
   [Condition of type TYPE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME interactive evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT-BREAK] Reset this thread
 3: [ABORT] Kill this thread

Backtrace:
  0: (CCL::%PRIVATE-IOBLOCK-WRITE-U8-ENCODED-CHAR #S(CCL::IOBLOCK :STREAM #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/8) #x30200169BA7D> :UNTYI-CHAR NIL :INBUF ...) 255)
      Locals:
        IOBLOCK = #S(CCL::IOBLOCK :STREAM #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/8) #x30200169BA7D> :UNTYI-CHAR NIL :INBUF ...)
        CHAR = 255
  1: (WRITE-CHAR 1 #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/8) #x30200169BA7D>)
      Locals:
        CHAR = 1
        CCL:OUTPUT-STREAM = #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/8) #x30200169BA7D>
        STREAM = #S(CCL::IOBLOCK :STREAM #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/8) #x30200169BA7D> :UNTYI-CHAR NIL :INBUF ...)
        CCL::IOBLOCK = #S(CCL::IOBLOCK :STREAM #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/8) #x30200169BA7D> :UNTYI-CHAR NIL :INBUF ...)
  2: (#<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::CHARACTER-OUTPUT-STREAM T T T)> #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/8) #x30200169BA7D> #(255 255 255 255 255 255 ...) 0 1228800)
      Locals:
        STREAM = #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/8) #x30200169BA7D>
        VECTOR = #(255 255 255 255 255 255 ...)
        START = 0
        END = 1228800
        I = 0
  3: (CCL::%CALL-NEXT-METHOD (NIL #<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::CHARACTER-OUTPUT-STREAM T T T)> . 9740067))
      Locals:
        MAGIC = (NIL #<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::CHARACTER-OUTPUT-STREAM T T T)> . 9740067)
        ARGS = NIL
        NEXT-METHODS = (#<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::CHARACTER-OUTPUT-STREAM T T T)>)
        ARGS = 9740067
        CDR = NIL
        METHOD-FUNCTION = #<METHOD-FUNCTION STREAM-WRITE-VECTOR (CCL::CHARACTER-OUTPUT-STREAM T T T)>
  4: (CCL::%%STANDARD-COMBINED-METHOD-DCODE (#<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::BASIC-CHARACTER-OUTPUT-STREAM T T T)> ..) 9740067)
      Locals:
        METHODS = (#<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::BASIC-CHARACTER-OUTPUT-STREAM T T T)> #<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::CHARACTER-OUTPUT-STREAM T T T)>)
        ARGS = 9740067
        CAR-METHS = #<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::BASIC-CHARACTER-OUTPUT-STREAM T T T)>
        CELL-2 = (#<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::CHARACTER-OUTPUT-STREAM T T T)> . 9740067)
        MAGIC = (NIL #<CCL::STANDARD-KERNEL-METHOD STREAM-WRITE-VECTOR (CCL::CHARACTER-OUTPUT-STREAM T T T)> . 9740067)
        #:G135334 = #<METHOD-FUNCTION STREAM-WRITE-VECTOR (CCL::BASIC-CHARACTER-OUTPUT-STREAM T T T)>
  5: (NIL #<Unknown Arguments>)
      [No Locals]
  6: (WRITE-SEQUENCE #(255 255 255 255 255 255 ...) #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/8) #x30200169BA7D> :START 0 :END 1228800)

Because it is expecting a c...

Read more...

Revision history for this message
Martin Buchmann (martin-b77) wrote :
Download full text (3.7 KiB)

Although, I do not understand it completely if I use CCL and try to close the process-input-stream I get the following error:

Stream #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/15) #x302001B116AD> is private to #<PROCESS repl-thread(13) [semaphore wait] #x30200113903D>
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME interactive evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT-BREAK] Reset this thread
 3: [ABORT] Kill this thread

Backtrace:
  0: (#<CCL::STANDARD-KERNEL-METHOD STREAM-FORCE-OUTPUT (CCL::BASIC-OUTPUT-STREAM)> #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/15) #x302001B116AD>)
      Locals:
        STREAM = #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/15) #x302001B116AD>
        IOBLOCK = #S(CCL::IOBLOCK :STREAM #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/15) #x302001B116AD> :UNTYI-CHAR NIL :INBUF ...)
        #:G152758 = NIL
        OWNER = #<PROCESS repl-thread(13) [semaphore wait] #x30200113903D>
  1: (CCL::%%BEFORE-AND-AFTER-COMBINED-METHOD-DCODE (NIL #<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)> . 9740068))
      Locals:
        MAGIC = (NIL #<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)> . 9740068)
        METHODS = ((#<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)>) (#<CCL::STANDARD-KERNEL-METHOD CLOSE :AFTER (CCL::BASIC-STREAM)>) #<CCL::STANDARD-KERNEL-METHOD CLOSE (STREAM)>)
        BEFORES = (#<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)>)
        CDR-METHS = ((#<CCL::STANDARD-KERNEL-METHOD CLOSE :AFTER (CCL::BASIC-STREAM)>) #<CCL::STANDARD-KERNEL-METHOD CLOSE (STREAM)>)
        PRIMARIES = (#<CCL::STANDARD-KERNEL-METHOD CLOSE (STREAM)>)
        AFTERS = (#<CCL::STANDARD-KERNEL-METHOD CLOSE :AFTER (CCL::BASIC-STREAM)>)
        ARGS = 9740068
        #:G135365 = (#<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)>)
        METHOD = #<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)>
        #:G135369 = #<METHOD-FUNCTION CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)>
  2: (CCL::%%STANDARD-COMBINED-METHOD-DCODE ((#<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)>) (#<CCL::STANDARD-KERNEL-METHOD CLOSE :AFTER (CCL::BASIC-STREAM)>) ..) 9740068)
      Locals:
        METHODS = ((#<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)>) (#<CCL::STANDARD-KERNEL-METHOD CLOSE :AFTER (CCL::BASIC-STREAM)>) #<CCL::STANDARD-KERNEL-METHOD CLOSE (STREAM)>)
        ARGS = 9740068
        CAR-METHS = (#<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)>)
        CELL-2 = (#<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)> . 9740068)
        MAGIC = (NIL #<CCL::STANDARD-KERNEL-METHOD CLOSE :BEFORE (CCL::BASIC-OUTPUT-STREAM)> . 9740068)
  3: (NIL #<Unknown Arguments>)
      [No Locals]
  4: (CCL::%%CHECK-KEYWORDS #(1 #(:ABORT) #<Combined-Method CLOSE #x30200046016F>) 9740082)
      Locals:
        VECTOR-ARG = #(1 #(:ABORT) #<Combined-Method CLOSE #x30200046016F>)
        ARGS = 9740082
        #:G134920 = 1
        ARGS-LIST = (#<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/15) #x302001B116AD>)...

Read more...

Revision history for this message
Stas Boukarev (stassats) wrote :

Try :element-type '(unsigned-byte 8)?

Revision history for this message
Martin Buchmann (martin-b77) wrote :

That's what I did in the first place but ccl complained that it was expecting a character stream.

Revision history for this message
Stas Boukarev (stassats) wrote :

Ok, then maybe just try writing characters instead?

Revision history for this message
Martin Buchmann (martin-b77) wrote :

That's what I did, see comment #8. But it is still leading to a broken pipe error.

Revision history for this message
Martin Buchmann (martin-b77) wrote :

I am not sure, if this leads to anything. But I tried to use dtruss to see what is happening between SBCL and ffmpeg when the error occurs. Here are the last lines of output, respectively. As I have never used it before and know nearly nothing about the syscalls, I can hardly interpret this.

SBCL

write(0x7, "\0", 0x1000) = -1 Err#32
__pthread_sigmask(0x1, 0x0, 0x11FEDDC) = 0 0
__pthread_sigmask(0x1, 0x0, 0x11FEDAC) = 0 0
__pthread_sigmask(0x1, 0x0, 0x11FEDAC) = 0 0
__pthread_sigmask(0x2, 0x13AF08, 0x0) = 0 0
__pthread_sigmask(0x1, 0x13AF00, 0x0) = 0 0
sigreturn(0x11FF3D0, 0x1E, 0x27F9CA51B94AFEEE) = 0 Err#-2
__pthread_sigmask(0x1, 0x0, 0x11FEDDC) = 0 0
__pthread_sigmask(0x1, 0x0, 0x11FEDAC) = 0 0
__pthread_sigmask(0x1, 0x0, 0x11FEDAC) = 0 0
__pthread_sigmask(0x2, 0x13AF08, 0x0) = 0 0
wait4(0x520, 0x13FFFF0, 0x13) = 1312 0
__pthread_sigmask(0x1, 0x13AF00, 0x0) = 0 0
sigreturn(0x11FF3D0, 0x1E, 0x27F9CA51B94AFEEE) = 0 Err#-2
write(0x2, "\n\0", 0x1) = 1 0

ffmpeg

write_nocancel(0x2, "\033[0;32musing mv_range_thread = 24\n\033[0m\0", 0x26) = 38 0
psynch_cvwait(0x7F80DF00C048, 0x10100000200, 0x100) = -1 Err#260
psynch_cvwait(0x7F80DF00C1E0, 0x10100000200, 0x100) = -1 Err#260
psynch_cvwait(0x7F80DF00C0D0, 0x10100000200, 0x100) = -1 Err#260
psynch_cvwait(0x7F80DF00C158, 0x10100000200, 0x100) = -1 Err#260
psynch_cvwait(0x7F80DF00C2F0, 0x10100000200, 0x100) = -1 Err#260
psynch_cvwait(0x7F80DF00C268, 0x10100000200, 0x100) = -1 Err#260
psynch_cvwait(0x7F80DF00C378, 0x10100000200, 0x100) = -1 Err#260
psynch_cvwait(0x7F80DF00C400, 0x10100000200, 0x100) = -1 Err#260

Revision history for this message
Stas Boukarev (stassats) wrote :

Here's a working CCL version:

(defparameter *width* 640)
(defparameter *height* 480)

(defparameter *ffmpeg-args*
  (list "-loglevel" "debug"
        "-nostats"
        "-nostdin"
        "-f" "rawvideo"
        "-s" (format nil "~Dx~D" *width* *height*)
        "-pix_fmt" "bgra"
        "-r" (format nil "~D" 25)
        "-i" "-"
        "-an"
        "-f" "mp4"
        "-pix_fmt" "yuv420p"
        "-c:v" "libx264"
        "-profile:v" "main"
        "-level" "3.1"
        "-y"
        "out.mp4"))

(defparameter *p*
  (ccl:run-program "ffmpeg" *ffmpeg-args*
                   :input :stream :output t :error :output :wait nil
                   :element-type '(unsigned-byte 8)))

(let ((buffer (make-array (* *width* *height* 4)
                          :element-type '(unsigned-byte 8) :initial-element 255)))

  (dotimes (i 50)
    (write-sequence buffer (ccl:external-process-input-stream *p*)))
  (close (ccl:external-process-input-stream *p*)))

Revision history for this message
Martin Buchmann (martin-b77) wrote :

Thanks for clarification where to put the element-type statement and sorry for my misunderstand. But it is still not working for me:

on #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x3020013E9DBD> :
Broken pipe during write
   [Condition of type CCL::SIMPLE-STREAM-ERROR]

Restarts:
 0: [RETRY] Retry SLIME interactive evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT-BREAK] Reset this thread
 3: [ABORT] Kill this thread

Backtrace:
  0: (#<CCL::STANDARD-KERNEL-METHOD CCL::STREAM-IO-ERROR (STREAM T T)> #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x3020013E9DBD> 32 "write")
      Locals:
        STREAM = #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x3020013E9DBD>
        ERROR-NUMBER = 32
        CONTEXT = "write"
  1: (CCL::FD-STREAM-FORCE-OUTPUT #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x3020013E9DBD> #S(CCL::IOBLOCK :STREAM #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x3020013E9DBD> :UNTYI-CHAR NIL ..) 512 N..
      Locals:
        S = #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x3020013E9DBD>
        IOBLOCK = #S(CCL::IOBLOCK :STREAM #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x3020013E9DBD> :UNTYI-CHAR NIL :INBUF ...)
        COUNT = 512
        FINISH-P = NIL
        FD = 15
        IO-BUFFER = #<IO-BUFFER (UNSIGNED-BYTE 8) 0/0/512 #x3020013E9BBD>
        BUF = #<A Foreign Pointer [stack-allocated] #x49001F8>
        OCTETS-TO-WRITE = 512
        OCTETS = 512
        WRITTEN = -32
  2: (CCL::%IOBLOCK-BINARY-STREAM-WRITE-VECTOR #S(CCL::IOBLOCK :STREAM #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x3020013E9DBD> :UNTYI-CHAR NIL :INBUF ...) #(255 255 255 255 255 255 ...) 0 1228800)
      Locals:
        IOBLOCK = #S(CCL::IOBLOCK :STREAM #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x30200128E95D> :UNTYI-CHAR NIL :INBUF ...)
        VECTOR = #(255 255 255 255 255 255 ...)
        START = 0
        END = 1228800
        OUT = #<IO-BUFFER (UNSIGNED-BYTE 8) 0/0/512 #x30200128E75D>
        WRITTEN = 512
        TOTAL = 1228800
        BUFTYPE = 231
        POS = 70144
        LEFT = 1158656
        INDEX = 512
        COUNT = 0
        LIMIT = 512
        BUF = #(255 255 255 255 255 255 ...)
        AVAIL = 512
  3: (WRITE-SEQUENCE #(255 255 255 255 255 255 ...) #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x3020013E9DBD> :START 0 :END 1228800)
      Locals:
        CCL::SEQ = #(255 255 255 255 255 255 ...)
        STREAM = #<BASIC-BINARY-OUTPUT-STREAM UTF-8 (PIPE/15) #x30200128E95D>
        CCL::START = 0
        CCL::END = 1228800
        VECTOR = #(255 255 255 255 255 255 ...)
        CCL::OFFSET = 0

I was really hoping that I was just missing something obvious. Is this working for you under macOS 10.15.?

Revision history for this message
Stas Boukarev (stassats) wrote :

Yes, working fine with SBCL and CCL, even played with it and produced some nice looking static noise with it. So, there's something going on with your OS configuration.

Revision history for this message
Martin Buchmann (martin-b77) wrote :

Well, thanks a lot for your efforts! I am not aware of having anything special with my OS configuration but I guess, that doesn't mean much.

I have installed SBCL using macports and gave it full disc access in the security System Preferences. Do you have any idea how I could further check what is going on?

Revision history for this message
Stas Boukarev (stassats) wrote :

Can you write the output to a file and then do "cat file | ffmpeg --args"?

Revision history for this message
Martin Buchmann (martin-b77) wrote :

It really looks like something is wrong with ffmpeg installed via macports on Catalina. I can write the data to a binary file and pipe this to ffmpeg using cat as suggested without problems under macOS 10.13. Using macOS 10.15. ffmpeg fails with a segmentation fault. It is running fine with other tasks so I was assuming ffmpeg is working.

Thanks you so much for helping me finding the right track. Sorry for causing all this trouble. I am pretty sure that you can close this bug report as it is not caused by SBCL.

Stas Boukarev (stassats)
Changed in sbcl:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.