Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquidsoap crashes when metadata is pushed after input.harbor connection in 2.2.2 #3574

Closed
SkillenUK opened this issue Nov 29, 2023 · 21 comments

Comments

@SkillenUK
Copy link

SkillenUK commented Nov 29, 2023

I have been having an issue with Liquidsoap crashing sometimes when a user connects to the input.harbor using BUTT as a client. I think it happens when the user has set some metadata in BUTT before connecting (select the 'stream' page in the settings, set the 'update song manually' field and click on 'OK'). I also think that setting the metadata after connecting isn't causing an issue. I haven't managed to bottom out specifically what causes the crash, but it could be the metadata.map function so I have included this in the script example. It often takes me a handful of connections to reproduce the issue, so I do not think it happens every time.

I also think this only occurs on the input.harbor which uses ssl. I have not seen the issue on the non-ssl harbor to date, however most of my testing has been on the ssl harbor so it could be possible. I've included both parts in the script as it could be relevant, but for reproduction it's best to focus on the ssl harbor...

# Set log level
log.level.set(4)

# Set the ssl certs for the harbor
cert = http.transport.ssl(
  certificate="/etc/ssl/certs/host_net.crt",
  key="/etc/ssl/private/host_net.key")

# Define a function to handle harbor authentication
def dj_auth(params)
  user     = params.user
  password = params.password

  ret = process.read.lines("php /var/liquidsoap/scripts/liqauth.php '#{user}' '#{password}'")
  ret = list.hd(default="",ret)

  if ret == "true" then
    true
  else
    false
  end
end

# Define harbor's
djlivessl = input.harbor(transport=cert,"live",port=8020,auth=dj_auth,buffer=2.)
djlive = input.harbor("live",port=8010,password="hackme",buffer=2.)

# Append live to the metadata
def append_live(m) =
  title = m["artist"]
  [("artist","LIVE: #{title}")]
end

djlivessl = metadata.map(append_live, djlivessl)
djlive = metadata.map(append_live, djlive)

# Set the fallback for the live streams
live = fallback(track_sensitive=false, [djlivessl,djlive])

# Simple auto dj
autodj =  playlist(mode="randomize",reload=1,reload_mode="rounds","/var/liquidsoap/autodj/autodj.m3u")

# Append replay to the metadata
def append_autodj(m) =
  title = m["artist"]
  [("artist","REPLAY: #{title}")]
end

autodj = metadata.map(append_autodj, autodj)

# Define transitions for changing to live
pdlivejingle = single("/var/liquidsoap/jingles/liveshort.mp3")

def tolive(old,new)
  sequence(merge=false,[once(pdlivejingle),(new:source)])
end

# Fallback to blank for drop outs on the input.harbor
blankmp3 = single("/var/liquidsoap/jingles/blank.mp3")

def toauto(old,new)
  sequence(merge=false,[once(blankmp3),(new:source)])
end

# Set the fallback between live and auto
liveout =  mksafe(fallback(track_sensitive=false, transition_length=10.,transitions=[tolive,toauto], [(live:source),(autodj:source)]))

# Skip the Auto DJ to the next track when going live
to_live = ref(false)

def check_live() =
  if live.is_ready() then
    # Only do that once:
    if not !to_live then
      to_live.set(true)
      autodj.skip()
    end
   else
     # If not available, revert to radio songs and normal crossfade transitions
     to_live.set(false)
  end
end

liveout = source.on_frame(liveout, check_live)

# Icecast output MP3 192 kbps stereo
output.icecast(
  %mp3(bitrate=192),
  mount="/live192",
  host="localhost", port=8000, password="hackme",
  name="host.net", description="Main 192kbps MP3 stream", url="https://www.host.net", genre="Dance Music", liveout)

# Record the live streams
output.file(
  %mp3(bitrate=192, id3v2=true),
  {time.string("/var/liquidsoap/shows/%Y-%m-%d-%H_%M_%S_djlive.mp3")},
  djlivessl,
  fallible=true)

output.file(
  %mp3(bitrate=192, id3v2=true),
  {time.string("/var/liquidsoap/shows/%Y-%m-%d-%H_%M_%S_djlive.mp3")},
  djlive,
  fallible=true)

Multiple outputs are used to Icecast in the main script, but I do not think this is relevant.

I use supervisor to run Liquidsoap, so when it crashes it is instantly restarted. This is why you can see the LOG START event indicating where Liquidsoap crashed and was restarted. The log extract is as follows...

2023/11/28 22:28:46 [harbor:4] New client on port 8020: 2.0.0.1
2023/11/28 22:28:46 [harbor:4] Method: PUT, uri: /live, protocol: HTTP/1.1
2023/11/28 22:28:46 [harbor:4] Header: Host, value: host.net:8020.
2023/11/28 22:28:46 [harbor:4] Header: User-Agent, value: butt 0.1.33.
2023/11/28 22:28:46 [harbor:4] Header: Content-Type, value: audio/mpeg.
2023/11/28 22:28:46 [harbor:4] Header: ice-name, value: no name.
2023/11/28 22:28:46 [harbor:4] Header: ice-public, value: 0.
2023/11/28 22:28:46 [harbor:4] Header: ice-audio-info, value: ice-bitrate=192;ice-channels=2;ice-samplerate=48000.
2023/11/28 22:28:46 [harbor:4] Header: Expect, value: 100-continue.
2023/11/28 22:28:46 [process:4] Starting process
2023/11/28 22:28:46 [process:4] Closing process's stdin
2023/11/28 22:28:46 [process:4] Process exited with code 0
2023/11/28 22:28:46 [process:4] Cleaning up process
2023/11/28 22:28:46 [harbor:4] Client logged in.
2023/11/28 22:28:46 [harbor:4] PUT (source) request on /live.
2023/11/28 22:28:46 [harbor:4] Adding source on mountpoint "/live" with type "audio/mpeg".
2023/11/28 22:28:46 [decoder:4] Available decoders:
2023/11/28 22:28:46 [decoder:4] ffmpeg (priority: 10)
2023/11/28 22:28:46 [decoder:4] mad (priority: 1)
2023/11/28 22:28:46 [decoder:4] Selected decoder ffmpeg for mime-type audio/mpeg with expected content {audio=pcm(stereo)}
2023/11/28 22:28:46 [threads:4] Created thread "harbor source feeding" (2 total).
2023/11/28 22:28:46 [input.harbor:3] Decoding...
2023/11/28 22:28:46 [harbor:4] New client on port 8020: 2.0.0.1
2023/11/28 22:28:46 [harbor:4] Method: GET, uri: /admin/metadata?mode=updinfo&mount=/live&song=User%20-%20Test, protocol: HTTP/1.0
2023/11/28 22:28:46 [harbor:4] Header: User-Agent, value: butt 0.1.33.
2023/11/28 22:28:46 [harbor:4] Header: Host, value: host.net:8020.
2023/11/28 22:28:46 [harbor:4] https/ssl GET request on /admin/metadata.
2023/11/28 22:28:46 [harbor:4] https/ssl Arg: mount, value: /live.
2023/11/28 22:28:46 [harbor:4] https/ssl Arg: song, value: User - Test.
2023/11/28 22:28:46 [harbor:4] https/ssl Arg: mode, value: updinfo.
2023/11/28 22:28:46 [harbor:4] Request to update metadata for mount /live on port 8020
2023/11/28 22:28:46 [process:4] Starting process
2023/11/28 22:28:46 [process:4] Closing process's stdin
2023/11/28 22:28:46 [process:4] Process exited with code 0
2023/11/28 22:28:46 [process:4] Cleaning up process
2023/11/28 22:28:46 [harbor:4] Client logged in.
2023/11/28 22:28:46 [input.harbor:3] New metadata chunk ? -- User - Test.
2023/11/28 22:28:52 >>> LOG START
2023/11/28 22:28:47 [main:3] Liquidsoap 2.2.2+dev

The last entry in the log before Liquidsoap restarts always seems to be the 'New metadata chunk' entry, which is why I feel this is related to the metadata.

Thank you in advance for your help,

Skillen.

@vitoyucepi
Copy link
Collaborator

Hi @SkillenUK,
Could you please tell us what version you're using and how you installed it? This information is critical for reproduction.

I have tried to reproduce the issue but have not been able to succeed.

Changes

I need to modify the script to work in my environment.

--- a/main.liq
+++ b/main.liq
@@ -3,26 +3,26 @@ log.level.set(4)
 
 # Set the ssl certs for the harbor
 cert = http.transport.ssl(
-  certificate="/etc/ssl/certs/host_net.crt",
-  key="/etc/ssl/private/host_net.key")
+  certificate="/tmp/test/cert.pem",
+  key="/tmp/test/key.pem")
 
 # Define a function to handle harbor authentication
-def dj_auth(params)
-  user     = params.user
-  password = params.password
-
-  ret = process.read.lines("php /var/liquidsoap/scripts/liqauth.php '#{user}' '#{password}'")
-  ret = list.hd(default="",ret)
-
-  if ret == "true" then
-    true
-  else
-    false
-  end
-end
+#def dj_auth(params)
+#  user     = params.user
+#  password = params.password
+#
+#  ret = process.read.lines("php /var/liquidsoap/scripts/liqauth.php '#{user}' '#{password}'")
+#  ret = list.hd(default="",ret)
+#
+#  if ret == "true" then
+#    true
+#  else
+#    false
+#  end
+#end
 
 # Define harbor's
-djlivessl = input.harbor(transport=cert,"live",port=8020,auth=dj_auth,buffer=2.)
+djlivessl = input.harbor(transport=cert,"live",port=8020,password="hackme",buffer=2.)
 djlive = input.harbor("live",port=8010,password="hackme",buffer=2.)
 
 # Append live to the metadata
@@ -38,7 +38,7 @@ djlive = metadata.map(append_live, djlive)
 live = fallback(track_sensitive=false, [djlivessl,djlive])
 
 # Simple auto dj
-autodj =  playlist(mode="randomize",reload=1,reload_mode="rounds","/var/liquidsoap/autodj/autodj.m3u")
+autodj =  playlist(mode="randomize",reload=1,reload_mode="rounds","/tmp/test/music")
 
 # Append replay to the metadata
 def append_autodj(m) =
@@ -49,14 +49,14 @@ end
 autodj = metadata.map(append_autodj, autodj)
 
 # Define transitions for changing to live
-pdlivejingle = single("/var/liquidsoap/jingles/liveshort.mp3")
+pdlivejingle = single("/tmp/test/liveshort.mp3")
 
 def tolive(old,new)
   sequence(merge=false,[once(pdlivejingle),(new:source)])
 end
 
 # Fallback to blank for drop outs on the input.harbor
-blankmp3 = single("/var/liquidsoap/jingles/blank.mp3")
+blankmp3 = single("/tmp/test/blank.mp3")
 
 def toauto(old,new)
   sequence(merge=false,[once(blankmp3),(new:source)])
@@ -87,18 +87,18 @@ liveout = source.on_frame(liveout, check_live)
 output.icecast(
   %mp3(bitrate=192),
   mount="/live192",
-  host="localhost", port=8000, password="hackme",
+  host="icecast", port=8000, password="hackme",
   name="host.net", description="Main 192kbps MP3 stream", url="https://www.host.net", genre="Dance Music", liveout)
 
 # Record the live streams
 output.file(
   %mp3(bitrate=192, id3v2=true),
-  {time.string("/var/liquidsoap/shows/%Y-%m-%d-%H_%M_%S_djlive.mp3")},
+  {time.string("/tmp/%Y-%m-%d-%H_%M_%S_djlive.mp3")},
   djlivessl,
   fallible=true)
 
 output.file(
   %mp3(bitrate=192, id3v2=true),
-  {time.string("/var/liquidsoap/shows/%Y-%m-%d-%H_%M_%S_djlive.mp3")},
+  {time.string("/tmp/%Y-%m-%d-%H_%M_%S_djlive.mp3")},
   djlive,
   fallible=true)
Refactored script
# Set log level
settings.log.level := 4

# Set the ssl certs for the harbor
cert = http.transport.ssl(
  certificate="/tmp/test/cert.pem",
  key="/tmp/test/key.pem"
)

