Liquidsoap
  1. Liquidsoap
  2. LS-503

Liquidsoap locks-up on uncaught exception

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-beta3
    • Fix Version/s: 1.0
    • Component/s: Liquidsoap
    • Labels:
      None
    • Environment:
      Ubuntu Linux x64

      Description

      When mistyping the encoding in set("tag.encodings",["UTF-8","CP-1251"]) the liquidsoap will lock-up when trying to fetch the stream. It doesn't respond neither to stop daemon, nor to the kill signal. only -KILL will help to end this. log and script are attached.

      Stream script is:

      ################### [Definitions] ###################

      streamTitle = "RadioVkontakte.ru | ICQ:6979990"
      streamDescr = "RadioVkontakte.ru"
      streamGenre = "Electronic"
      streamUrl = ""
      streamICQ = "6979990"

      masterHost = "radiovkontakte.ru"
      masterPort = 9000
      masterMount = "/rvk.ogg"
      testMount = "/test.ogg"
      masterBitrate = 72
      masterPasswd = "***"
      masterUrl = "http://" ^ masterHost ^ ":#{masterPort}" ^ masterMount

      livePasswd = "***"
      liveMount = "live.ogg"

      playlistPasswd = "***"
      playlistMount = "playlist.ogg"

      shoutcastPasswd = "***"
      shoutcastHost = "radiovkontakte.ru"

      basePath = "/home/radio/"

      logLevel = 5

      set("init.daemon.pidfile.path","/var/run/liquidsoap/<script>.pid")
      set("init.daemon.pidfile",true)
      set("init.daemon",true)

      set("init.trace",true)

      set("log.level",logLevel)
      set("log.file.path", basePath ^ "log/<script>.log")

      set("server.telnet.reverse_dns", false)
      set("harbor.reverse_dns", false)

      set("tag.encodings",["UTF-8","CP-1251"])

      def stream_source(host, port, mount, pass, proto, format, source) =

          output.icecast(
      id="#{host}_#{port}_#{mount}",
              restart=true,
              mount=mount,
              host=host,
              port=port,
              password=pass,
              genre=streamGenre,
              url=streamUrl,
              description=streamDescr,
              name=streamTitle,
      protocol=proto,
      format,
              source
          )

      end

      ################### [Input] ###################

      input = input.http(
          masterUrl,
          new_track_on_metadata = false
      );

      input = mksafe(input)

      ################### [Output] ###################

      stream_source(
          masterHost,
          masterPort,
          "aac",
          masterPasswd,
          "http",
          %aacplus(bitrate=48),
          input
      )


      The log:
      2011/04/04 19:23:43 >>> LOG START
      2011/04/04 19:23:43 [protocols.external:3] Didn't find "ufetch".
      2011/04/04 19:23:43 [protocols.external:3] Found "/usr/bin/wget".
      2011/04/04 19:23:43 [main:3] Liquidsoap 1.0.0-beta+svn (trunk/liquidsoap@rev8237)
      2011/04/04 19:23:43 [main:3] Using: pcre=6.0.1 dtools=0.2.2 duppy=0.4.0
      0.4.0 duppy.syntax=0.4.0
      0.4.0 cry=0.1.6 mm=0.1.0 xmlplaylist=0.1.2 lastfm=0.3.0 ogg=0.4.1 vorbis=0.5.1 mad=0.4.0 flac=0.1.0 flac.ogg=0.1.0 lame=0.2.4 aacplus=0.2.0 theora=0.2.0 samplerate=0.1.1 taglib=0.1.4 camomile=0.7.1 faad=0.2.0 faac=0.1.2 soundtouch=0.1.6 ladspa=0.1.2
      2011/04/04 19:23:43 [main:2]
      2011/04/04 19:23:43 [main:2] DISCLAIMER: This version of Liquidsoap has been
      2011/04/04 19:23:43 [main:2] compiled from a snapshot of the development code.
      2011/04/04 19:23:43 [main:2] As such, it should not be used in production
      2011/04/04 19:23:43 [main:2] unless you know what you are doing!
      2011/04/04 19:23:43 [main:2]
      2011/04/04 19:23:43 [main:2] We are, however, very interested in any feedback
      2011/04/04 19:23:43 [main:2] about our development code and committed to fix
      2011/04/04 19:23:43 [main:2] issues as soon as possible.
      2011/04/04 19:23:43 [main:2]
      2011/04/04 19:23:43 [main:2] If you are interested in collaborating to
      2011/04/04 19:23:43 [main:2] the development of Liquidsoap, feel free to
      2011/04/04 19:23:43 [main:2] drop us a mail at <savonet-devl@lists.sf.net>
      2011/04/04 19:23:43 [main:2] or to join the #savonet IRC channel on Freenode.
      2011/04/04 19:23:43 [main:2]
      2011/04/04 19:23:43 [main:2] Please send any bug report or feature request
      2011/04/04 19:23:43 [main:2] using our trac <http://savonet.rastageeks.org>.
      2011/04/04 19:23:43 [main:2]
      2011/04/04 19:23:43 [main:2] We hope you enjoy this snapshot build of Liquidsoap!
      2011/04/04 19:23:43 [main:2]
      2011/04/04 19:23:43 [lang:3] Did not find flac binary: flac decoder disabled.
      2011/04/04 19:23:43 [lang:3] Did not find metaflac binary: flac metadata resolver disabled.
      2011/04/04 19:23:43 [lang:3] Did not find faad binary: faad decoder disabled.
      2011/04/04 19:23:43 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
      2011/04/04 19:23:43 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
      2011/04/04 19:23:43 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
      2011/04/04 19:23:43 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
      2011/04/04 19:23:43 [video.converter:4] Couldn't find preferred video converter: gavl.
      2011/04/04 19:23:43 [audio.converter:4] Using preferred samplerate converter: libsamplerate.
      2011/04/04 19:23:43 [threads:3] Created thread "generic queue #1".
      2011/04/04 19:23:43 [threads:3] Created thread "non-blocking queue #1".
      2011/04/04 19:23:43 [clock:4] Currently 1 clocks allocated.
      2011/04/04 19:23:43 [clock.wallclock_main:4] Starting 1 sources...
      2011/04/04 19:23:43 [source:4] Source radiovkontakte(dot)ru_8100_rvkMid gets up.
      2011/04/04 19:23:43 [source:4] Source mksafe gets up.
      2011/04/04 19:23:43 [source:4] Source src_4565 gets up.
      2011/04/04 19:23:43 [threads:3] Created thread "http polling" (1 total).
      2011/04/04 19:23:43 [src_4565:4] Activations changed: static=[], dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
      2011/04/04 19:23:43 [source:4] Source safe_blank gets up.
      2011/04/04 19:23:43 [safe_blank:4] Content kind is {audio=2;video=0;midi=0}.
      2011/04/04 19:23:43 [safe_blank:4] Activations changed: static=[], dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
      2011/04/04 19:23:43 [mksafe:4] Activations changed: static=[radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid], dynamic=[].
      2011/04/04 19:23:43 [stdout:3] init(0):init-start @stop-atom
      2011/04/04 19:23:43 [src_4565:4] Connecting to <http://radiovkontakte.ru:9000/rvk.ogg>...
      2011/04/04 19:23:43 [radiovkontakte(dot)ru_8100_rvkMid:4] Activations changed: static=[radiovkontakte(dot)ru_8100_rvkMid], dynamic=[].
      2011/04/04 19:23:43 [stdout:3] init(0):init-start @start-triggers
      2011/04/04 19:23:43 [radiovkontakte(dot)ru_8100_rvkMid:4] Enabling caching mode: active source.
      2011/04/04 19:23:44 [radiovkontakte(dot)ru_8100_rvkMid:3] Connecting mount rvkMid for source@radiovkontakte.ru...
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @stop-triggers
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @stop
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @return
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @called
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @start
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @start-depends
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @stop-depends
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @start-atom
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @stop-atom
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @start-triggers
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @stop-triggers
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @stop
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @return
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @stop-triggers
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @stop
      2011/04/04 19:23:44 [stdout:3] init(0):init-start @return
      2011/04/04 19:23:44 [radiovkontakte(dot)ru_8100_rvkMid:3] Connection setup was successful.
      2011/04/04 19:23:44 [threads:3] Created thread "wallclock_main" (2 total).
      2011/04/04 19:23:44 [clock:4] Main phase starts.
      2011/04/04 19:23:44 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
      2011/04/04 19:23:44 [mksafe:3] Switch to safe_blank.
      2011/04/04 19:23:44 [safe_blank:4] Activations changed: static=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid], dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
      2011/04/04 19:23:44 [src_4565:4] Could not get file: File Not Found
      2011/04/04 19:23:44 [src_4565:4] Connection failed: Http_source.Internal
      2011/04/04 19:23:46 [src_4565:4] Connecting to <http://radiovkontakte.ru:9000/rvk.ogg>...
      2011/04/04 19:23:46 [src_4565:4] Trying playlist parser for mime application/ogg
      2011/04/04 19:23:46 [src_4565:4] Content-type "application/ogg".
      2011/04/04 19:23:46 [decoder:4] Trying method "MP3/LIBMAD" for "application/ogg"...
      2011/04/04 19:23:46 [decoder:4] Trying method "OGG" for "application/ogg"...
      2011/04/04 19:23:46 [decoder:3] Method "OGG" accepted "application/ogg".
      2011/04/04 19:23:46 [src_4565:3] Decoding...
      2011/04/04 19:23:46 [ogg.demuxer:5] Found a ogg logical stream, serial: 327b23c6
      2011/04/04 19:23:46 [ogg.demuxer:5] Trying ogg/flac format
      2011/04/04 19:23:46 [ogg.demuxer:5] Trying ogg/theora format
      2011/04/04 19:23:46 [ogg.demuxer:5] Trying ogg/vorbis format
      2011/04/04 19:23:46 [ogg.demuxer:5] ogg/vorbis format detected for stream 327b23c6
      2011/04/04 19:23:47 [mksafe:3] Switch to src_4565 with transition.
      2011/04/04 19:23:47 [safe_blank:4] Activations changed: static=[], dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
      2011/04/04 19:23:47 [src_4565:4] Activations changed: static=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid], dynamic=[mksafe:radiovkontakte(dot)ru_8100_rvkMid:radiovkontakte(dot)ru_8100_rvkMid].
      2011/04/04 19:23:47 [threads:1] Thread "wallclock_main" failed: Unknown encoding "CP-1251"!!
      2011/04/04 19:23:47 [main:3] Shutdown started!
      2011/04/04 19:23:47 [main:3] Waiting for threads to terminate...
      2011/04/04 19:23:47 [stderr:3] Thread 5 killed on uncaught exception Failure("Unknown encoding "CP-1251"!")
      2011/04/04 19:23:47 [stdout:3] init(0):init-stop @called
      2011/04/04 19:23:47 [stdout:3] init(0):init-stop @start
      2011/04/04 19:23:47 [stderr:3] Raised at file "pervasives.ml", line 22, characters 22-33
      2011/04/04 19:23:47 [stdout:3] init(0):init-stop @start-depends
      2011/04/04 19:23:47 [stderr:3] Called from file "list.ml", line 57, characters 20-23
      2011/04/04 19:23:47 [stdout:3] init(0):init-stop @called
      2011/04/04 19:23:47 [stderr:3] Called from file "list.ml", line 57, characters 32-39
      2011/04/04 19:23:47 [stderr:3] Called from file "array.ml", line 122, characters 21-40
      2011/04/04 19:23:47 [stdout:3] init(0):init-stop @start
      2011/04/04 19:23:47 [stdout:3] init(0):init-stop @start-depends
      2011/04/04 19:23:47 [stderr:3] Called from file "list.ml", line 69, characters 12-15
      2011/04/04 19:23:47 [stdout:3] init(0):init-stop @stop-depends
      2011/04/04 19:23:47 [stdout:3] init(0):init-stop @start-atom
      2011/04/04 19:23:55 [src_4565:3] Buffer overrun: Dropping 0.01s.
      2011/04/04 19:23:55 [src_4565:3] Buffer overrun: Dropping 0.02s.
      2011/04/04 19:23:55 [src_4565:3] Buffer overrun: Dropping 0.02s.
      <...>
      2011/04/04 19:32:33 [src_4565:3] Buffer overrun: Dropping 0.02s.
      2011/04/04 19:32:33 [src_4565:3] Buffer overrun: Dropping 0.02s.
      2011/04/04 19:32:33 [src_4565:3] Buffer overrun: Dropping 0.02s.
      2011/04/04 19:32:33 [src_4565:3] Buffer overrun: Dropping 0.02s.
      2011/04/04 19:32:33 [src_4565:2] Feeding stopped: Ogg.Not_enough_data.
      2011/04/04 19:32:35 [src_4565:4] Connecting to <http://radiovkontakte.ru:9000/rvk.ogg>...
      2011/04/04 19:32:35 [src_4565:4] Could not get file: File Not Found
      2011/04/04 19:32:35 [src_4565:4] Connection failed: Http_source.Internal
      2011/04/04 19:32:37 [src_4565:4] Connecting to <http://radiovkontakte.ru:9000/rvk.ogg>...
      2011/04/04 19:32:38 [src_4565:4] Trying playlist parser for mime application/ogg
      2011/04/04 19:32:38 [src_4565:4] Content-type "application/ogg".
      2011/04/04 19:32:38 [decoder:4] Trying method "MP3/LIBMAD" for "application/ogg"...
      2011/04/04 19:32:38 [decoder:4] Trying method "OGG" for "application/ogg"...
      2011/04/04 19:32:38 [decoder:3] Method "OGG" accepted "application/ogg".
      2011/04/04 19:32:38 [src_4565:3] Decoding...
      2011/04/04 19:32:38 [ogg.demuxer:5] Found a ogg logical stream, serial: 6b8b4567
      2011/04/04 19:32:38 [ogg.demuxer:5] Trying ogg/flac format
      2011/04/04 19:32:38 [ogg.demuxer:5] Trying ogg/theora format
      2011/04/04 19:32:38 [ogg.demuxer:5] Trying ogg/vorbis format
      2011/04/04 19:32:38 [ogg.demuxer:5] ogg/vorbis format detected for stream 6b8b4567
      2011/04/04 19:32:38 [src_4565:3] Buffer overrun: Dropping 0.02s.
      2011/04/04 19:32:38 [src_4565:3] Buffer overrun: Dropping 0.02s.
      <...>
      2011/04/04 19:34:37 [src_4565:3] Buffer overrun: Dropping 0.02s.
      2011/04/04 19:34:37 [src_4565:3] Buffer overrun: Dropping 0.02s.
      2011/04/04 19:37:28 >>> LOG START

        Activity

        Hide
        Romain Beauxis
        added a comment -
        Ok, in fact you can get a full backtrace when compiling with --enable-debugging:

        2011/04/10 16:57:06 [threads:1] Thread "wallclock_main" failed: Unknown encoding "CP-1251"!!
        2011/04/10 16:57:06 [threads:3] Raised at file "pervasives.ml", line 22, characters 22-33
        2011/04/10 16:57:06 [threads:3] Called from file "list.ml", line 57, characters 20-23
        2011/04/10 16:57:06 [threads:3] Called from file "configure.ml", line 43, characters 39-66
        2011/04/10 16:57:06 [threads:3] Called from file "configure.ml", line 53, characters 16-31
        2011/04/10 16:57:06 [threads:3] Called from file "outputs/icecast2.ml", line 349, characters 42-45
        2011/04/10 16:57:06 [threads:3] Called from file "array.ml", line 122, characters 21-40
        2011/04/10 16:57:06 [threads:3] Called from file "outputs/icecast2.ml", line 349, characters 14-49
        2011/04/10 16:57:06 [threads:3] Called from file "outputs/output.ml", line 247, characters 24-77
        2011/04/10 16:57:06 [threads:3] Called from file "outputs/output.ml", line 258, characters 35-47
        2011/04/10 16:57:06 [threads:3] Called from file "outputs/output.ml", line 174, characters 6-27
        2011/04/10 16:57:06 [threads:3] Called from file "list.ml", line 69, characters 12-15
        2011/04/10 16:57:06 [threads:3] Called from file "clock.ml", line 131, characters 6-43
        2011/04/10 16:57:06 [threads:3] Called from file "clock.ml", line 307, characters 10-24
        2011/04/10 16:57:06 [threads:3] Called from file "clock.ml", line 310, characters 8-15
        2011/04/10 16:57:06 [threads:3] Called from file "tools/tutils.ml", line 136, characters 15-18

        However, I still do not know how to fix the bug.. :-)
        Show
        Romain Beauxis
        added a comment - Ok, in fact you can get a full backtrace when compiling with --enable-debugging: 2011/04/10 16:57:06 [threads:1] Thread "wallclock_main" failed: Unknown encoding "CP-1251"!! 2011/04/10 16:57:06 [threads:3] Raised at file "pervasives.ml", line 22, characters 22-33 2011/04/10 16:57:06 [threads:3] Called from file "list.ml", line 57, characters 20-23 2011/04/10 16:57:06 [threads:3] Called from file "configure.ml", line 43, characters 39-66 2011/04/10 16:57:06 [threads:3] Called from file "configure.ml", line 53, characters 16-31 2011/04/10 16:57:06 [threads:3] Called from file "outputs/icecast2.ml", line 349, characters 42-45 2011/04/10 16:57:06 [threads:3] Called from file "array.ml", line 122, characters 21-40 2011/04/10 16:57:06 [threads:3] Called from file "outputs/icecast2.ml", line 349, characters 14-49 2011/04/10 16:57:06 [threads:3] Called from file "outputs/output.ml", line 247, characters 24-77 2011/04/10 16:57:06 [threads:3] Called from file "outputs/output.ml", line 258, characters 35-47 2011/04/10 16:57:06 [threads:3] Called from file "outputs/output.ml", line 174, characters 6-27 2011/04/10 16:57:06 [threads:3] Called from file "list.ml", line 69, characters 12-15 2011/04/10 16:57:06 [threads:3] Called from file "clock.ml", line 131, characters 6-43 2011/04/10 16:57:06 [threads:3] Called from file "clock.ml", line 307, characters 10-24 2011/04/10 16:57:06 [threads:3] Called from file "clock.ml", line 310, characters 8-15 2011/04/10 16:57:06 [threads:3] Called from file "tools/tutils.ml", line 136, characters 15-18 However, I still do not know how to fix the bug.. :-)
        Hide
        Romeo
        added a comment -
        I have an idea how to do that.

        If you can check in "configure.ml" if encoding name is available, then you simply use provided one if it is, or the default one (say, utf-8) if not.

        if you cannot check the availability, then you can use try-catch block and make test metadata recoding before real encoding. if Exception is rised then use default encoding.

        i think it's better to do that in "configure.ml"

        you already try to verify if encoding is set by

        let in_enc =
            match in_enc with
              | Some e -> enc_of_name e
              | None -> get_encoding ()
          in
          let out_enc =
            match out_enc with
              | Some e -> enc_of_name e
              | None -> C.utf8

        but if it is not supported by camomile you got an exception that is not catched in

        try C.recode_string ~in_enc ~out_enc s with e ->
              let in_enc =
                if in_enc == get_encoding () then
                  Printf.sprintf "auto(%s)" (String.concat "," conf_encoding#get)
                else
                  C.name_of in_enc
              in
              camolog#f 3 "Failed to convert %S from %s to %s (%s)!"
                s in_enc (C.name_of out_enc) (Printexc.to_string e) ;
              s

        If i know OCaml i'll fix it myself, but i just can understand only the main idea of what's written here.

        by the way, i didn't find the way to set the "out_enc" variable. It's always Latin-bla-bla-bla...
        Show
        Romeo
        added a comment - I have an idea how to do that. If you can check in "configure.ml" if encoding name is available, then you simply use provided one if it is, or the default one (say, utf-8) if not. if you cannot check the availability, then you can use try-catch block and make test metadata recoding before real encoding. if Exception is rised then use default encoding. i think it's better to do that in "configure.ml" you already try to verify if encoding is set by let in_enc =     match in_enc with       | Some e -> enc_of_name e       | None -> get_encoding ()   in   let out_enc =     match out_enc with       | Some e -> enc_of_name e       | None -> C.utf8 but if it is not supported by camomile you got an exception that is not catched in try C.recode_string ~in_enc ~out_enc s with e ->       let in_enc =         if in_enc == get_encoding () then           Printf.sprintf "auto(%s)" (String.concat "," conf_encoding#get)         else           C.name_of in_enc       in       camolog#f 3 "Failed to convert %S from %s to %s (%s)!"         s in_enc (C.name_of out_enc) (Printexc.to_string e) ;       s If i know OCaml i'll fix it myself, but i just can understand only the main idea of what's written here. by the way, i didn't find the way to set the "out_enc" variable. It's always Latin-bla-bla-bla...
        Hide
        Romain Beauxis
        added a comment -
        Ok, I have spoted one case and just pushed a branch with a possible fix.

        The issue can be reproduced with the following code:
           output.icecast(id="foo",%vorbis,mount="foo",input.http(id="bar","http://foo/bar"),fallible=true)
        provided you do _not_ have an icecast server running, you get:

        2011/04/17 21:06:18 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
        2011/04/17 21:06:18 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
        2011/04/17 21:06:18 [frame:3] Targetting 'frame.duration': 0,04s = 1764 audio samples = 1764 ticks.
        2011/04/17 21:06:18 [frame:3] Frames last 0,04s = 1764 audio samples = 1 video samples = 1764 ticks.
        2011/04/17 21:06:18 [video.converter:4] Using preferred video converter: gavl.
        2011/04/17 21:06:18 [audio.converter:4] Couldn't find preferred samplerate converter: libsamplerate.
        2011/04/17 21:06:18 [audio.converter:4] Using native samplerate converter
        2011/04/17 21:06:18 [threads:3] Created thread "generic queue #1".
        2011/04/17 21:06:18 [clock:4] Currently 1 clocks allocated.
        2011/04/17 21:06:18 [clock.wallclock_main:4] Starting 1 sources...
        2011/04/17 21:06:18 [source:4] Source foo gets up.
        2011/04/17 21:06:18 [source:4] Source bar gets up.
        2011/04/17 21:06:18 [threads:3] Created thread "http polling" (1 total).
        2011/04/17 21:06:18 [bar:4] Activations changed: static=[foo:foo], dynamic=[].
        2011/04/17 21:06:18 [foo:4] Activations changed: static=[foo], dynamic=[].
        2011/04/17 21:06:18 [foo:4] Enabling caching mode: active source.
        2011/04/17 21:06:18 [foo:3] Connecting mount foo for source@localhost...
        2011/04/17 21:06:18 [bar:4] Connecting to <http://foo:80/bar>...
        2011/04/17 21:06:18 [foo:2] Connection failed: could not connect to host: Connexion refusée in connect()!
        2011/04/17 21:06:18 [clock.wallclock_main:2] Error when starting output foo: Tutils.Exit!
        2011/04/17 21:06:18 [foo:4] Activations changed: static=[], dynamic=[].
        2011/04/17 21:06:18 [source:4] Source foo gets down.
        2011/04/17 21:06:18 [bar:4] Activations changed: static=[], dynamic=[].
        2011/04/17 21:06:18 [source:4] Source bar gets down.
        init: exception encountered during main phase:
          Tutils.Exit
        2011/04/17 21:06:18 [bar:4] Connection failed: Http: error while communicating to socket!
        2011/04/17 21:06:18 [threads:3] Thread "http polling" terminated (0 remaining).
        exception: Tutils.Exit
        Raised at file "outputs/icecast2.ml", line 460, characters 38-49
        Called from file "tools/start_stop.ml", line 102, characters 6-16
        Called from file "clock.ml", line 176, characters 19-37
        Re-raised at file "clock.ml", line 188, characters 29-30
        Called from file "list.ml", line 57, characters 20-23
        Called from file "clock.ml", line 172, characters 6-767
        Called from file "clock.ml", line 326, characters 8-12
        Called from file "list.ml", line 69, characters 12-15
        Called from file "clock.ml", line 473, characters 6-40
        Called from file "main.ml", line 513, characters 4-18
        Called from file "dtools.ml", line 531, characters 16-20
        2011/04/17 21:06:19 [main:3] Shutdown started!
        2011/04/17 21:06:19 [main:3] Waiting for threads to terminate...
        2011/04/17 21:06:19 [main:3] Cleaning downloaded files...
        2011/04/17 21:06:19 >>> LOG END

        Without the commited branch, the exception is not catched and the source is not stopped, which in turns does not stop the http_polling thread, which leads to a livelock while waiting for thread to finish..
        Show
        Romain Beauxis
        added a comment - Ok, I have spoted one case and just pushed a branch with a possible fix. The issue can be reproduced with the following code:    output.icecast(id="foo",%vorbis,mount="foo",input.http(id="bar"," http://foo/bar "),fallible=true) provided you do _not_ have an icecast server running, you get: 2011/04/17 21:06:18 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master. 2011/04/17 21:06:18 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples. 2011/04/17 21:06:18 [frame:3] Targetting 'frame.duration': 0,04s = 1764 audio samples = 1764 ticks. 2011/04/17 21:06:18 [frame:3] Frames last 0,04s = 1764 audio samples = 1 video samples = 1764 ticks. 2011/04/17 21:06:18 [video.converter:4] Using preferred video converter: gavl. 2011/04/17 21:06:18 [audio.converter:4] Couldn't find preferred samplerate converter: libsamplerate. 2011/04/17 21:06:18 [audio.converter:4] Using native samplerate converter 2011/04/17 21:06:18 [threads:3] Created thread "generic queue #1". 2011/04/17 21:06:18 [clock:4] Currently 1 clocks allocated. 2011/04/17 21:06:18 [clock.wallclock_main:4] Starting 1 sources... 2011/04/17 21:06:18 [source:4] Source foo gets up. 2011/04/17 21:06:18 [source:4] Source bar gets up. 2011/04/17 21:06:18 [threads:3] Created thread "http polling" (1 total). 2011/04/17 21:06:18 [bar:4] Activations changed: static=[foo:foo], dynamic=[]. 2011/04/17 21:06:18 [foo:4] Activations changed: static=[foo], dynamic=[]. 2011/04/17 21:06:18 [foo:4] Enabling caching mode: active source. 2011/04/17 21:06:18 [foo:3] Connecting mount foo for source@localhost ... 2011/04/17 21:06:18 [bar:4] Connecting to < http://foo:80/bar >... 2011/04/17 21:06:18 [foo:2] Connection failed: could not connect to host: Connexion refusée in connect()! 2011/04/17 21:06:18 [clock.wallclock_main:2] Error when starting output foo: Tutils.Exit! 2011/04/17 21:06:18 [foo:4] Activations changed: static=[], dynamic=[]. 2011/04/17 21:06:18 [source:4] Source foo gets down. 2011/04/17 21:06:18 [bar:4] Activations changed: static=[], dynamic=[]. 2011/04/17 21:06:18 [source:4] Source bar gets down. init: exception encountered during main phase:   Tutils.Exit 2011/04/17 21:06:18 [bar:4] Connection failed: Http: error while communicating to socket! 2011/04/17 21:06:18 [threads:3] Thread "http polling" terminated (0 remaining). exception: Tutils.Exit Raised at file "outputs/icecast2.ml", line 460, characters 38-49 Called from file "tools/start_stop.ml", line 102, characters 6-16 Called from file "clock.ml", line 176, characters 19-37 Re-raised at file "clock.ml", line 188, characters 29-30 Called from file "list.ml", line 57, characters 20-23 Called from file "clock.ml", line 172, characters 6-767 Called from file "clock.ml", line 326, characters 8-12 Called from file "list.ml", line 69, characters 12-15 Called from file "clock.ml", line 473, characters 6-40 Called from file "main.ml", line 513, characters 4-18 Called from file "dtools.ml", line 531, characters 16-20 2011/04/17 21:06:19 [main:3] Shutdown started! 2011/04/17 21:06:19 [main:3] Waiting for threads to terminate... 2011/04/17 21:06:19 [main:3] Cleaning downloaded files... 2011/04/17 21:06:19 >>> LOG END Without the commited branch, the exception is not catched and the source is not stopped, which in turns does not stop the http_polling thread, which leads to a livelock while waiting for thread to finish..
        Hide
        Romain Beauxis
        added a comment -
        Romeo: I have just pushed changes in the default branch to
        catch exception raised when trying to get the input/output
        encoding format. Thanks for raising this issue.

        Concerning out_enc, it is fixed by the sources. For instance,
        output.icecast and output.harbor have an encoding parameter.
        Show
        Romain Beauxis
        added a comment - Romeo: I have just pushed changes in the default branch to catch exception raised when trying to get the input/output encoding format. Thanks for raising this issue. Concerning out_enc, it is fixed by the sources. For instance, output.icecast and output.harbor have an encoding parameter.
        Hide
        Romain Beauxis
        added a comment -
        Fixed in hg commit 496abed937d5
        Show
        Romain Beauxis
        added a comment - Fixed in hg commit 496abed937d5

          People

          • Assignee:
            Romain Beauxis
            Reporter:
            Romeo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: