savonet/liquidsoap

Panic crash

Closed this issue · 1 comments

Describe the bug
Queue non-blocking queue #1 crashed with exception Bad file descriptor in waitpid()
Raised by primitive operation at Unix.close_process_full in file "unix.ml", line 1156, characters 5-21
Called from Process_handler.close_process in file "src/core/tools/process_handler.ml", line 30, characters 6-53
Called from Process_handler.run.handler in file "src/core/tools/process_handler.ml", line 279, characters 24-39
Called from Duppy.Task.t_of_task.(fun) in file "src/duppy.ml", line 151, characters 50-66
Called from Duppy.exec in file "src/duppy.ml", line 279, characters 16-23
Re-raised at Tutils.scheduler.(fun) in file "src/core/tools/tutils.ml", line 265, characters 8-48
Called from Duppy.exec in file "src/duppy.ml", line 282, characters 16-33
Called from Duppy.queue.run in file "src/duppy.ml", line 318, characters 7-24
Called from Duppy.queue in file "src/duppy.ml", line 368, characters 7-11
Re-raised at Duppy.queue in file "src/duppy.ml", line 373, characters 8-44
Called from Tutils.create.(fun).process in file "src/core/tools/tutils.ml", line 186, characters 12-15
PANIC: Liquidsoap has crashed, exiting.,

To Reproduce
log.stdout.set(true)
log.file.set(false)
settings.frame.audio.samplerate :=44100
settings.frame.duration :=0.2
settings.frame.audio.channels := 2

s=input.portaudio(device_id=1)
s=mksafe(buffer(s, max=30.))

aac_lofi = %ffmpeg(format="mpegts", %audio( codec="libfdk_aac", channels=2, ar=44100, b="96k", profile="aac_low"))

aac_midfi = %ffmpeg(format="mpegts", %audio( codec="libfdk_aac", channels=2, ar=44100, b="192k", profile="aac_low"))

aac_hifi = %ffmpeg(format="mpegts", %audio( codec="libfdk_aac", channels=2, ar=44100, b="256k", profile="aac_low"))

streams = [("aac_hifi",aac_hifi),("aac_midfi",aac_midfi),("aac_lofi",aac_lofi)]

def segment_name(~position,~extname,stream_name) =
timestamp = int_of_float(time())
duration = 4
"#{stream_name}#{duration}#{timestamp}_#{position}.#{extname}"
end

def on_file_change(~state, fname)

if state == "created" or state == "updated" then

ignore(process.run("curl -X PUT -T #{fname} http://212.220.203.134/tmp_hls/"))

elsif state == "deleted" then

lt = string.split(separator="aac", fname)

file_name="aac" ^ "#{list.nth(lt, 1)}"

ignore(process.run("curl -X DELETE http://212.220.203.134/tmp_hls/#{file_name}"))

end

end

output.file.hls(playlist="live.m3u8", segment_duration=4.0, segments=5, segments_overhead=3, segment_name=segment_name, fallible=true, on_file_change=on_file_change,
persist_at="F:\liquidsoap-2.2.4-win64\tmp\tmp_hls\state.config", "F:\liquidsoap-2.2.4-win64\tmp\tmp_hls", streams, s)

A minimal script to reproduce the issue is the most efficient way to have your bug addressed and fixed very quickly!

Expected behavior
Continue to work

Version details

  • OS: Windows 10[e.g. Debian, OSX]
  • Version 22H2 [e.g. 1.3.4]

Install method
From windows releases placed at github

Common issues
Can't decode or encode in some audio format? Check if you have installed the correct dependencies

Thank you for reporting. I have pushed the fix to both rolling-release-v2.2x and main. The fix should be available for download shortly on the rolling-release-v2.2.x release page: https://github.com/savonet/liquidsoap/releases/tag/rolling-release-v2.2.x