# Define harbor's
djlivessl = input.harbor(
  transport=cert,
  "live",
  port=8020,
  password="hackme",
  buffer=2.
)
djlive = input.harbor(
  "live",
  port=8010,
  password="hackme",
  buffer=2.
)

# Append live to the metadata
def append_live(m) =
  [("artist", 'LIVE: #{m["artist"]}')]
end

djlivessl = metadata.map(append_live, djlivessl)
djlive = metadata.map(append_live, djlive)

# Set the fallback for the live streams
live = fallback([djlivessl, djlive], track_sensitive=false)

# Simple auto dj
autodj =  playlist("/tmp/test/music")

# Append replay to the metadata
def append_autodj(m) =
  [("artist", 'REPLAY: #{m["artist"]}')]
end

autodj = metadata.map(append_autodj, autodj)

# Define transitions for changing to live
pdlivejingle = single("/tmp/test/liveshort.mp3")

def tolive(_, new)
  sequence([(once(pdlivejingle):source), new], merge=false)
end

# Fallback to blank for drop outs on the input.harbor
blankmp3 = single("/tmp/test/blank.mp3")

def toauto(_, new)
  sequence([(once(blankmp3):source), new], merge=false)
end

# Set the fallback between live and auto
liveout = mksafe(
  fallback(
    [live, autodj],
    transitions=[tolive, toauto],
    transition_length=10.,
    track_sensitive=false
  )
)

# Skip the Auto DJ to the next track when going live
thread.when(getter.changes(live.is_ready), {live.is_ready() ? autodj.skip() : ()})

# Icecast output MP3 192 kbps stereo
output.icecast(
  %mp3,
  liveout,
  mount="/live192",
  host="icecast"
)

# Record the live streams
output.file(
  %mp3(bitrate=192, id3v2=true),
  {time.string("/tmp/%Y-%m-%d-%H_%M_%S_djlive.mp3")},
  djlivessl,
  fallible=true
)

output.file(
  %mp3(bitrate=192, id3v2=true),
  {time.string("/tmp/%Y-%m-%d-%H_%M_%S_djlive.mp3")},
  djlive,
  fallible=true
)

@SkillenUK
Copy link
Author

SkillenUK commented Nov 29, 2023

Hi sorry I should have mentioned.

This is Liquidsoap version 2.2.2, installed via OPAM in Ubuntu 22.04.3 LTS.

I'm installing... taglib mad lame cry ffmpeg ssl liquidsoap from OPAM.

I'll try and do some more testing to work out how to reproduce, but it doesn't happen every time so it's tricky to pin it down. I have seen the issue on two different VPS's from different suppliers with different hardware configurations, so I don't think it's happening on a specific processor type. Thanks,

Skillen.

@SkillenUK
Copy link
Author

SkillenUK commented Nov 29, 2023

Hi, I'm just having another look at this. I am now able to reproduce it quite consistently.

As I said before it doesn't happen every time so you need to connect BUTT to the ssl input.harbor and push some metadata a couple of times. It only seems to happen when I go in to the BUTT settings, select the stream tab and enter something in to the 'update song name manually' field then click on OK. I have now managed to make it fault when doing this after connecting, so it's definately related to setting the metadata and not the initial connection as I first suspected. I don't know if any other method of pushing metadata causes an issue because this is the method which we normally use, we also only use BUTT these days.

I have ran Liquidsoap from the shell now so that I can see any output and when the process ends, it closes with the message...

Segmentation fault

I have tried removing the metadata.map routines from the script to eliminate them and it still happens. I have also tried removing the transitions and it still happens, so I have eliminated these.

When I connect on the input.harbor which doesn't use ssl then I can't get it to fault. It's definately related to the input.harbor with ssl and pushing metadata from BUTT.

The simplified script which I can now reproduce the issue with is...

settings.init.allow_root.set(true)

# Set log file path
settings.log.file.path.set("/var/log/liquidsoap/radioref_dev.log")

# Set log level (3 is normal, put up to 4 for debugging)
log.level.set(4)

# St the log file permission so that users can read the file
settings.log.file.perms.set(755)

# Set the ssl certs for the harbor
cert = http.transport.ssl(
  certificate="/etc/ssl/certs/host_net.crt",
  key="/etc/ssl/private/host_net.key")

# Define a function to handle harbor authentication
def dj_auth(params)
  user     = params.user
  password = params.password

  ret = process.read.lines("php /var/liquidsoap/scripts/liqauthdev.php '#{user}' '#{password}'")
  ret = list.hd(default="",ret)

  if ret == "true" then
    true
  else
    false
  end
end

# Main DJ live harbor using ssl and website account authentication
djlivessl = input.harbor(transport=cert,"live",port=9020,auth=dj_auth,buffer=2.)

# Alternative simple auto dj
autodj =  playlist(mode="randomize",reload=1,reload_mode="rounds","/var/liquidsoap/autodj/autodj.m3u")

live =  mksafe(fallback(track_sensitive=false, [(djlivessl:source),(autodj:source)]))

# MP3 128 kbps stereo
output.icecast(
  %mp3(bitrate=128),
  mount="/livetest",
  host="localhost", port=8000, password="hackme",
  name="host.net", description="Main 128kbps MP3 stream", url="https://www.host.net", genre="Dance Music", live)

I have also simplified my liqauthdev.php script so that it simply returns 'true' and doesn't do anything else.

I hope this helps, thanks,

Skillen.

@vitoyucepi
Copy link
Collaborator

Is it possible to exclude

  1. the authentication function;
  2. playlist reload;
  3. various icecast options?

By the way, could you post the result of the opam list command?

Conditions
def one()
  if ret == "true" then
    true
  else
    false
  end
end

def two()
  ret == "true"
end

def three()
  bool_of_string(ret, default=false)
end

@SkillenUK
Copy link
Author

Hi, the output from the opam list command is as follows...

# Packages matching: installed
# Name                # Installed # Synopsis
angstrom              0.15.0      Parser combinators built for speed and memory-efficiency
base                  v0.16.3     Full standard library replacement for OCaml
base-bigarray         base
base-bytes            base        Bytes library distributed with the OCaml compiler
base-domains          base
base-nnp              base        Naked pointers prohibited in the OCaml heap
base-threads          base
base-unix             base
bigstringaf           0.9.1       Bigstring intrinsics and fast blits based on memcpy/memmove
camlp-streams         5.0.1       The Stream and Genlex libraries for use with Camlp4 and Camlp5
camomile              2.0.0       A Unicode library
conf-ffmpeg           1           Virtual package relying on FFmpeg
conf-lame             1           Virtual package relying on lame
conf-libcurl          2           Virtual package relying on a libcurl system installation
conf-libpcre          1           Virtual package relying on a libpcre system installation
conf-libssl           4           Virtual package relying on an OpenSSL library system installation
conf-mad              1           Virtual package relying on mad
conf-pkg-config       3           Check if pkg-config is installed and create an opam switch local pkgconfig folder
conf-taglib           1           Virtual package relying on taglib
cry                   1.0.1       OCaml client for the various icecast & shoutcast source protocols
csexp                 1.5.2       Parsing and printing of S-expressions in Canonical form
dtools                0.4.5       Library providing various helper functions to make daemons
dune                  3.11.1      Fast, portable, and opinionated build system
dune-build-info       3.11.1      Embed build information inside executable
dune-configurator     3.11.1      Helper library for gathering system configuration
dune-private-libs     3.11.1      Private libraries of Dune
dune-site             3.11.1      Embed locations information inside executable and libraries
duppy                 0.9.3       Library providing monadic threads
dyn                   3.11.1      Dynamic type
ffmpeg                1.1.9       Bindings for the ffmpeg libraries
ffmpeg-av             1.1.9       Bindings for the ffmpeg libraries -- top-level helpers
ffmpeg-avcodec        1.1.9       Bindings for the ffmpeg avcodec library
ffmpeg-avdevice       1.1.9       Bindings for the ffmpeg avdevice library
ffmpeg-avfilter       1.1.9       Bindings for the ffmpeg avfilter library
ffmpeg-avutil         1.1.9       Bindings for the ffmpeg avutil libraries
ffmpeg-swresample     1.1.9       Bindings for the ffmpeg swresample library
ffmpeg-swscale        1.1.9       Bindings for the ffmpeg swscale library
fileutils             0.6.4       API to manipulate files (POSIX like) and filenames
gen                   1.1         Iterators for OCaml, both restartable and consumable
lame                  0.3.7       MP3 encoding library
liquidsoap            2.2.2       Swiss-army knife for multimedia streaming
liquidsoap-core       2.2.2       Liquidsoap core library and binary
liquidsoap-lang       2.2.2       Liquidsoap language library
liquidsoap-libs       2.2.2       Liquidosap standard library
liquidsoap-libs-extra 2.2.2       Liquidosap standard library -- extra functionalities
mad                   0.5.2       Mad decoding library
menhir                20230608    An LR(1) parser generator
menhirLib             20230608    Runtime support library for parsers generated by Menhir
menhirSdk             20230608    Compile-time library for auxiliary tools related to Menhir
metadata              0.2.0       Read metadata from various file formats
mm                    0.8.4       The mm library contains high-level APIs to create and manipulate multimedia streams (audio, video, MIDI)
ocaml                 5.0.0       The OCaml compiler (virtual package)
ocaml-base-compiler   5.0.0       Official release 5.0.0
ocaml-compiler-libs   v0.12.4     OCaml compiler libraries repackaged
ocaml-config          3           OCaml Switch Configuration
ocaml-options-vanilla 1           Ensure that OCaml is compiled with no special options enabled
ocaml-syntax-shims    1.0.0       Backport new syntax to older OCaml versions
ocamlfind             1.9.6       A library manager for OCaml
ocurl                 0.9.2       Bindings to libcurl
opam-depext           1.2.1-1     Install OS distribution packages
ordering              3.11.1      Element ordering
pcre                  7.5.0       Bindings to the Perl Compatibility Regular Expressions library
pp                    1.2.0       Pretty-printing library
ppx_base              v0.16.0     Base set of ppx rewriters
ppx_cold              v0.16.0     Expands [@cold] into [@inline never][@specialise never][@local never]
ppx_compare           v0.16.0     Generation of comparison functions from types
ppx_derivers          1.2.1       Shared [@@deriving] plugin registry
ppx_enumerate         v0.16.0     Generate a list containing all values of a finite type
ppx_globalize         v0.16.0     A ppx rewriter that generates functions to copy local values to the global heap
ppx_hash              v0.16.0     A ppx rewriter that generates hash functions from type expressions and definitions
ppx_sexp_conv         v0.16.0     [@@deriving] plugin to generate S-expression conversion functions
ppx_string            v0.16.0     Ppx extension for string interpolation
ppxlib                0.31.0      Standard infrastructure for ppx rewriters
result                1.5         Compatibility Result module
sedlex                3.2         An OCaml lexer generator for Unicode
seq                   base        Compatibility package for OCaml's standard iterator type starting from 4.07.
sexplib0              v0.16.0     Library containing the definition of S-expressions and some base converters
ssl                   0.7.0       Bindings for OpenSSL
stdlib-shims          0.3.0       Backport some of the new stdlib features to older compiler
stdune                3.11.1      Dune's unstable standard library
stringext             1.6.0       Extra string functions for OCaml
taglib                0.3.10      Bindings for the taglib library
uri                   4.4.0       An RFC3986 URI/URL parsing library

To answer your questions...

  1. I will need to try excluding the authentication function later when I am back at home. I will try and do this tonight.
  2. This is already excluded in the last test which I performed.
  3. Are you talking about excluding the name, description and genre parameters? I could potentially try not outputting to Icecast at all to eliminate it altogether.

Thanks,

Skillen.

@vitoyucepi
Copy link
Collaborator

vitoyucepi commented Nov 30, 2023

