Difference between revisions of "Debugging"

From MythTV Official Wiki
Jump to: navigation, search
(Debugging with Ubuntu packages)
Line 28: Line 28:
  
 
1) Install the 'mythtv-dbg' and/or 'mythplugins-dbg' packages to add debugging symbols to your system.
 
1) Install the 'mythtv-dbg' and/or 'mythplugins-dbg' packages to add debugging symbols to your system.
 +
 +
# apt-get install mythtv-dbg mythplugins-dbg
  
 
2) Install the apport-retrace tool so you can locally run a backtrace on a core dump.
 
2) Install the apport-retrace tool so you can locally run a backtrace on a core dump.
 +
 +
# apt-get install apport-retrace
  
 
3) Modify /etc/default/apport to set "enabled" to 1
 
3) Modify /etc/default/apport to set "enabled" to 1
Line 39: Line 43:
 
6) Run the apport-retrace tool on the crash file in /var/crash/
 
6) Run the apport-retrace tool on the crash file in /var/crash/
  
#apport-retrace /var/crash/REPORT
+
# apport-retrace /var/crash/REPORT
  
 
7) File a bug using the apport-bug tool now
 
7) File a bug using the apport-bug tool now
  
#apport-bug /var/crash/REPORT
+
# apport-bug /var/crash/REPORT
 
 
  
 
=== Debugging with Gentoo ebuilds ===
 
=== Debugging with Gentoo ebuilds ===

Revision as of 22:33, 28 November 2009

Debugging MythTV

If any of your MythTV programs crash (segfault), you must generate a proper backtrace before submitting a new bug report. Please also see the Ticket HOWTO for more information before submitting a bug report.

Debugging source-based installs

Section 22.2 of the MythTV Documentation, linked from the MythTV website provides details of debugging source-based installs.

Note, also, that in addition to --compile-type=debug, the MythTV configure script now supports an option, --compile-type=profile. In many cases, a profile build will be acceptable for creating backtraces. The main difference between the debug and profile builds is that the debug build disables optimizations. Therefore, a debug build may perform significantly worse than a profile build. If you need to run MythTV under gdb for a long time, it may be worthwhile to run a profile build. If, however, a developer asks you to re-create the backtrace using a debug build, please do so without argument as some portions of the code can only be reliably debugged with a debug build. However, if your system is sufficiently powerful to run a debug build, you may want to start with that so you can be certain the backtrace will be useful.

Debugging package-based installs

Note that rather than recompiling to perform the debugging, you may be able to use "debug" packages provided by your packagers. Debug packages simply install the debugging symbols for the already-installed packages you're using, meaning you do not have to uninstall or reinstall MythTV. Often using the debug packages requires enabling a special repo that contains the debug packages.

Debugging with ATrpms packages

yum --enablerepo=\*-debuginfo install mythtv-debuginfo

Debugging with RPM Fusion packages

yum --enablerepo=\*-debuginfo install mythtv-debuginfo

Debugging with Ubuntu packages

Although it's possible to debug with the packages in the Ubuntu archive, it is first recommended that you enable the Mythbuntu autobuilds packages and make sure that the issue is occurring with them. These are built from the latest upstream svn snapshots of either -fixes or -trunk, whichever you choose. You can enable autobuilds at http://mythbuntu.org/auto-builds .

If you can still reproduce the problem with the latest autobuilds packages, please follow these steps to grab everything necessary for a bug report:

1) Install the 'mythtv-dbg' and/or 'mythplugins-dbg' packages to add debugging symbols to your system.

# apt-get install mythtv-dbg mythplugins-dbg

2) Install the apport-retrace tool so you can locally run a backtrace on a core dump.

# apt-get install apport-retrace

3) Modify /etc/default/apport to set "enabled" to 1

4) Start the apport service. "sudo start apport"

5) When your crash happens, it will ask you to submit a bug report. Don't submit one yet, it won't contain the necessary symbols.

6) Run the apport-retrace tool on the crash file in /var/crash/

# apport-retrace /var/crash/REPORT

7) File a bug using the apport-bug tool now

# apport-bug /var/crash/REPORT

Debugging with Gentoo ebuilds

Rebuild with debugging symbols intact

for package in `equery l -i myth | awk "{print $3}" | tail -n+2`
do
 USE="debug" && FEATURES="splitdebug" && emerge --oneshot =$package
done

Keywords:

* backtrace
* segfault
* tracepoint