Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 190928

Summary: media-tv/mythtv-0.20.2_p14357 won't start unless UPnP disabled.
Product: Gentoo Linux Reporter: drumz <paul>
Component: Current packagesAssignee: Doug Goldstein (RETIRED) <cardoe>
Status: RESOLVED NEEDINFO    
Severity: normal CC: media-tv
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description drumz 2007-08-31 23:21:40 UTC
As soon as I upgraded to the first mythtv-0.20.2 version, I was unable to start the backend without disabling UPnP.  The other minor releases Gentoo has had since the first release show the same behavior.

What happens is the backend starts, but fails to open the normal mythtv port (6543) and jumps to 100% CPU utilization immediately.

Looking into the logs shows the following:

2007-08-29 17:37:42.949 UPnp::Initialize - Begin
2007-08-29 17:37:42.951 UPnp::Initialize - Starting TaskQueue
2007-08-29 17:37:42.958 UPnp::Initialize - Creating SSDP Thread
2007-08-29 17:37:42.968 UPnp::Initialize - End
2007-08-29 17:37:42.973 MediaServer::Loading UPnp Description
2007-08-29 17:37:42.974 MediaServer::Registering MythXML Service.
2007-08-29 17:37:42.983 MediaServer::Registering MSRR Service.
2007-08-29 17:37:42.984 MediaServer::Registering CMGR Service.
2007-08-29 17:37:42.986 MediaServer::Registering CDS Service.
2007-08-29 17:37:42.987 MediaServer::Registering UPnpCDSTv Extension
2007-08-29 17:37:42.989 MediaServer::Registering UPnpCDSMusic Extension
2007-08-29 17:37:42.991 MediaServer::Registering UPnpCDSVideo Extension
2007-08-29 17:37:42.998 UPnp::UPnp:Starting SSDP Thread (Multicast)
ASSERT: "i <= nodes" in /usr/qt/3/include/qvaluelist.h (373)

This all happens if I use the /etc/init.d/mythtv startup script, which launches the process as the 'mythtv' user.  If I run the same exact command executed as the 'mythtv' user as root it works fine.

If I modify the /etc/init.d/mythtv script to include the '-noupnp' option then the script will work.

Reproducible: Always

Steps to Reproduce:
1.Emerge the latest version of mythtv (mythtv-0.20.2_p14357)
2.Use /etc/init.d/mythtv startup script to start it.
3.

Actual Results:  
Backend launches, jumps to 100% CPU utilization and fails to open the normal mythtv port (6543).  A log message is generated but really doesn't give any particular definitive clue as to the cause of the problem.

Starting the backend using the startup script and adding the '-noupnp' option makes it work.  You can also get it to run as the root user without the '-noupnp' option.

Expected Results:  
I would expect mythtv (which has been running fine for me for a few years) to run fine after the upgrade to the 0.20.2 series.

This is on an AMD64 box running as 64bit system.

emerge -pv mythtv

These are the packages that would be merged, in order:

Calculating dependencies     ... done!
[ebuild   R   ] media-tv/mythtv-0.20.2_p14357  USE="alsa dts dvb dvd jack mmx opengl perl vorbis (-altivec) -autostart -backendonly -crciprec -dbox2 -debug -directv -freebox -frontendonly -hdhomerun -ieee1394 -ivtv -joystick -lcd -lirc -xvmc" VIDEO_CARDS="nvidia -i810 -via" 0 kB


emerge info
*** Deprecated use of action 'info', use '--info' instead
Portage 2.1.2.12 (default-linux/amd64/2007.0/desktop, gcc-4.1.2, glibc-2.5-r4, 2.6.19-gentoo-r5 x86_64)
=================================================================
System uname: 2.6.19-gentoo-r5 x86_64 AMD Opteron(tm) Processor 244
Gentoo Base System release 1.12.9
Timestamp of tree: Fri, 31 Aug 2007 05:00:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe "
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=k8 -O2 -pipe "
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="candy distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acl acpi alsa amd64 apache2 arts asf avi berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt cups cvs dbus dga divx4linux doc dri dts dv dvb dvd dvdr dvdread eds emboss encode esd ethereal evo faad fam firefox flac foomaticdb fortran gd gdbm gif gnome gnutls gphoto2 gpm gstreamer gtk gtk2 gtkhtml hal iconv imagemagick imap innodb ipv6 isdnlog jack java jpeg kde kdexdeltas kerberos ldap live mad mailwrapper mat mbox midi mikmod mmx mmx2 mozilla mp3 mpeg mudflap mysql mythtv nas ncurses nls nptl nptlonly nsplugin nvidia oci8 odbc ogg oggvorbis opengl openmp oss pam pcre pdf pdflib perl php png posix postgres ppds pppd python qt qt3 qt3support qt4 quicktime readline reflection roska rtc samba sasl scanner sdl session snmp spell spl sql sse sse2 ssl subversion svg tcltk tcpd theora tiff truetype truetype-fonts type1-fonts unicode usb v4l vorbis wxwindows xanim xine xml xml2 xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="nvidia nv"
Unset:  CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2007-09-04 16:13:25 UTC
works for me.... do you have any UPnP devices on your network? maybe even stuff you're not aware of? i.e. xbox? ps3?
Comment 2 drumz 2007-09-04 21:45:49 UTC
Thanks for the posting.

I shutdown myth on my box, re-edited the startup script and removed the '--noupnp' option.  Running tcpdump in a different terminal window, I re-started myth.  No packets left/received from the box and it showed the same behavior - 100% CPU utilization, error in the log file and not opening the normal myth port (6543).

I also nmap'd the few other items on my home network.  From what I've found on the net UPnP operates over UDP/1900 and TCP/5000.  Nothing on my network has those ports open.

Based on the above, I think (I'm not up on UPnP behavior) that rules out any type of conflict with something else on my network.  Especially since I didn't see any packets leave my myth box.

I also did a netstat on my myth server and ports 1900 and 5000 are not in use by anything else already....

Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2007-11-20 14:16:30 UTC
Honestly, running MythTV without disabling UPnP works just fine for me. I personally even use it some times with djmount. I know one other guy at my office that uses it to multiple players at his house. I know beandog and a few others in the IRC channel can run MythTV without having the disable UPnP.

The only real way to trace this is going to be using strace to see where it's locking up.
Comment 4 drumz 2007-11-20 14:29:37 UTC
I just tested it again (without the '-noupnp' in the startup script) and it's still showing the same behavior for me - it starts up, hits mysql like it should then chews up 100% of the CPU.  Disable UPnP and all is well.

After Thanksgiving I'll give strace a shot and see if I can find anything additional to provide that might give a clue as to what's going on.
Comment 5 drumz 2007-11-25 19:32:08 UTC
If I add strace to the /etc/init.d/ startup script for myth, it doesn't show the problem.

If I start it up and then attach to it later while it's consuming a CPU, strace doesn't show any output.
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2008-06-02 15:07:41 UTC
Have you mentioned any of this on the upstream MLs or bug trackers? Because I simply can't reproduce this. People with MythTV at my office can't reproduce and people in #gentoo-mythtv can't reproduce. Unless there's some way to reproduce or additional debugging data, there's no way this can be addressed.
Comment 7 drumz 2008-06-02 20:56:18 UTC
I just verified that I'm still seeing the same problem.  As long as the '--noupnp' option is provided, everything works fine, otherwise it chews up the CPU.

I can live with the solution I found, but I'd really like to get to the core of the problem.  So unless someone can tell me what additional logging/testing I can do I've tried everything that's been suggested (strace).

I haven't tried posting anything up stream, guess that's the only option left at this point.