Skip to content

Debugging the Player

avuserow edited this page Sep 2, 2011 · 2 revisions

The Acoustics players should close their STDERR and STDOUT file handles, like all good daemons. This makes it difficult to discover why they crash sometimes. A few suggestions follow:

Check existing logs. You might get lucky.

Make sure you have things set up in general. The remaining steps are intended for when you have crashes in unknown situations or on a new platform or similar.

Next, see if your problem manifests when you run 'acoustics player-start foo --nodaemonize'. If so, try commenting out the call to close STDERR, and if it still happens, you can see any associated error messages.

Use logging constructs. Turns out this doesn't work as well as the following.

Instead of closing STDERR, open it to a file in /tmp or elsewhere. You can then do print-style debugging as much as you want.

Log to syslog. Eventually the core logging code will do this as well.

Ask avuserow if you are doing something that has been known to cause problems, such as: using the "Local" "RPC" system; not being a proper daemon (forgetting to close STD{OUT,IN,ERR}, fork, setsid, or something like that); or otherwise doing something crazy like running under SELinux or on Windows. Note that some of these appear to work fine under certain OSes and settings. avuserow reports differences between versions of the same Linux distro (possibly related to security defaults).

This should handle finding most crashes.

Clone this wiki locally