I reproduced the problem with the butt on ubuntu:22.04.

  1. Init script
    OPAM_VERSION=2.1.5;
    OCAML_VERSION=5.1.1;
    sudo apt-get update;
    sudo apt-get dist-upgrade;
    sudo apt-get install --no-install-recommends -y curl ca-certificates patch unzip bubblewrap git bzip2 gcc make libc6-dev g++;
    sudo curl -sS -L -o /usr/local/bin/opam "https://github.com/ocaml/opam/releases/download/$OPAM_VERSION/opam-$OPAM_VERSION-x86_64-linux";
    sudo chmod +x /usr/local/bin/opam;
    opam init --bare -n;
    opam switch create "$OCAML_VERSION";
    eval $(opam env --switch="$OCAML_VERSION");
    opam install --confirm-level=unsafe-yes liquidsoap ssl;
    On ocaml 5.* the problem manifests itself as a segfault.
    On ocaml 4.14.1 liquidsoap can't terminate normally.
  2. Generate certificates
    openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -sha256 -days 365 -subj '/CN=localhost' -nodes;
    chmod 0666 *.pem;
  3. Liquidsoap script
    settings.log.level := 4
    
    # Set the ssl certs for the harbor
    cert = http.transport.ssl(
      certificate="/home/ubuntu/cert.pem",
      key="/home/ubuntu/key.pem"
    )
    
    # Main DJ live harbor using ssl and website account authentication
    live = input.harbor("live", transport=cert, port=9020)
    
    output.dummy(live, fallible=true)
