Project

General

Profile

Bug #2816

crashes in queue

Added by Ben Kibbey over 9 years ago. Updated over 9 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
Crashes
Target version:
-
Start date:
2015-05-02
Due date:
% Done:

100%

Estimated time:
Found in version:
master
Affected Versions:

Description

I've been experiencing queue related crashes since commit 2dfc27 up until master but at different locations. I'm running Debian "testing" but there haven't been any changes to sys/queue.h as far as I could see. I've tried hunting the bug down but no luck. Here's the backtrace from master:

May 2 17:09:55 localhost tvheadend8788: CRASH: Register dump [23]: 000000000000000300007fee0319e9fa00007fee034f54600000000000000000000000000000000200000000004d20fb0000000000000002000000000000002c000000000000000000007fee034f663800000000000000000000000001b3b7400000000001b3b7400000000001b3b74000007fee034f662000007ffd04cb4a000000000000438f18000000000001020600000000000000330000000000000004000000000000000efffffffe7ffbfa170000000000000008
May 2 17:09:55 localhost tvheadend8788: CRASH: STACKTRACE
May 2 17:09:55 localhost tvheadend8788: CRASH: 0x43e9b6
May 2 17:09:55 localhost tvheadend8788: CRASH: 0x7fee03a148d0
May 2 17:09:55 localhost tvheadend8788: CRASH: 0x438f18 tvheadend/src/htsmsg.c:87
May 2 17:09:55 localhost tvheadend8788: CRASH: 0x439123 tvheadend/src/htsmsg.c:202
May 2 17:09:55 localhost tvheadend8788: CRASH: 0x443f9a tvheadend/src/config.c:1527
May 2 17:09:55 localhost tvheadend8788: CRASH: 0x47e115 tvheadend/src/satip/server.c:605
May 2 17:09:55 localhost tvheadend8788: CRASH: 0x40a7bc tvheadend/src/main.c:1026
May 2 17:09:55 localhost tvheadend8788: CRASH: __libc_start_main+0xf5 (/lib/x86_64-linux-gnu/libc.so.6)
May 2 17:09:55 localhost tvheadend8788: CRASH: 0x40bb58


Files

History

#1

Updated by Jaroslav Kysela over 9 years ago

Could you run tvh in valgrind ?

#2

Updated by Ben Kibbey over 9 years ago

I found the problem. When running with the -u or -g options the log output contains:

2015-05-03 10:12:35.200 [ INFO] main: Log started
2015-05-03 10:12:35.200 [ ALERT] settings: Unable to create dir "/var/lib/tvheadend/.hts/tvheadend": Permission denied
2015-05-03 10:12:35.200 [WARNING] START: failed to create settings directory /var/lib/tvheadend/.hts/tvheadend, settings will not be saved
2015-05-03 10:12:35.225 [WARNING] START: configuration path (null) is not r/w for UID:999 GID:44 [e=Bad address], settings will not be saved

Then tvheadend crashes. The fix is to setuid() before doing the init work. Attached is a patch that works for me.

#3

Updated by Jaroslav Kysela over 9 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|b6095136b3db6c6a735dc30d519690fff9fed5da.

#4

Updated by Jaroslav Kysela over 9 years ago

OK. I found the culprit. The global variable config was not initialized correctly when the config directory cannot be accessed. You patch looks wrong.. Some init parts must be done as root (like binding to network ports bellow 1024).

If you run tvheadend as root, you should prepare the configuration directory with the right permissions before tvh is started otherwise TVH will read the home directory from /etc/passwd and try to create it (which is not the case when you run tvh as a daemon).
Use -c parameter to set the directory path.

Also available in: Atom PDF