savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.4k stars 130 forks source link

Segmentation fault at launch #526

Closed kemar220 closed 6 years ago

kemar220 commented 6 years ago

Hello,

I use Liquidsoap since 4 years it worked perfectly.. Few days earliers i tried an "apt-get upgrade" after many years without any upgrades :(..After my upgrades i got Segmentation Fault everytime after few hours of streaming..

To avoid this problem I installed a brand new server.. On this new serveur i get Segmentation Fault too but directly at launch..

See the log :

radio@SERVER:~/scripts$ ./radio.liq

2018/01/30 19:49:02 >>> LOG START
2018/01/30 19:49:01 [protocols.external:3] Found "/usr/bin/wget".
2018/01/30 19:49:01 [main:3] Liquidsoap 1.1.1
2018/01/30 19:49:01 [main:3] Using: graphics=[distributed with Ocaml] pcre=7.2.3 dtools=0.3.1 duppy=0.5.1 duppy.syntax=0.5.1 cry=0.2.2 mm=0.2.1 xmlplaylist=0.1.3 lastfm=0.3.0 ogg=0.4.5 vorbis=0.6.1 opus=0.1.0 speex=0.2.0 mad=0.4.4 flac=0.1.1 flac.ogg=0.1.1 dynlink=[distributed with Ocaml] lame=0.3.2 shine=0.2.0 gstreamer=0.2.0 frei0r=0.1.0 voaacenc=0.1.0 theora=0.3.0 gavl=0.1.5 bjack=0.1.4 alsa=0.2.1 ao=0.2.0 samplerate=0.1.2 taglib=0.3.1 magic=0.7.3 camomile=0.8.4 inotify=1.0 faad=0.3.2 soundtouch=0.1.7 portaudio=0.2.0 pulseaudio=0.1.2 ladspa=0.1.4 dssi=0.1.1 sdl=0.9.1 camlimages=4.2.0 lo=0.1.0 yojson=1.3.2 gd=1.0a5
2018/01/30 19:49:01 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2018/01/30 19:49:01 [dynamic.loader:3] Could not find dynamic module for aacplus encoder.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/faad.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/frei0r.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ogg.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/oss.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/voaacenc.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/graphics.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/mad.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/portaudio.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/samplerate.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/gd.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/cry.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/camlimages.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/gstreamer.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/alsa.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lo.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/soundtouch.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lame.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/pulseaudio.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/flac_ogg.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ladspa.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/gavl.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/shine.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ao.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/speex.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/dssi.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/flac.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/xmlplaylist.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/sdl.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/bjack.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/vorbis.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lastfm.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/taglib.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/theora.cmxs.
2018/01/30 19:49:01 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/opus.cmxs.
2018/01/30 19:49:02 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2018/01/30 19:49:02 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2018/01/30 19:49:02 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2018/01/30 19:49:02 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2018/01/30 19:49:02 [threads:3] Created thread "generic queue #1".
2018/01/30 19:49:02 [threads:3] Created thread "generic queue #2".
2018/01/30 19:49:02 [threads:3] Created thread "non-blocking queue #1".
2018/01/30 19:49:02 [threads:3] Created thread "non-blocking queue #2".
2018/01/30 19:49:02 [jingles:3] Loading playlist...
2018/01/30 19:49:02 [jingles:3] Playlist is a directory.
2018/01/30 19:49:02 [jingles:3] Successfully loaded a playlist of 7 tracks.
2018/01/30 19:49:02 [random100:3] Loading playlist...
2018/01/30 19:49:02 [random100:3] Playlist is a directory.
2018/01/30 19:49:02 [decoder:3] Method "MAD" accepted "/home/radio/sounds/jingles/yah.mp3".
2018/01/30 19:49:02 [random100:3] Successfully loaded a playlist of 75 tracks.
2018/01/30 19:49:02 [top10:3] Loading playlist...
Segmentation fault

AND MY radio.liq :

radio@SERVER:~/scripts$ cat radio.liq

#!/usr/bin/liquidsoap
set("log.file.path", "/home/radio/logs/log")
set("log.file",true)
set("log.stdout",true)
set("log.level",3)

set("server.telnet",true)

# jingles repository
jingles = playlist ("/home/radio/sounds/jingles")

# music repository
random100 = playlist(mode='randomize',reload=1,reload_mode="rounds", "/home/radio/sounds/random100")
top10 = playlist(mode='randomize',reload=1,reload_mode="rounds", "/home/radio/sounds/top10")
top20 = playlist(mode='randomize',reload=1,reload_mode="rounds", "/home/radio/sounds/top20")
classic40 = playlist(mode='randomize',reload=1,reload_mode="rounds", "/home/radio/sounds/classic40")

# a jingle every 2 songs
default = rotate(weights=[1,1,1,1,1], [jingles, random100, top10, top20, classic40])

# We output the stream to an icecast
# server, in ogg/vorbis format.
output.icecast(%aac(bitrate=128),id="icecast",
               fallible=true,mount="/mystream.aac",
               host="radio.bcast.server.com", password="hack_me",
               default)

Do you know what should I do? Do you need something else?

Power2All commented 6 years ago

Same problem. Seems MAD decoding is crashing Liquidsoap. All works fine with OGG files.

No solution spotted yet here either, also, Liquidsoap 1.3.3 manually installed, but didn't fix anything.

celianvdb commented 6 years ago

Same problem with MAD decoding too. I'm on debian stretch with Liquidsoap 1.1.1

(gdb) run main.liq
Starting program: /usr/bin/liquidsoap main.liq
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffed1b8700 (LWP 15702)]
[New Thread 0x7fffec9b7700 (LWP 15703)]
[New Thread 0x7fffe7fff700 (LWP 15704)]
[New Thread 0x7fffe77fe700 (LWP 15705)]
[New Thread 0x7fffe6ffd700 (LWP 15708)]

Thread 2 "liquidsoap" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffed1b8700 (LWP 15702)]
0x00007ffff0e7f048 in ?? () from /usr/lib/liquidsoap/1.1.1/plugins/mad.cmxs
(gdb) 
celianvdb commented 6 years ago

Working fine for me with Liquidsoap 1.3.3 installed from opam

Power2All commented 6 years ago

Not here. 1.3.3:

root@stream:~/libretime# airtime-liquidsoap
Airtime Liquidsoap
Error: expected an encoding format after %ifencoder!
root@stream:~/libretime#
5chdn commented 6 years ago

Having the same issue with FLAC. Disabling the following encoder allows me to run the script again:

flac = output.icecast(
  %ogg(%flac(
    samplerate=44100,
    channels=2,
    compression=7,
    bits_per_sample=16
)))
hairmare commented 6 years ago

@Power2All Check here for 1.3.x compatibility patch to the LibreTime liquidsoap script: https://github.com/LibreTime/libretime/issues/192.

Power2All commented 6 years ago

Thanks for the heads up @hairmare I am currently re-working out my torrent project, which should be done soon, then I can start working on LibreTime again. Also, I am currently messing around in OctoberCMS, which is a build on top of Laravel. Will check this out, thanks again :)

toots commented 6 years ago

Hi all,

I want to focus on 1.3.4 so I'm gonna close this since it applies to 1.1.1. Hope y'all find a way to update to 1.3.3 or the coming 1.3.4. Thks.