Log
2023/11/30 12:25:33 >>> LOG START
2023/11/30 12:25:30 [main:3] Liquidsoap 2.2.2+dev
2023/11/30 12:25:30 [main:3] Using: angstrom=0.15.0 bigstringaf=0.9.1 bytes=[distributed with OCaml 4.02 or above] camlp-streams camomile.lib=2.0 cry=1.0.1 curl=0.9.2 dtools=0.4.5 dune-build-info=3.11.1 dune-private-libs.dune-section=3.11.1 dune-site=3.11.1 dune-site.private=3.11.1 duppy=0.9.3 ffmpeg-av=1.1.9 ffmpeg-avcodec=1.1.9 ffmpeg-avdevice=1.1.9 ffmpeg-avfilter=1.1.9 ffmpeg-avutil=1.1.9 ffmpeg-swresample=1.1.9 ffmpeg-swscale=1.1.9 fileutils=0.6.4 gen=1.1 lame=0.3.7 liquidsoap-lang=2.2.2 liquidsoap-lang.console=2.2.2 liquidsoap_builtins liquidsoap_core liquidsoap_ffmpeg liquidsoap_lame liquidsoap_mad liquidsoap_optionals liquidsoap_oss liquidsoap_runtime liquidsoap_ssl liquidsoap_taglib mad=0.5.2 menhirLib=20230608 metadata=0.2.0 mm=0.8.4 mm.audio=0.8.4 mm.base=0.8.4 mm.image=0.8.4 mm.midi=0.8.4 mm.video=0.8.4 pcre=7.5.0 sedlex=3.2 seq=[distributed with OCaml 4.07 or above] ssl=0.7.0 stdlib-shims=0.3.0 str=5.1.0 stringext=1.6.0 taglib=0.3.10 threads=5.1.0 unix=5.1.0 uri=4.4.0
2023/11/30 12:25:30 [clock:3] Using builtin (low-precision) implementation for latency control
2023/11/30 12:25:33 [main:3] Standard library loaded in 3.44 seconds.
2023/11/30 12:25:33 [frame:4] frame.audio.samplerate set to: 44100
2023/11/30 12:25:33 [frame:4] frame.video.framerate set to: 25
2023/11/30 12:25:33 [frame:4] frame.audio.channels set to: 2
2023/11/30 12:25:33 [frame:4] frame.video.default set to: false
2023/11/30 12:25:33 [frame:4] frame.midi.channels set to: 0
2023/11/30 12:25:33 [frame:4] frame.video.width set to: 1280
2023/11/30 12:25:33 [frame:4] frame.video.height set to: 720
2023/11/30 12:25:33 [frame:4] frame.audio.samplerate set to: 44100
2023/11/30 12:25:33 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2023/11/30 12:25:33 [frame:3] Video frame size set to: 1280x720
2023/11/30 12:25:33 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2023/11/30 12:25:33 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2023/11/30 12:25:33 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2023/11/30 12:25:33 [sandbox:3] Sandboxing disabled
2023/11/30 12:25:33 [startup:3] FFmpeg filters registration: 0.02s
2023/11/30 12:25:33 [startup:3] FFmpeg bitstream filters registration: 0.00s
2023/11/30 12:25:33 [startup:3] Typechecking: 3.18s
2023/11/30 12:25:33 [startup:3] Evaluation: 0.01s
2023/11/30 12:25:33 [startup:3] Typechecking: 0.04s
2023/11/30 12:25:33 [startup:3] Evaluation: 0.00s
2023/11/30 12:25:33 [startup:3] Typechecking: 0.00s
2023/11/30 12:25:33 [startup:3] Evaluation: 0.00s
2023/11/30 12:25:33 [startup:3] Loaded main.liq: 0.00s
2023/11/30 12:25:33 [clock:4] Currently 1 clock(s) allocated.
2023/11/30 12:25:33 [clock.main:4] Starting source(s): input.harbor, output.dummy
2023/11/30 12:25:33 [source:4] Source input.harbor gets up with content type: {audio=pcm(stereo)}.
2023/11/30 12:25:33 [input.harbor:3] Content type is {audio=pcm(stereo)}.
2023/11/30 12:25:33 [harbor:4] Opening port 9020 with icy = false
2023/11/30 12:25:33 [harbor:3] Adding mountpoint '/live' on port 9020
2023/11/30 12:25:33 [source:4] Source output.dummy gets up with content type: {audio=pcm(stereo)}.
2023/11/30 12:25:33 [dummy:3] Content type is {audio=pcm(stereo)}.
2023/11/30 12:25:33 [threads:4] Created thread "clock_main" (1 total).
2023/11/30 12:25:33 [clock:4] Main phase starts.
2023/11/30 12:25:33 [threads:4] Created thread "generic queue #1" (1 total).
2023/11/30 12:25:33 [threads:4] Created thread "generic queue #2" (2 total).
2023/11/30 12:25:33 [threads:4] Created thread "non-blocking queue #1" (3 total).
2023/11/30 12:25:33 [threads:4] Created thread "non-blocking queue #2" (4 total).
2023/11/30 12:25:33 [video.converter:3] Using preferred video converter: ffmpeg.
2023/11/30 12:25:33 [audio.converter:3] Using samplerate converter: ffmpeg.
2023/11/30 12:25:33 [video.text:3] Using native implementation
2023/11/30 12:25:33 [clock.main:3] Streaming loop starts in auto-sync mode
2023/11/30 12:25:33 [clock.main:3] Delegating synchronization to CPU clock
2023/11/30 12:25:33 [harbor:4] New client on port 9020: 192.168.1.1
2023/11/30 12:25:33 [harbor:4] Method: PUT, uri: /live, protocol: HTTP/1.1
2023/11/30 12:25:33 [harbor:4] Header: Host, value: 192.168.1.2:9020.
2023/11/30 12:25:33 [harbor:4] Header: User-Agent, value: butt 0.1.40.
2023/11/30 12:25:33 [harbor:4] Header: Content-Type, value: audio/mpeg.
2023/11/30 12:25:33 [harbor:4] Header: ice-name, value: no name.
2023/11/30 12:25:33 [harbor:4] Header: ice-public, value: 0.
2023/11/30 12:25:33 [harbor:4] Header: ice-audio-info, value: ice-bitrate=128;ice-channels=2;ice-samplerate=44100.
2023/11/30 12:25:33 [harbor:4] Header: Expect, value: 100-continue.
2023/11/30 12:25:33 [harbor:4] Client logged in.
2023/11/30 12:25:33 [harbor:4] PUT (source) request on /live.
2023/11/30 12:25:33 [harbor:4] Adding source on mountpoint "/live" with type "audio/mpeg".
2023/11/30 12:25:33 [decoder:4] Available decoders:
2023/11/30 12:25:33 [decoder:4] ffmpeg (priority: 10)
2023/11/30 12:25:33 [decoder:4] mad (priority: 1)
2023/11/30 12:25:33 [decoder:4] Selected decoder ffmpeg for mime-type audio/mpeg with expected content {audio=pcm(stereo)}
2023/11/30 12:25:33 [threads:4] Created thread "harbor source feeding" (2 total).
2023/11/30 12:25:33 [input.harbor:3] Decoding...
2023/11/30 12:25:33 [harbor:4] New client on port 9020: 192.168.1.1
2023/11/30 12:25:33 [harbor:4] Method: GET, uri: /admin/metadata?mode=updinfo&mount=/live&song=6, protocol: HTTP/1.0
2023/11/30 12:25:33 [harbor:4] Header: User-Agent, value: butt 0.1.40.
2023/11/30 12:25:33 [harbor:4] Header: Host, value: 192.168.1.2:9020.
2023/11/30 12:25:33 [harbor:4] https/ssl GET request on /admin/metadata.
2023/11/30 12:25:33 [harbor:4] https/ssl Arg: mount, value: /live.
2023/11/30 12:25:33 [harbor:4] https/ssl Arg: song, value: 6.
2023/11/30 12:25:33 [harbor:4] https/ssl Arg: mode, value: updinfo.
2023/11/30 12:25:33 [harbor:4] Request to update metadata for mount /live on port 9020
2023/11/30 12:25:33 [harbor:4] Client logged in.
2023/11/30 12:25:33 [input.harbor:3] New metadata chunk ? -- 6.
2023/11/30 12:25:33 [harbor:4] SSL write() error: error:00:000000:lib(0)::reason(0)
2023/11/30 12:25:34 [harbor:4] New client on port 9020: 192.168.1.1
2023/11/30 12:25:34 [harbor:4] Method: GET, uri: /status-json.xsl, protocol: HTTP/1.1
2023/11/30 12:25:34 [harbor:4] Header: Host, value: 192.168.1.2:9020.
2023/11/30 12:25:34 [harbor:4] Header: User-Agent, value: Mozilla.
2023/11/30 12:25:34 [harbor:4] Header: Accept, value: */*.
2023/11/30 12:25:34 [harbor:4] https/ssl GET request on /status-json.xsl.
2023/11/30 12:25:34 [harbor:4] Returned 404 for '/status-json.xsl'.
2023/11/30 12:25:34 [harbor:4] New client on port 9020: 192.168.1.1
2023/11/30 12:25:34 [harbor:4] Method: GET, uri: /admin/metadata?mode=updinfo&mount=/live&song=6, protocol: HTTP/1.0
2023/11/30 12:25:34 [harbor:4] Header: User-Agent, value: butt 0.1.40.
2023/11/30 12:25:34 [harbor:4] Header: Host, value: 192.168.1.2:9020.
2023/11/30 12:25:34 [harbor:4] https/ssl GET request on /admin/metadata.
2023/11/30 12:25:34 [harbor:4] https/ssl Arg: mount, value: /live.
2023/11/30 12:25:34 [harbor:4] https/ssl Arg: song, value: 6.
2023/11/30 12:25:34 [harbor:4] https/ssl Arg: mode, value: updinfo.
2023/11/30 12:25:34 [harbor:4] Request to update metadata for mount /live on port 9020
2023/11/30 12:25:34 [harbor:4] Client logged in.
2023/11/30 12:25:34 [input.harbor:3] New metadata chunk ? -- 6.
Segmentation fault

@SkillenUK
Copy link
Author

Thanks for your work.

It would be great for us if we could get a fix in the next version.

Skillen.

@SkillenUK
Copy link
Author

Hi @toots, is this something which you could take a look at as it has been reproduced? Thanks,

Skillen.

@toots
Copy link
Member

toots commented Jan 16, 2024

Thanks for the detailed reproduction steps. I will test them locally. One bit that would help a lot in situations like these is a gdb trace of the segfault. It's pretty easy to grab:

% gdb /path/to/liquidsoap
> r <arguments>
...crash..
> thread apply all bt

@toots
Copy link
Member

toots commented Jan 16, 2024

I am not able to reproduce with the latest rolling-release-v2.2x on either macos or ubuntu. Are you guys able to reproduce with the latest branch?

Couple of related remarks:

  • If able to reproduce, could y'all get a stack trace?
  • Could y'all also try without taglib? I've noticed some segfaults when testing the early multicore support with taglib. With the latest ocaml-metadata, taglib could probably be deprecated and not be part of the official images anymore.

@vitoyucepi
Copy link
Collaborator

vitoyucepi commented Jan 16, 2024

I've refined reproduction script.

Here's my trace from 2.2.3.
Starting program: /home/ubuntu/.opam/5.1.1/bin/liquidsoap main.liq
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2024/01/16 15:13:12 >>> LOG START
[New Thread 0x7fffda897640 (LWP 33557)]
[New Thread 0x7fffda096640 (LWP 33558)]
2024/01/16 15:13:11 [main:3] Liquidsoap 2.2.3+dev
2024/01/16 15:13:11 [main:3] Using: angstrom=0.16.0 bigstringaf=0.9.1 bytes=[distributed with OCaml 4.02 or above] camlp-streams camomile.lib=2.0 cry=1.0.1 curl=0.9.2 dtools=0.4.5 dune-build-info=3.12.2 dune-private-libs.dune-section=3.12.2 dune-site=3.12.2 dune-site.private=3.12.2 duppy=0.9.3 fileutils=0.6.4 gen=1.1 liquidsoap-lang=2.2.3 liquidsoap-lang.console=2.2.3 liquidsoap_builtins liquidsoap_core liquidsoap_optionals liquidsoap_oss liquidsoap_runtime liquidsoap_ssl menhirLib=20231231 metadata=0.2.0 mm=0.8.4 mm.audio=0.8.4 mm.base=0.8.4 mm.image=0.8.4 mm.midi=0.8.4 mm.video=0.8.4 pcre=7.5.0 sedlex=3.2 seq=[distributed with OCaml 4.07 or above] ssl=0.7.0 stdlib-shims=0.3.0 str=5.1.1 stringext=1.6.0 threads=5.1.1 unix=5.1.1 uri=4.4.0
2024/01/16 15:13:11 [clock:3] Using builtin (low-precision) implementation for latency control
2024/01/16 15:13:11 [main:3] Standard library loaded in 0.74 seconds.
2024/01/16 15:13:11 [frame:4] frame.audio.samplerate set to: 44100
2024/01/16 15:13:11 [frame:4] frame.video.framerate set to: 25
2024/01/16 15:13:12 [frame:4] frame.audio.channels set to: 2
2024/01/16 15:13:12 [frame:4] frame.video.default set to: false
2024/01/16 15:13:12 [frame:4] frame.midi.channels set to: 0
2024/01/16 15:13:12 [frame:4] frame.video.width set to: 1280
2024/01/16 15:13:12 [frame:4] frame.video.height set to: 720
2024/01/16 15:13:12 [frame:4] frame.audio.samplerate set to: 44100
2024/01/16 15:13:12 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2024/01/16 15:13:12 [frame:3] Video frame size set to: 1280x720
2024/01/16 15:13:12 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2024/01/16 15:13:12 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2024/01/16 15:13:12 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
[Detaching after vfork from child process 33559]
2024/01/16 15:13:12 [sandbox:3] Sandboxing disabled
2024/01/16 15:13:12 [startup:3] Typechecking: 0.52s
2024/01/16 15:13:12 [startup:3] Evaluation: 0.01s
2024/01/16 15:13:12 [startup:3] Typechecking: 0.02s
2024/01/16 15:13:12 [startup:3] Evaluation: 0.00s
2024/01/16 15:13:12 [startup:3] Typechecking: 0.00s
2024/01/16 15:13:12 [startup:3] Evaluation: 0.00s
2024/01/16 15:13:12 [startup:3] Loaded main.liq: 0.00s
2024/01/16 15:13:12 [clock:4] Currently 1 clock(s) allocated.
2024/01/16 15:13:12 [clock.main:4] Starting source(s): input.harbor, output.dummy
2024/01/16 15:13:12 [source:4] Source input.harbor gets up with content type: {audio=pcm(stereo)}.
2024/01/16 15:13:12 [input.harbor:3] Content type is {audio=pcm(stereo)}.
2024/01/16 15:13:12 [harbor:4] Opening port 9020 with icy = false
2024/01/16 15:13:12 [harbor:3] Adding mountpoint '/live' on port 9020
[New Thread 0x7fffd9895640 (LWP 33561)]
[New Thread 0x7fffd9094640 (LWP 33562)]
[New Thread 0x7fffd8893640 (LWP 33563)]
[New Thread 0x7fffd3fff640 (LWP 33564)]
[New Thread 0x7fffd37fe640 (LWP 33565)]
2024/01/16 15:13:12 [source:4] Source output.dummy gets up with content type: {audio=pcm(stereo)}.
2024/01/16 15:13:12 [dummy:3] Content type is {audio=pcm(stereo)}.
2024/01/16 15:13:12 [threads:4] Created thread "clock_main" (1 total).
2024/01/16 15:13:12 [clock:4] Main phase starts.
2024/01/16 15:13:12 [threads:4] Created thread "generic queue #1" (1 total).
2024/01/16 15:13:12 [threads:4] Created thread "generic queue #2" (2 total).
2024/01/16 15:13:12 [threads:4] Created thread "non-blocking queue #1" (3 total).
2024/01/16 15:13:12 [threads:4] Created thread "non-blocking queue #2" (4 total).
2024/01/16 15:13:12 [video.converter:3] Couldn't find preferred video converter: ffmpeg.
2024/01/16 15:13:12 [audio.converter:3] Using samplerate converter: native.
2024/01/16 15:13:12 [clock.main:3] Streaming loop starts in auto-sync mode
2024/01/16 15:13:12 [clock.main:3] Delegating synchronization to CPU clock
2024/01/16 15:13:12 [video.text:3] Using native implementation
2024/01/16 15:13:12 [harbor:4] New client on port 9020: 192.168.1.1
2024/01/16 15:13:12 [harbor:4] Method: PUT, uri: /live, protocol: HTTP/1.1
2024/01/16 15:13:12 [harbor:4] Header: Host, value: 192.168.1.2:9020.
2024/01/16 15:13:12 [harbor:4] Header: User-Agent, value: butt 0.1.40.
2024/01/16 15:13:12 [harbor:4] Header: Content-Type, value: audio/mpeg.
2024/01/16 15:13:12 [harbor:4] Header: ice-name, value: no name.
2024/01/16 15:13:12 [harbor:4] Header: ice-public, value: 0.
2024/01/16 15:13:12 [harbor:4] Header: ice-audio-info, value: ice-bitrate=128;ice-channels=2;ice-samplerate=44100.
2024/01/16 15:13:12 [harbor:4] Header: Expect, value: 100-continue.
2024/01/16 15:13:12 [harbor:4] Client logged in.
2024/01/16 15:13:12 [harbor:4] PUT (source) request on /live.
2024/01/16 15:13:12 [harbor:4] Adding source on mountpoint "/live" with type "audio/mpeg".
2024/01/16 15:13:12 [decoder:3] Unable to find a decoder for stream mime-type audio/mpeg with expected content {audio=pcm(stereo)}!
2024/01/16 15:13:12 [harbor:4] Harbor.Make(T).Unknown_codec
2024/01/16 15:13:12 [harbor:4] New client on port 9020: 192.168.1.1
2024/01/16 15:13:12 [harbor:4] Method: GET, uri: /admin/metadata?mode=updinfo&mount=/live&song=2, protocol: HTTP/1.0
2024/01/16 15:13:12 [harbor:4] Header: User-Agent, value: butt 0.1.40.
2024/01/16 15:13:12 [harbor:4] Header: Host, value: 192.168.1.2:9020.
2024/01/16 15:13:12 [harbor:4] https/ssl GET request on /admin/metadata.
2024/01/16 15:13:12 [harbor:4] https/ssl Arg: mount, value: /live.
2024/01/16 15:13:12 [harbor:4] https/ssl Arg: song, value: 2.
2024/01/16 15:13:12 [harbor:4] https/ssl Arg: mode, value: updinfo.
2024/01/16 15:13:12 [harbor:4] Request to update metadata for mount /live on port 9020
2024/01/16 15:13:12 [harbor:4] Client logged in.
2024/01/16 15:13:12 [harbor:4] Returned 405 for '/admin/metadata?mode=updinfo&mount=/live&song=2': Source format does not support ICY metadata update
Thread 8 "liquidsoap" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd37fe640 (LWP 33565)]
caml_modify (fp=0x555555e71528 <atoms+8>, val=29) at runtime/memory.c:156
Thread 8 (Thread 0x7fffd37fe640 (LWP 33565) "liquidsoap"):
#0  caml_modify (fp=0x555555e71528 <atoms+8>, val=29) at runtime/memory.c:156
#1  0x0000555555ddd342 in caml_poll (_read=<optimized out>, _write=<optimized out>, _err=<optimized out>, _timeout=<optimized out>) at duppy_stubs.c:131
#2  <signal handler called>
#3  0x0000555555cf2f02 in camlDuppy.poll_487 () at src/duppy.ml:37
#4  0x0000555555cf41da in camlDuppy.f_979 () at src/duppy.ml:211
#5  0x0000555555cf3d9e in camlDuppy.process_969 () at src/duppy.ml:232
#6  0x0000555555cf4c09 in camlDuppy.run_1061 () at src/duppy.ml:337
#7  0x0000555555cf4dea in camlDuppy.f_1071 () at src/duppy.ml:358
#8  0x0000555555cf49c0 in camlDuppy.queue_inner_2772 () at src/duppy.ml:368
#9  0x000055555596e355 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#10 0x0000555555d0a7f7 in camlThread.fun_843 () at thread.ml:48
#11 <signal handler called>
#12 0x0000555555dfc068 in caml_callback_exn (closure=<optimized out>, closure@entry=140737065993168, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#13 0x0000555555de0089 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#14 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#15 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 7 (Thread 0x7fffd3fff640 (LWP 33564) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffc0002c98) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffc0002c98) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffc0002c98, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff773ba41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5555563fd330, cond=0x7fffc0002c70) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x7fffc0002c70, mutex=mutex@entry=0x5555563fd330) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555e1b27e in sync_condvar_wait (m=0x5555563fd330, c=0x7fffc0002c70) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555cf4d25 in camlDuppy.run_1061 () at src/duppy.ml:352
#9  0x0000555555cf4dea in camlDuppy.f_1071 () at src/duppy.ml:358
#10 0x0000555555cf49c0 in camlDuppy.queue_inner_2772 () at src/duppy.ml:368
#11 0x000055555596e355 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#12 0x0000555555d0a7f7 in camlThread.fun_843 () at thread.ml:48
#13 <signal handler called>
#14 0x0000555555dfc068 in caml_callback_exn (closure=<optimized out>, closure@entry=140737065994968, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#15 0x0000555555de0089 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#16 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#17 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 6 (Thread 0x7fffd8893640 (LWP 33563) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffc8002c98) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffc8002c98) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffc8002c98, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff773ba41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5555563fd330, cond=0x7fffc8002c70) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x7fffc8002c70, mutex=mutex@entry=0x5555563fd330) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555e1b27e in sync_condvar_wait (m=0x5555563fd330, c=0x7fffc8002c70) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555cf4d25 in camlDuppy.run_1061 () at src/duppy.ml:352
#9  0x0000555555cf4dea in camlDuppy.f_1071 () at src/duppy.ml:358
#10 0x0000555555cf49c0 in camlDuppy.queue_inner_2772 () at src/duppy.ml:368
#11 0x000055555596e355 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#12 0x0000555555d0a7f7 in camlThread.fun_843 () at thread.ml:48
#13 <signal handler called>
#14 0x0000555555dfc068 in caml_callback_exn (closure=<optimized out>, closure@entry=140737065996712, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#15 0x0000555555de0089 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#16 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#17 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 5 (Thread 0x7fffd9094640 (LWP 33562) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffc4002c9c) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffc4002c9c) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffc4002c9c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff773ba41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5555563fd330, cond=0x7fffc4002c70) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x7fffc4002c70, mutex=mutex@entry=0x5555563fd330) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555e1b27e in sync_condvar_wait (m=0x5555563fd330, c=0x7fffc4002c70) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555cf4d25 in camlDuppy.run_1061 () at src/duppy.ml:352
#9  0x0000555555cf4dea in camlDuppy.f_1071 () at src/duppy.ml:358
#10 0x0000555555cf49c0 in camlDuppy.queue_inner_2772 () at src/duppy.ml:368
#11 0x000055555596e355 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#12 0x0000555555d0a7f7 in camlThread.fun_843 () at thread.ml:48
#13 <signal handler called>
#14 0x0000555555dfc068 in caml_callback_exn (closure=<optimized out>, closure@entry=140737065998400, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#15 0x0000555555de0089 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#16 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#17 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 4 (Thread 0x7fffd9895640 (LWP 33561) "liquidsoap"):
#0  0x00007ffff778d7f8 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=req@entry=0x7fffd9894ac0, rem=rem@entry=0x7fffd9894ac0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
#1  0x00007ffff7792677 in __GI___nanosleep (req=req@entry=0x7fffd9894ac0, rem=rem@entry=0x7fffd9894ac0) at ../sysdeps/unix/sysv/linux/nanosleep.c:25
#2  0x0000555555df21b2 in caml_unix_sleep (duration=<optimized out>) at sleep_unix.c:42
#3  <signal handler called>
#4  0x00005555559861ed in camlLiq_time.sleep_until_526 () at src/core/tools/liq_time.ml:32
#5  0x00005555559910d5 in camlClock.loop_1225 () at src/core/clock.ml:256
#6  0x000055555598e5e5 in camlClock.fun_2351 () at src/core/clock.ml:280
#7  0x000055555596e355 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#8  0x0000555555d0a7f7 in camlThread.fun_843 () at thread.ml:48
#9  <signal handler called>
#10 0x0000555555dfc068 in caml_callback_exn (closure=<optimized out>, closure@entry=140737066000720, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#11 0x0000555555de0089 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#12 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#13 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 3 (Thread 0x7fffda096640 (LWP 33558) "liquidsoap"):
#0  0x00007ffff77c363d in __GI___select (nfds=nfds@entry=0, readfds=readfds@entry=0x0, writefds=writefds@entry=0x0, exceptfds=exceptfds@entry=0x0, timeout=timeout@entry=0x7fffda095be0) at ../sysdeps/unix/sysv/linux/select.c:69
#1  0x0000555555ddf579 in st_msleep (msec=50) at /home/ubuntu/.opam/5.1.1/.opam-switch/build/ocaml-base-compiler.5.1.1/otherlibs/systhreads/st_posix.h:25
#2  caml_thread_tick (arg=<optimized out>) at /home/ubuntu/.opam/5.1.1/.opam-switch/build/ocaml-base-compiler.5.1.1/otherlibs/systhreads/st_pthreads.h:299
#3  0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#4  0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 2 (Thread 0x7fffda897640 (LWP 33557) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x5555563f23cc) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x5555563f23cc) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x5555563f23cc, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff773ba41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5555563f2370, cond=0x5555563f23a0) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x5555563f23a0, mutex=mutex@entry=0x5555563f2370) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555e1b27e in sync_condvar_wait (m=0x5555563f2370, c=0x5555563f23a0) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555d07122 in camlDtools__Dtools_impl.fun_2864 () at src/dtools_impl.ml:747
#9  0x0000555555d06e89 in camlDtools__Dtools_impl.mutexify_1623 () at src/dtools_impl.ml:715
#10 0x0000555555d070b2 in camlDtools__Dtools_impl.f_1643 () at src/dtools_impl.ml:743
#11 0x0000555555d0a7f7 in camlThread.fun_843 () at thread.ml:48
#12 <signal handler called>
#13 0x0000555555dfc068 in caml_callback_exn (closure=<optimized out>, closure@entry=140737066248072, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#14 0x0000555555de0089 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#15 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#16 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 1 (Thread 0x7ffff6c83980 (LWP 33554) "liquidsoap"):
#0  0x00007ffff77c0bcf in __GI___poll (fds=fds@entry=0x5555569d8450, nfds=nfds@entry=1, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x0000555555ddd216 in poll (__timeout=-1, __nfds=1, __fds=0x5555569d8450) at /usr/include/x86_64-linux-gnu/bits/poll2.h:39
#2  caml_poll (_read=<optimized out>, _write=<optimized out>, _err=<optimized out>, _timeout=<optimized out>) at duppy_stubs.c:95
#3  <signal handler called>
#4  0x0000555555cf2f02 in camlDuppy.poll_487 () at src/duppy.ml:37
#5  0x000055555596dfa5 in camlTutils.wait_for_done_1166 () at src/core/tools/tutils.ml:168
#6  0x000055555596dea0 in camlTutils.wait_done_1164 () at src/core/tools/tutils.ml:171
#7  0x000055555596f91b in camlTutils.main_1575 () at src/core/tools/tutils.ml:357
#8  0x0000555555d55ca0 in camlStdlib__List.iter_365 () at list.ml:112
#9  0x0000555555956316 in camlLifecycle.action_454 () at src/core/tools/lifecycle.ml:64
#10 0x0000555555d55ca0 in camlStdlib__List.iter_365 () at list.ml:112
#11 0x0000555555d55ca0 in camlStdlib__List.iter_365 () at list.ml:112
#12 0x0000555555d55ca0 in camlStdlib__List.iter_365 () at list.ml:112
#13 0x000055555591c76a in camlDune__exe__Liquidsoap.entry () at src/runtime/runner.default.ml:25
#14 0x0000555555914eeb in caml_program ()
#15 <signal handler called>
#16 0x0000555555e1ff06 in caml_startup_common (pooling=<optimized out>, argv=0x7fffffffe3c8) at runtime/startup_nat.c:132
#17 caml_startup_common (argv=0x7fffffffe3c8, pooling=<optimized out>) at runtime/startup_nat.c:88
#18 0x0000555555e1ff7f in caml_startup_exn (argv=<optimized out>) at runtime/startup_nat.c:139
#19 caml_startup (argv=<optimized out>) at runtime/startup_nat.c:144
#20 caml_main (argv=<optimized out>) at runtime/startup_nat.c:151
#21 0x0000555555912a22 in main (argc=<optimized out>, argv=<optimized out>) at runtime/main.c:37
8dcbe42
Starting program: /home/ubuntu/.opam/5.1.1/bin/liquidsoap main.liq
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2024/01/16 16:17:08 >>> LOG START
[New Thread 0x7fffda897640 (LWP 34671)]
[New Thread 0x7fffda096640 (LWP 34672)]
2024/01/16 16:17:07 [main:3] Liquidsoap rolling-release-v2.2.x-4-g8dcbe42+dev
2024/01/16 16:17:07 [main:3] Using: angstrom=0.16.0 bigstringaf=0.9.1 bytes=[distributed with OCaml 4.02 or above] camlp-streams camomile.lib=2.0 cry=1.0.2 curl=0.9.2 dtools=0.4.5 dune-build-info=3.12.2 dune-private-libs.dune-section=3.12.2 dune-site=3.12.2 dune-site.private=3.12.2 duppy=0.9.3 fileutils=0.6.4 gen=1.1 liquidsoap-lang=rolling-release-v2.2.x-4-g8dcbe42 liquidsoap-lang.console=rolling-release-v2.2.x-4-g8dcbe42 liquidsoap_builtins=rolling-release-v2.2.x-4-g8dcbe42-dirty liquidsoap_core=rolling-release-v2.2.x-4-g8dcbe42-dirty liquidsoap_optionals=rolling-release-v2.2.x-4-g8dcbe42-dirty liquidsoap_oss=rolling-release-v2.2.x-4-g8dcbe42-dirty liquidsoap_runtime=rolling-release-v2.2.x-4-g8dcbe42-dirty liquidsoap_ssl=rolling-release-v2.2.x-4-g8dcbe42-dirty menhirLib=20231231 metadata=0.2.0 mm=0.8.4 mm.audio=0.8.4 mm.base=0.8.4 mm.image=0.8.4 mm.midi=0.8.4 mm.video=0.8.4 pcre=7.5.0 sedlex=3.2 seq=[distributed with OCaml 4.07 or above] ssl=0.7.0 stdlib-shims=0.3.0 str=5.1.1 stringext=1.6.0 threads=5.1.1 unix=5.1.1 uri=4.4.0
2024/01/16 16:17:07 [clock:3] Using builtin (low-precision) implementation for latency control
2024/01/16 16:17:08 [main:3] Standard library loaded in 0.74 seconds.
2024/01/16 16:17:08 [frame:4] frame.audio.samplerate set to: 44100
2024/01/16 16:17:08 [frame:4] frame.video.framerate set to: 25
2024/01/16 16:17:08 [frame:4] frame.audio.channels set to: 2
2024/01/16 16:17:08 [frame:4] frame.video.default set to: false
2024/01/16 16:17:08 [frame:4] frame.midi.channels set to: 0
2024/01/16 16:17:08 [frame:4] frame.video.width set to: 1280
2024/01/16 16:17:08 [frame:4] frame.video.height set to: 720
2024/01/16 16:17:08 [frame:4] frame.audio.samplerate set to: 44100
2024/01/16 16:17:08 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2024/01/16 16:17:08 [frame:3] Video frame size set to: 1280x720
2024/01/16 16:17:08 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2024/01/16 16:17:08 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2024/01/16 16:17:08 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
[Detaching after vfork from child process 34673]
2024/01/16 16:17:08 [sandbox:3] Sandboxing disabled
2024/01/16 16:17:08 [startup:3] Typechecking: 0.52s
2024/01/16 16:17:08 [startup:3] Evaluation: 0.01s
2024/01/16 16:17:08 [startup:3] Typechecking: 0.02s
2024/01/16 16:17:08 [startup:3] Evaluation: 0.00s
2024/01/16 16:17:08 [startup:3] Typechecking: 0.00s
2024/01/16 16:17:08 [startup:3] Evaluation: 0.00s
2024/01/16 16:17:08 [startup:3] Loaded main.liq: 0.00s
2024/01/16 16:17:08 [clock:4] Currently 1 clock(s) allocated.
2024/01/16 16:17:08 [clock.main:4] Starting source(s): input.harbor, output.dummy
2024/01/16 16:17:08 [source:4] Source input.harbor gets up with content type: {audio=pcm(stereo)}.
2024/01/16 16:17:08 [input.harbor:3] Content type is {audio=pcm(stereo)}.
2024/01/16 16:17:08 [harbor:4] Opening port 9020 with icy = false
2024/01/16 16:17:08 [harbor:3] Adding mountpoint '/live' on port 9020
[New Thread 0x7fffd9895640 (LWP 34675)]
[New Thread 0x7fffd9094640 (LWP 34676)]
[New Thread 0x7fffd8893640 (LWP 34677)]
[New Thread 0x7fffd3fff640 (LWP 34678)]
[New Thread 0x7fffd37fe640 (LWP 34679)]
2024/01/16 16:17:08 [source:4] Source output.dummy gets up with content type: {audio=pcm(stereo)}.
2024/01/16 16:17:08 [dummy:3] Content type is {audio=pcm(stereo)}.
2024/01/16 16:17:08 [threads:4] Created thread "clock_main" (1 total).
2024/01/16 16:17:08 [clock:4] Main phase starts.
2024/01/16 16:17:08 [threads:4] Created thread "generic queue #1" (1 total).
2024/01/16 16:17:08 [threads:4] Created thread "generic queue #2" (2 total).
2024/01/16 16:17:08 [threads:4] Created thread "non-blocking queue #1" (3 total).
2024/01/16 16:17:08 [threads:4] Created thread "non-blocking queue #2" (4 total).
2024/01/16 16:17:08 [video.converter:3] Couldn't find preferred video converter: ffmpeg.
2024/01/16 16:17:08 [audio.converter:3] Using samplerate converter: native.
2024/01/16 16:17:08 [clock.main:3] Streaming loop starts in auto-sync mode
2024/01/16 16:17:08 [clock.main:3] Delegating synchronization to CPU clock
2024/01/16 16:17:08 [video.text:3] Using native implementation
2024/01/16 16:17:08 [harbor:4] New client on port 9020: 192.168.1.1
2024/01/16 16:17:08 [harbor:4] Method: PUT, uri: /live, protocol: HTTP/1.1
2024/01/16 16:17:08 [harbor:4] Header: Host, value: 192.168.1.2:9020.
2024/01/16 16:17:08 [harbor:4] Header: User-Agent, value: butt 0.1.40.
2024/01/16 16:17:08 [harbor:4] Header: Content-Type, value: audio/mpeg.
2024/01/16 16:17:08 [harbor:4] Header: ice-name, value: no name.
2024/01/16 16:17:08 [harbor:4] Header: ice-public, value: 0.
2024/01/16 16:17:08 [harbor:4] Header: ice-audio-info, value: ice-bitrate=128;ice-channels=2;ice-samplerate=44100.
2024/01/16 16:17:08 [harbor:4] Header: Expect, value: 100-continue.
2024/01/16 16:17:08 [harbor:4] Client logged in.
2024/01/16 16:17:08 [harbor:4] PUT (source) request on /live.
2024/01/16 16:17:08 [harbor:4] Adding source on mountpoint "/live" with type "audio/mpeg".
2024/01/16 16:17:08 [decoder:3] Unable to find a decoder for stream mime-type audio/mpeg with expected content {audio=pcm(stereo)}!
2024/01/16 16:17:08 [harbor:4] Harbor.Make(T).Unknown_codec
2024/01/16 16:17:08 [harbor:4] New client on port 9020: 192.168.1.1
2024/01/16 16:17:08 [harbor:4] Method: GET, uri: /admin/metadata?mode=updinfo&mount=/live&song=2, protocol: HTTP/1.0
2024/01/16 16:17:08 [harbor:4] Header: User-Agent, value: butt 0.1.40.
2024/01/16 16:17:08 [harbor:4] Header: Host, value: 192.168.1.2:9020.
2024/01/16 16:17:08 [harbor:4] https/ssl GET request on /admin/metadata.
2024/01/16 16:17:08 [harbor:4] https/ssl Arg: mount, value: /live.
2024/01/16 16:17:08 [harbor:4] https/ssl Arg: song, value: 2.
2024/01/16 16:17:08 [harbor:4] https/ssl Arg: mode, value: updinfo.
2024/01/16 16:17:08 [harbor:4] Request to update metadata for mount /live on port 9020
2024/01/16 16:17:08 [harbor:4] Client logged in.
2024/01/16 16:17:08 [harbor:4] Returned 405 for '/admin/metadata?mode=updinfo&mount=/live&song=2': Source format does not support ICY metadata update
Thread 7 "liquidsoap" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd3fff640 (LWP 34678)]
caml_modify (fp=0x555555e70d28 <atoms+8>, val=29) at runtime/memory.c:156
Thread 8 (Thread 0x7fffd37fe640 (LWP 34679) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffbc002c98) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffbc002c98) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffbc002c98, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff773ba41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5555563fc330, cond=0x7fffbc002c70) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x7fffbc002c70, mutex=mutex@entry=0x5555563fc330) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555e19f9e in sync_condvar_wait (m=0x5555563fc330, c=0x7fffbc002c70) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555cf3095 in camlDuppy.run_1061 () at src/duppy.ml:352
#9  0x0000555555cf315a in camlDuppy.f_1071 () at src/duppy.ml:358
#10 0x0000555555cf2d30 in camlDuppy.queue_inner_2772 () at src/duppy.ml:368
#11 0x000055555596c5c5 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#12 0x0000555555d09067 in camlThread.fun_843 () at thread.ml:48
#13 <signal handler called>
#14 0x0000555555dfad88 in caml_callback_exn (closure=<optimized out>, closure@entry=140737065992728, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#15 0x0000555555ddeda9 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#16 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#17 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 7 (Thread 0x7fffd3fff640 (LWP 34678) "liquidsoap"):
#0  caml_modify (fp=0x555555e70d28 <atoms+8>, val=29) at runtime/memory.c:156
#1  0x0000555555ddc062 in caml_poll (_read=<optimized out>, _write=<optimized out>, _err=<optimized out>, _timeout=<optimized out>) at duppy_stubs.c:131
#2  <signal handler called>
#3  0x0000555555cf1272 in camlDuppy.poll_487 () at src/duppy.ml:37
#4  0x0000555555cf254a in camlDuppy.f_979 () at src/duppy.ml:211
#5  0x0000555555cf210e in camlDuppy.process_969 () at src/duppy.ml:232
#6  0x0000555555cf2f79 in camlDuppy.run_1061 () at src/duppy.ml:337
#7  0x0000555555cf315a in camlDuppy.f_1071 () at src/duppy.ml:358
#8  0x0000555555cf2d30 in camlDuppy.queue_inner_2772 () at src/duppy.ml:368
#9  0x000055555596c5c5 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#10 0x0000555555d09067 in camlThread.fun_843 () at thread.ml:48
#11 <signal handler called>
#12 0x0000555555dfad88 in caml_callback_exn (closure=<optimized out>, closure@entry=140737065994528, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#13 0x0000555555ddeda9 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#14 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#15 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 6 (Thread 0x7fffd8893640 (LWP 34677) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x555556376054 <thread_table+116>) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x555556376054 <thread_table+116>) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x555556376054 <thread_table+116>, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff773ba41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556375ff0 <thread_table+16>, cond=0x555556376028 <thread_table+72>) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x555556376028 <thread_table+72>, mutex=mutex@entry=0x555556375ff0 <thread_table+16>) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555dde1b0 in st_masterlock_acquire (m=0x555556375fe8 <thread_table+8>) at /home/ubuntu/.opam/5.1.1/.opam-switch/build/ocaml-base-compiler.5.1.1/otherlibs/systhreads/st_pthreads.h:159
#6  0x0000555555dde225 in thread_lock_acquire (dom_id=<optimized out>) at st_stubs.c:126
#7  caml_thread_leave_blocking_section () at st_stubs.c:254
#8  0x0000555555e17b6a in caml_leave_blocking_section () at runtime/signals.c:171
#9  0x0000555555df27e4 in caml_unix_write (fd=<optimized out>, buf=<optimized out>, vofs=<optimized out>, vlen=<optimized out>) at write_unix.c:45
#10 <signal handler called>
#11 0x0000555555d4109f in camlUnix.write_771 () at unix.ml:273
#12 0x0000555555cf168c in camlDuppy.wake_up_826 () at src/duppy.ml:107
#13 0x0000555555cf6f9b in camlDuppy.handler_1857 () at src/duppy.ml:1024
#14 0x0000555555cf1c7a in camlDuppy.fun_2635 () at src/duppy.ml:151
#15 0x0000555555cf2a83 in camlDuppy.exec_1034 () at src/duppy.ml:279
#16 0x0000555555cf2f06 in camlDuppy.run_1061 () at src/duppy.ml:318
#17 0x0000555555cf315a in camlDuppy.f_1071 () at src/duppy.ml:358
#18 0x0000555555cf2d30 in camlDuppy.queue_inner_2772 () at src/duppy.ml:368
#19 0x000055555596c5c5 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#20 0x0000555555d09067 in camlThread.fun_843 () at thread.ml:48
#21 <signal handler called>
#22 0x0000555555dfad88 in caml_callback_exn (closure=<optimized out>, closure@entry=140737065996272, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#23 0x0000555555ddeda9 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#24 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#25 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 5 (Thread 0x7fffd9094640 (LWP 34676) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffc4002c98) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffc4002c98) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffc4002c98, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff773ba41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5555563fc330, cond=0x7fffc4002c70) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x7fffc4002c70, mutex=mutex@entry=0x5555563fc330) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555e19f9e in sync_condvar_wait (m=0x5555563fc330, c=0x7fffc4002c70) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555cf3095 in camlDuppy.run_1061 () at src/duppy.ml:352
#9  0x0000555555cf315a in camlDuppy.f_1071 () at src/duppy.ml:358
#10 0x0000555555cf2d30 in camlDuppy.queue_inner_2772 () at src/duppy.ml:368
#11 0x000055555596c5c5 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#12 0x0000555555d09067 in camlThread.fun_843 () at thread.ml:48
#13 <signal handler called>
#14 0x0000555555dfad88 in caml_callback_exn (closure=<optimized out>, closure@entry=140737065997960, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#15 0x0000555555ddeda9 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#16 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#17 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 4 (Thread 0x7fffd9895640 (LWP 34675) "liquidsoap"):
#0  0x00007ffff778d7f8 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=req@entry=0x7fffd9894ac0, rem=rem@entry=0x7fffd9894ac0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
#1  0x00007ffff7792677 in __GI___nanosleep (req=req@entry=0x7fffd9894ac0, rem=rem@entry=0x7fffd9894ac0) at ../sysdeps/unix/sysv/linux/nanosleep.c:25
#2  0x0000555555df0ed2 in caml_unix_sleep (duration=<optimized out>) at sleep_unix.c:42
#3  <signal handler called>
#4  0x000055555598475d in camlLiq_time.sleep_until_526 () at src/core/tools/liq_time.ml:32
#5  0x000055555598f645 in camlClock.loop_1225 () at src/core/clock.ml:256
#6  0x000055555598cb55 in camlClock.fun_2351 () at src/core/clock.ml:280
#7  0x000055555596c5c5 in camlTutils.process_1230 () at src/core/tools/tutils.ml:186
#8  0x0000555555d09067 in camlThread.fun_843 () at thread.ml:48
#9  <signal handler called>
#10 0x0000555555dfad88 in caml_callback_exn (closure=<optimized out>, closure@entry=140737066000280, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#11 0x0000555555ddeda9 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#12 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#13 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 3 (Thread 0x7fffda096640 (LWP 34672) "liquidsoap"):
#0  0x00007ffff77c363d in __GI___select (nfds=nfds@entry=0, readfds=readfds@entry=0x0, writefds=writefds@entry=0x0, exceptfds=exceptfds@entry=0x0, timeout=timeout@entry=0x7fffda095be0) at ../sysdeps/unix/sysv/linux/select.c:69
#1  0x0000555555dde299 in st_msleep (msec=50) at /home/ubuntu/.opam/5.1.1/.opam-switch/build/ocaml-base-compiler.5.1.1/otherlibs/systhreads/st_posix.h:25
#2  caml_thread_tick (arg=<optimized out>) at /home/ubuntu/.opam/5.1.1/.opam-switch/build/ocaml-base-compiler.5.1.1/otherlibs/systhreads/st_pthreads.h:299
#3  0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#4  0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 2 (Thread 0x7fffda897640 (LWP 34671) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x555556376050 <thread_table+112>) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x555556376050 <thread_table+112>) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x555556376050 <thread_table+112>, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff773ba41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556375ff0 <thread_table+16>, cond=0x555556376028 <thread_table+72>) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x555556376028 <thread_table+72>, mutex=mutex@entry=0x555556375ff0 <thread_table+16>) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555dde1b0 in st_masterlock_acquire (m=0x555556375fe8 <thread_table+8>) at /home/ubuntu/.opam/5.1.1/.opam-switch/build/ocaml-base-compiler.5.1.1/otherlibs/systhreads/st_pthreads.h:159
#6  0x0000555555dde225 in thread_lock_acquire (dom_id=<optimized out>) at st_stubs.c:126
#7  caml_thread_leave_blocking_section () at st_stubs.c:254
#8  0x0000555555e17b6a in caml_leave_blocking_section () at runtime/signals.c:171
#9  0x0000555555e1b932 in caml_write_fd (fd=1, flags=<optimized out>, buf=buf@entry=0x5555563d0e4c, n=n@entry=170) at runtime/unix.c:105
#10 0x0000555555e0a9cf in caml_flush_partial (channel=channel@entry=0x5555563d0de0) at runtime/io.c:248
#11 0x0000555555e0b828 in caml_flush (channel=<optimized out>) at runtime/io.c:263
#12 caml_ml_flush (vchannel=<optimized out>) at runtime/io.c:777
#13 <signal handler called>
#14 0x0000555555d86634 in camlCamlinternalFormat.output_acc_4362 () at camlinternalFormat.ml:1910
#15 0x0000555555d8eaba in camlStdlib__Printf.fun_482 () at printf.ml:20
#16 0x0000555555d05580 in camlDtools__Dtools_impl.print_1548 () at src/dtools_impl.ml:691
#17 0x0000555555d76424 in camlStdlib__Queue.iter_331 () at queue.ml:121
#18 0x0000555555d05891 in camlDtools__Dtools_impl.flush_1637 () at queue.ml:124
#19 0x0000555555d05911 in camlDtools__Dtools_impl.f_1643 () at src/dtools_impl.ml:741
#20 0x0000555555d09067 in camlThread.fun_843 () at thread.ml:48
#21 <signal handler called>
#22 0x0000555555dfad88 in caml_callback_exn (closure=<optimized out>, closure@entry=140737066248056, arg=<optimized out>, arg@entry=1) at runtime/callback.c:197
#23 0x0000555555ddeda9 in caml_thread_start (v=<optimized out>) at st_stubs.c:552
#24 0x00007ffff773cac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#25 0x00007ffff77ce850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 1 (Thread 0x7ffff6c83980 (LWP 34668) "liquidsoap"):
#0  0x00007ffff77c0bcf in __GI___poll (fds=fds@entry=0x5555563af010, nfds=nfds@entry=1, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x0000555555ddbf36 in poll (__timeout=-1, __nfds=1, __fds=0x5555563af010) at /usr/include/x86_64-linux-gnu/bits/poll2.h:39
#2  caml_poll (_read=<optimized out>, _write=<optimized out>, _err=<optimized out>, _timeout=<optimized out>) at duppy_stubs.c:95
#3  <signal handler called>
#4  0x0000555555cf1272 in camlDuppy.poll_487 () at src/duppy.ml:37
#5  0x000055555596c215 in camlTutils.wait_for_done_1166 () at src/core/tools/tutils.ml:168
#6  0x000055555596c110 in camlTutils.wait_done_1164 () at src/core/tools/tutils.ml:171
#7  0x000055555596db8b in camlTutils.main_1575 () at src/core/tools/tutils.ml:357
#8  0x0000555555d54510 in camlStdlib__List.iter_365 () at list.ml:112
#9  0x0000555555954586 in camlLifecycle.action_454 () at src/core/tools/lifecycle.ml:64
#10 0x0000555555d54510 in camlStdlib__List.iter_365 () at list.ml:112
#11 0x0000555555d54510 in camlStdlib__List.iter_365 () at list.ml:112
#12 0x0000555555d54510 in camlStdlib__List.iter_365 () at list.ml:112
#13 0x000055555591a76a in camlDune__exe__Liquidsoap.entry () at src/runtime/runner.default.ml:25
#14 0x0000555555912eeb in caml_program ()
#15 <signal handler called>
#16 0x0000555555e1ec26 in caml_startup_common (pooling=<optimized out>, argv=0x7fffffffe3c8) at runtime/startup_nat.c:132
#17 caml_startup_common (argv=0x7fffffffe3c8, pooling=<optimized out>) at runtime/startup_nat.c:88
#18 0x0000555555e1ec9f in caml_startup_exn (argv=<optimized out>) at runtime/startup_nat.c:139
#19 caml_startup (argv=<optimized out>) at runtime/startup_nat.c:144
#20 caml_main (argv=<optimized out>) at runtime/startup_nat.c:151
#21 0x0000555555910a22 in main (argc=<optimized out>, argv=<optimized out>) at runtime/main.c:37

@SkillenUK
Copy link
Author

SkillenUK commented Jan 16, 2024

Hi, thank you for looking at this. I've installed and ran gdb, the following is the output with Liquidsoap 2.2.3...

Starting program: /home/user/.opam/5.0.0/bin/liquidsoap /etc/liquidsoap/radiorefdev.liq
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffcc36f640 (LWP 3904711)]
[New Thread 0x7fffcbb6e640 (LWP 3904712)]
[Detaching after vfork from child process 3904713]
[New Thread 0x7fffcb36d640 (LWP 3904715)]
[New Thread 0x7fffcab6c640 (LWP 3904716)]
[New Thread 0x7fffca36b640 (LWP 3904717)]
[New Thread 0x7fffc9b6a640 (LWP 3904718)]
[New Thread 0x7fffc9369640 (LWP 3904719)]
[mp3 @ 0x7fffc000ab80] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fffc0025ec0] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fffbc048e80] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fffbe20edc0] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fffb400adc0] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fffb4029740] Estimating duration from bitrate, this may be inaccurate
[Detaching after vfork from child process 3904789]
[New Thread 0x7fffc8b68640 (LWP 3904790)]
[Thread 0x7fffc8b68640 (LWP 3904790) exited]
[New Thread 0x7fffc8b68640 (LWP 3904792)]
[Detaching after vfork from child process 3904793]
[New Thread 0x7fffabfff640 (LWP 3904794)]
[Thread 0x7fffabfff640 (LWP 3904794) exited]

Thread 8 "liquidsoap" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc9369640 (LWP 3904719)]
caml_modify (fp=0x555555f61e28 <atoms+8>, val=41) at runtime/memory.c:155
155     runtime/memory.c: No such file or directory.

(gdb) thread apply all bt

Thread 10 (Thread 0x7fffc8b68640 (LWP 3904792) "liquidsoap"):
#0  0x00007ffff550abcf in __GI___poll (fds=fds@entry=0x7fffa4002ca0, nfds=nfds@entry=1, timeout=timeout@entry=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x0000555555ebc3a6 in poll (__timeout=1000, __nfds=1, __fds=0x7fffa4002ca0) at /usr/include/x86_64-linux-gnu/bits/poll2.h:39
#2  caml_poll (_read=<optimized out>, _write=<optimized out>, _err=<optimized out>, _timeout=<optimized out>) at duppy_stubs.c:95
#3  <signal handler called>
#4  0x0000555555db3992 in camlDuppy__poll_486 () at src/duppy.ml:37
#5  0x0000555555a33e43 in camlTutils__wait_1555 () at src/core/tools/tutils.ml:344
#6  0x0000555555b21a60 in camlHarbor_input__f_1259 () at src/core/sources/harbor_input.ml:108
#7  0x0000555555b21787 in camlHarbor_input__read_1248 () at src/core/sources/harbor_input.ml:115
#8  <signal handler called>
#9  0x0000555555edb5da in caml_callback3_exn (closure=<optimized out>, arg1=<optimized out>, arg2=<optimized out>, arg2@entry=1, arg3=<optimized out>, arg3@entry=8193) at runtime/callback.c:213
#10 0x0000555555e972f5 in ocaml_avio_read_callback (private=0x7fffa4002c70, buf=0x7fffa4003600 "\377\373\264\004", buf_size=4096) at av_stubs.c:295
#11 0x00007ffff706c3e4 in avio_read () from /lib/x86_64-linux-gnu/libavformat.so.58
#12 0x00007ffff709ee31 in av_probe_input_buffer2 () from /lib/x86_64-linux-gnu/libavformat.so.58
#13 0x00007ffff71c6262 in avformat_open_input () from /lib/x86_64-linux-gnu/libavformat.so.58
#14 0x0000555555e974bd in open_input (url=url@entry=0x0, format=0x0, format_context=<optimized out>, _interrupt=_interrupt@entry=1, options=options@entry=0x7fffc8b66fe8) at av_stubs.c:663
#15 0x0000555555e99cce in ocaml_av_open_input_stream (_avio=<optimized out>, _format=<optimized out>, _opts=<optimized out>) at av_stubs.c:788
#16 <signal handler called>
#17 camlAv__ocaml_av_open_input_stream_822 () at av/av.ml:97
#18 0x0000555555a07d86 in camlAv__open_input_stream_830 () at av/av.ml:109
#19 0x00005555559e3cac in camlFfmpeg_decoder__create_stream_decoder_2859 () at src/core/decoder/ffmpeg_decoder.ml:1113
#20 0x0000555555b21b93 in camlHarbor_input__decoder_1865 () at src/core/sources/harbor_input.ml:185
#21 0x0000555555b1f8fc in camlHarbor_input__fun_2885 () at src/core/sources/harbor_input.ml:143
#22 0x0000555555a32a45 in camlTutils__process_1220 () at src/core/tools/tutils.ml:186
#23 0x0000555555dcb187 in camlThread__fun_840 () at thread.ml:48
#24 <signal handler called>
#25 0x0000555555edb260 in caml_callback_exn (closure=<optimized out>, closure@entry=140736856104168, arg=<optimized out>, arg@entry=1) at runtime/callback.c:168
#26 0x0000555555ebf1b6 in caml_thread_start (v=<optimized out>) at st_stubs.c:547
#27 0x00007ffff5486ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#28 0x00007ffff5518850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 8 (Thread 0x7fffc9369640 (LWP 3904719) "liquidsoap"):
#0  caml_modify (fp=0x555555f61e28 <atoms+8>, val=41) at runtime/memory.c:155
#1  0x0000555555ebc4d2 in caml_poll (_read=<optimized out>, _write=<optimized out>, _err=<optimized out>, _timeout=<optimized out>) at duppy_stubs.c:131
#2  <signal handler called>
#3  0x0000555555db3992 in camlDuppy__poll_486 () at src/duppy.ml:37
#4  0x0000555555db4c72 in camlDuppy__f_934 () at src/duppy.ml:211
#5  0x0000555555db483e in camlDuppy__process_924 () at src/duppy.ml:232
#6  0x0000555555db56d9 in camlDuppy__f_1060 () at src/duppy.ml:337
#7  0x0000555555db5421 in camlDuppy__queue_inner_2770 () at src/duppy.ml:368
#8  0x0000555555a32a45 in camlTutils__process_1220 () at src/core/tools/tutils.ml:186
#9  0x0000555555dcb187 in camlThread__fun_840 () at thread.ml:48
#10 <signal handler called>
#11 0x0000555555edb260 in caml_callback_exn (closure=<optimized out>, closure@entry=140736857568480, arg=<optimized out>, arg@entry=1) at runtime/callback.c:168
#12 0x0000555555ebf1b6 in caml_thread_start (v=<optimized out>) at st_stubs.c:547
#13 0x00007ffff5486ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#14 0x00007ffff5518850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 7 (Thread 0x7fffc9b6a640 (LWP 3904718) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffb8002c9c) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffb8002c9c) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffb8002c9c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff5485a41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556586ae0, cond=0x7fffb8002c70) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x7fffb8002c70, mutex=mutex@entry=0x555556586ae0) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555ef84de in sync_condvar_wait (m=0x555556586ae0, c=0x7fffb8002c70) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555db57e9 in camlDuppy__f_1060 () at src/duppy.ml:352
#9  0x0000555555db5421 in camlDuppy__queue_inner_2770 () at src/duppy.ml:368
#10 0x0000555555a32a45 in camlTutils__process_1220 () at src/core/tools/tutils.ml:186
--Type <RET> for more, q to quit, c to continue without paging--
#11 0x0000555555dcb187 in camlThread__fun_840 () at thread.ml:48
#12 <signal handler called>
#13 0x0000555555edb260 in caml_callback_exn (closure=<optimized out>, closure@entry=140736857570280, arg=<optimized out>, arg@entry=1) at runtime/callback.c:168
#14 0x0000555555ebf1b6 in caml_thread_start (v=<optimized out>) at st_stubs.c:547
#15 0x00007ffff5486ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#16 0x00007ffff5518850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 6 (Thread 0x7fffca36b640 (LWP 3904717) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffc0002c98) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffc0002c98) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffc0002c98, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff5485a41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556586ae0, cond=0x7fffc0002c70) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x7fffc0002c70, mutex=mutex@entry=0x555556586ae0) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555ef84de in sync_condvar_wait (m=0x555556586ae0, c=0x7fffc0002c70) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555db57e9 in camlDuppy__f_1060 () at src/duppy.ml:352
#9  0x0000555555db5421 in camlDuppy__queue_inner_2770 () at src/duppy.ml:368
#10 0x0000555555a32a45 in camlTutils__process_1220 () at src/core/tools/tutils.ml:186
#11 0x0000555555dcb187 in camlThread__fun_840 () at thread.ml:48
#12 <signal handler called>
#13 0x0000555555edb260 in caml_callback_exn (closure=<optimized out>, closure@entry=140736857572024, arg=<optimized out>, arg@entry=1) at runtime/callback.c:168
#14 0x0000555555ebf1b6 in caml_thread_start (v=<optimized out>) at st_stubs.c:547
#15 0x00007ffff5486ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#16 0x00007ffff5518850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 5 (Thread 0x7fffcab6c640 (LWP 3904716) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffb4002c98) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffb4002c98) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffb4002c98, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff5485a41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555556586ae0, cond=0x7fffb4002c70) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x7fffb4002c70, mutex=mutex@entry=0x555556586ae0) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555ef84de in sync_condvar_wait (m=0x555556586ae0, c=0x7fffb4002c70) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555db57e9 in camlDuppy__f_1060 () at src/duppy.ml:352
#9  0x0000555555db5421 in camlDuppy__queue_inner_2770 () at src/duppy.ml:368
#10 0x0000555555a32a45 in camlTutils__process_1220 () at src/core/tools/tutils.ml:186
#11 0x0000555555dcb187 in camlThread__fun_840 () at thread.ml:48
#12 <signal handler called>
#13 0x0000555555edb260 in caml_callback_exn (closure=<optimized out>, closure@entry=140736857573712, arg=<optimized out>, arg@entry=1) at runtime/callback.c:168
#14 0x0000555555ebf1b6 in caml_thread_start (v=<optimized out>) at st_stubs.c:547
#15 0x00007ffff5486ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#16 0x00007ffff5518850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 4 (Thread 0x7fffcb36d640 (LWP 3904715) "liquidsoap"):
#0  0x00007ffff54d77f8 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=req@entry=0x7fffcb36c080, rem=rem@entry=0x7fffcb36c080) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
#1  0x00007ffff54dc677 in __GI___nanosleep (req=req@entry=0x7fffcb36c080, rem=rem@entry=0x7fffcb36c080) at ../sysdeps/unix/sysv/linux/nanosleep.c:25
#2  0x0000555555ed12c2 in caml_unix_sleep (duration=<optimized out>) at sleep_unix.c:42
#3  <signal handler called>
#4  0x0000555555a4a6ab in camlLiq_time__sleep_until_525 () at src/core/tools/liq_time.ml:32
#5  0x0000555555a554c4 in camlClock__loop_1223 () at src/core/clock.ml:256
#6  0x0000555555a52a2b in camlClock__fun_2351 () at src/core/clock.ml:280
#7  0x0000555555a32a45 in camlTutils__process_1220 () at src/core/tools/tutils.ml:186
#8  0x0000555555dcb187 in camlThread__fun_840 () at thread.ml:48
#9  <signal handler called>
#10 0x0000555555edb260 in caml_callback_exn (closure=<optimized out>, closure@entry=140736857576032, arg=<optimized out>, arg@entry=1) at runtime/callback.c:168
#11 0x0000555555ebf1b6 in caml_thread_start (v=<optimized out>) at st_stubs.c:547
#12 0x00007ffff5486ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
--Type <RET> for more, q to quit, c to continue without paging--
#13 0x00007ffff5518850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 3 (Thread 0x7fffcbb6e640 (LWP 3904712) "liquidsoap"):
#0  0x00007ffff550d63d in __GI___select (nfds=nfds@entry=0, readfds=readfds@entry=0x0, writefds=writefds@entry=0x0, exceptfds=exceptfds@entry=0x0, timeout=timeout@entry=0x7fffcbb6d1e0) at ../sysdeps/unix/sysv/linux/select.c:69
#1  0x0000555555ebe6a9 in st_msleep (msec=50) at /home/scienide/.opam/5.0.0/.opam-switch/build/ocaml-base-compiler.5.0.0/otherlibs/systhreads/st_posix.h:25
#2  caml_thread_tick (arg=<optimized out>) at /home/scienide/.opam/5.0.0/.opam-switch/build/ocaml-base-compiler.5.0.0/otherlibs/systhreads/st_pthreads.h:300
#3  0x00007ffff5486ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#4  0x00007ffff5518850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 2 (Thread 0x7fffcc36f640 (LWP 3904711) "liquidsoap"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55555657b15c) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x55555657b15c) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55555657b15c, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff5485a41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55555657b100, cond=0x55555657b130) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x55555657b130, mutex=mutex@entry=0x55555657b100) at ./nptl/pthread_cond_wait.c:627
#5  0x0000555555ef84de in sync_condvar_wait (m=0x55555657b100, c=0x55555657b130) at runtime/sync_posix.h:122
#6  caml_ml_condition_wait (wcond=<optimized out>, wmut=<optimized out>) at runtime/sync.c:172
#7  <signal handler called>
#8  0x0000555555dc7ab2 in camlDtools__Dtools_impl__fun_2843 () at src/dtools_impl.ml:747
#9  0x0000555555dc7819 in camlDtools__Dtools_impl__mutexify_1617 () at src/dtools_impl.ml:715
#10 0x0000555555dc7a42 in camlDtools__Dtools_impl__f_1637 () at src/dtools_impl.ml:743
#11 0x0000555555dcb187 in camlThread__fun_840 () at thread.ml:48
#12 <signal handler called>
#13 0x0000555555edb260 in caml_callback_exn (closure=<optimized out>, closure@entry=140736858008464, arg=<optimized out>, arg@entry=1) at runtime/callback.c:168
#14 0x0000555555ebf1b6 in caml_thread_start (v=<optimized out>) at st_stubs.c:547
#15 0x00007ffff5486ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#16 0x00007ffff5518850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 1 (Thread 0x7fffea5f5380 (LWP 3904692) "liquidsoap"):
#0  0x00007ffff550abcf in __GI___poll (fds=fds@entry=0x555556dbb800, nfds=nfds@entry=1, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x0000555555ebc3a6 in poll (__timeout=-1, __nfds=1, __fds=0x555556dbb800) at /usr/include/x86_64-linux-gnu/bits/poll2.h:39
#2  caml_poll (_read=<optimized out>, _write=<optimized out>, _err=<optimized out>, _timeout=<optimized out>) at duppy_stubs.c:95
#3  <signal handler called>
#4  0x0000555555db3992 in camlDuppy__poll_486 () at src/duppy.ml:37
#5  0x0000555555a32695 in camlTutils__wait_for_done_1156 () at src/core/tools/tutils.ml:168
#6  0x0000555555a32590 in camlTutils__wait_done_1154 () at src/core/tools/tutils.ml:171
#7  0x0000555555a33ffb in camlTutils__main_1560 () at src/core/tools/tutils.ml:357
#8  0x0000555555e155c0 in camlStdlib__List__iter_508 () at list.ml:110
#9  0x0000555555a1abd6 in camlLifecycle__action_450 () at src/core/tools/lifecycle.ml:64
#10 0x0000555555e155c0 in camlStdlib__List__iter_508 () at list.ml:110
#11 0x0000555555e155c0 in camlStdlib__List__iter_508 () at list.ml:110
#12 0x0000555555e155c0 in camlStdlib__List__iter_508 () at list.ml:110
#13 0x000055555599906a in camlDune__exe__Liquidsoap__entry () at src/runtime/runner.default.ml:25
#14 0x00005555559903bb in caml_program ()
#15 <signal handler called>
#16 0x0000555555efcce8 in caml_startup_common (pooling=<optimized out>, argv=0x7fffffffe628) at runtime/startup_nat.c:129
#17 caml_startup_common (argv=0x7fffffffe628, pooling=<optimized out>) at runtime/startup_nat.c:85
#18 0x0000555555efcd5f in caml_startup_exn (argv=<optimized out>) at runtime/startup_nat.c:136
#19 caml_startup (argv=<optimized out>) at runtime/startup_nat.c:141
#20 caml_main (argv=<optimized out>) at runtime/startup_nat.c:148
#21 0x000055555598dbb2 in main (argc=<optimized out>, argv=<optimized out>) at runtime/main.c:37

Next I've removed taglib and tried again. It initally appeared more stable, I was able to connect and push the metadata a couple of times from BUTT. But after disconnecting then reconnecting and trying again, I instantly had another segmentation fault.

Let me know if you'd like me to try anything else, thanks,

Skillen.

@toots
Copy link
Member

toots commented Jan 17, 2024

Thanks y'all. Unfortunately, I still cannot reproduce on this debian amd64 machine.

I think in this case the next step would be to confirm that it is what I think it is which is a memory corruption happening when one of the SSL binding C elements is garbage collected shortly after being created.

Would y'all be able to test with TLS and see if the segfault goes away with it?

@vitoyucepi
Copy link
Collaborator

vitoyucepi commented Jan 17, 2024

I don't know why, but maybe something is broken.

Failed to accept new client: Lang.Runtime_error { kind: "tls", msg: "TLS handshake error: illegal parameter", pos: [] }
settings.log.level := 4

# Set the ssl certs for the harbor
cert = http.transport.tls(
  certificate="cert.pem",
  key="key.pem"
)

# Main DJ live harbor using ssl and website account authentication
live = input.harbor("live", transport=cert, port=9020)

output.dummy(live, fallible=true)

BTW, I can reproduce on the debian:12 + opam.
I use the cloud image as a base.

@toots
Copy link
Member

toots commented Jan 18, 2024

I was only able to reproduce this on debian. I added a proper domain name to the machine and generated a self-signed cert for it and it started working. Looks like ocaml-tls at least on debian requires a proper domain name, not localhost.

@SkillenUK
Copy link
Author

I'm struggling to get tls working as well. I've installed it with opam, generated some self signed certs and implemented it in the script the same way as @vitoyucepi has. But it doesn't seem to find the package...

At /etc/liquidsoap/radiorefdev.liq, line 30, char 7-21:
cert = http.transport.tls(

Error 5: this value has no method `tls`
  Its type is
{
  ssl : (?read_timeout : float?, ?write_timeout : float?,
         ?password : string?, ?min_protocol : string?,
         ?max_protocol : string?, ?certificate : string?, ?key : string?) ->
        http_transport.{default_port : int, name : string, protocol : string},
  unix : http_transport
  .{default_port : int, name : string, protocol : string
  }
}.

It's not something which I have used before so I may have missed something, thanks,

Skillen.

@vitoyucepi
Copy link
Collaborator

vitoyucepi commented Jan 20, 2024

I use opam to install packages, so opam install tls-liquidsoap works for me in addition to opam install liquidsoap. Probably official packages and containers already have built-in support for http.transport.tls.

The right solution for me is to terminate encrypted connections on nginx.

@SkillenUK
Copy link
Author

@vitoyucepi thank you for your help again, you've been fantastic helping me with this issue :)

I've got tls kind of working. I can connect to the harbor from BUTT and it appears that pushing the metadata doesn't cause a crash. However after disconnecting from the harbor, I am unable to reconnect again but Liquidsoap is still running. Then if I kill Liquidsoap, a couple of Liquidsoap processes appear with different PID'a which are using 100% of the CPU and are difficult to kill.

I think this proves that the tls method doesn't have the metadata issue, although I can't be completely sure because of my inability to reconnect and the other issue which arises.

I don't think I want to try and get tls working as an alternative because I don't want to use unsigned certificates, I am using nginx already so I'll look at setting up a proxy pass to the harbor and see if I can get that working. Thanks for the suggestion.

@toots
Copy link
Member

toots commented Jan 22, 2024

I've been able to reproduce repeated TLS connections here. However, I agree that if you can use nginx to handle the front traffic this would probably be a better alternative.

@toots
Copy link
Member

toots commented Jan 22, 2024

I have reported this to ocaml-ssl. I'm gonna close the issue here since I believe that there isn't much more we can do. Please feel free to follow-up with any issue related to TLS in a new ticket.

@toots toots closed this as completed Jan 22, 2024
@SkillenUK
Copy link
Author

Great, thanks again both for your help.

I'll work on setting up NGINX.

Skillen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants