Unable to build Tvheadend on fresh OSMC (Kodi17) install

Hi there! I am having some issues building/installing Tvheadend to OSMC using this great tutorial: [Obsolete] Instructions for Viewing Live TV

I was able to fully run through that tutorial under Kodi 16 (and using Tvheadend when I updated it to Kodi 17 went fine), but now when I run it on a clean OSMC install, I get a fatal error. For the record, the (outdated) version included in the App Store never worked for me with my PCTV triplestick 292e.

My device is a Raspberry Pi 3, I am using the latest OSMC build and it is clean, apart from an installation of retrosmc.

After installing “gettext” so ./configure is able to run, and running through all the steps, the “make” command is causing issues. Please find the fatal error below:

Scanning dependencies of target common
make[4]: Leaving directory '/usr/src/tvheadend/build.linux/ffmpeg/x265_2.1/build/linux'
make[4]: Entering directory '/usr/src/tvheadend/build.linux/ffmpeg/x265_2.1/build/linux'
[  1%] Building CXX object common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o
*** Error in `/usr/bin/c++': double free or corruption (top): 0x01e521a8 ***
Aborted
common/CMakeFiles/common.dir/build.make:54: recipe for target 'common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o' failed
make[4]: *** [common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o] Error 134
make[4]: Leaving directory '/usr/src/tvheadend/build.linux/ffmpeg/x265_2.1/build/linux'
CMakeFiles/Makefile2:258: recipe for target 'common/CMakeFiles/common.dir/all' failed
make[3]: *** [common/CMakeFiles/common.dir/all] Error 2
make[3]: Leaving directory '/usr/src/tvheadend/build.linux/ffmpeg/x265_2.1/build/linux'
Makefile:117: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/usr/src/tvheadend/build.linux/ffmpeg/x265_2.1/build/linux'
Makefile.ffmpeg:238: recipe for target '/usr/src/tvheadend/build.linux/ffmpeg/x265_2.1/.tvh_build' failed
make[1]: *** [/usr/src/tvheadend/build.linux/ffmpeg/x265_2.1/.tvh_build] Error 2
make[1]: Leaving directory '/usr/src/tvheadend'
Makefile:756: recipe for target '/usr/src/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libavcodec.a' failed
make: *** [/usr/src/tvheadend/build.linux/ffmpeg/build/ffmpeg/lib/libavcodec.a] Error 2

I am quite the noob, so I do not know what to do now :(. I would appreciate it if you could help!

Are you overclocking ? Do you have a good power supply ?

The C++ compiler crashing is very unusual and probably indicates a hardware issue like overclocking too much, poor power supply or maybe an SD card problem.

1 Like

Thanks for the quick reply! I did not overclock the Pi and everything was working fine prior to the clean install. The power supply is the official one. An SD failure would then seem unlikely to me, but I’ll wipe the card (again). I tried the whole procedure several times already and it always seems to stop at the same moment, with the same error.

Edit: I just realised that as part of retrosmc, a certain part was unavailable from binary, so the Pi had to build it from source, which seemed to work fine. Don’t know if that should tell me anything :).

Unfortunately it still doesn’t work, even when I unplugged the TV tuner and skipped the install of retrosmc. Plain vanilla OSMC and I just can’t build Tvheadend :(. Does anyone else have any clues? Many thanks in advance!

For the sake of completeness (if someone reaches this page via Google :)), it appears there is a bug in the compiler in Tvheadend. When I disabled ffmpeg_static for Autobuild.sh I was able to compile the program. Now to find muxes…