Opened 9 years ago

Closed 7 days ago

Last modified 2 days ago

#9027 closed defect (Fixed)

[CRASH] BE segfault on start of recording 3 HD programs (HDHR)

Reported by: Dave Alverson <dalverson28@…> Owned by: danielk
Priority: minor Milestone: 31.0
Component: MythTV - HDHomeRun Version: 0.23.1
Severity: medium Keywords:
Cc: Ticket locked: no

Description

My FE/BE was set to record three HD programs starting at 8pm. 2 were on the same multiplex. The BE segfaulted as it was starting. Encoders 1-4 are HDHR, 5-6 are AirStar? HD5000. The input is TWCable. I noticed at 8:35 the 2 tuner lights on the HDHR were off and determined it crashed and restarted the BE and it started recording 3 programs fine. Heres a summary; details in attachments.

Sep 27 20:00:08 dvr kernel: mythbackend[10835]: segfault at c2e54f20 ip 00db417d sp a2e54eb0 error 5 in libmythhdhomerun-0.23.1.so.0.23.1[daf000+d000]

MythTV Version : 25469 MythTV Branch : branches/release-0-23-fixes/mythtv/

Program terminated with signal 11, Segmentation fault.
#0  0x00db417d in hdhomerun_control_recv_sock (cs=0x9a6cfc8, tx_pkt=0x9a6cfe0, rx_pkt=0x9a6dbf4, type=4,
    recv_timeout=5000) at hdhomerun_control.c:217
217                     if (!FD_ISSET(cs->sock, &readfds)) {

(gdb) p cs
$1 = (struct hdhomerun_control_sock_t *) 0x9a6cfc8
(gdb) p readfds
$2 = {fds_bits = {0 <repeats 32 times>}}
(gdb) p *cs
$3 = {desired_device_id = 270163495, desired_device_ip = 0, actual_device_id = 270163495, actual_device_ip =
    3232238345, sock = -1, dbg = 0x0, tx_pkt = {pos = 0x9a6d3ec "", start = 0x9a6d3ec "", end =
    0x9a6d405 "am:537000000", limit = 0x9a6dbee "", buffer =
    '\000' <repeats 1021 times>, "\004\000\021\003\017/tuner0/status\000g\372\022\334am:537000000\000.2\356C0:60134\000\226\215\v\240\060\063\065 0x0110-0x0112 0x1ffb\000\024\360\004\315", '\000' <repeats 1970 times>},
  rx_pkt = {pos = 0x9a6e004 "", start = 0x9a6e004 "", end = 0x9a6e004 "", limit = 0x9a6e802 "", buffer =
    '\000' <repeats 1025 times>, "\005\000.\003\017/tuner0/target\000\004\033rtp://192.168.11.200:60134\000\000\005\000\"\003\020/tuner0/channel\000\004\016qam:537000000\000\061%\036\303\000\005\000O\003\017/tuner0/status\000\004<ch=qam:537000000 lock=qam256 ss=96 snq=99 seq=0 bps=0 pps=0\000\251[\276\267", '\000' <repeats 1870 times>}}

Looks like cs->sock is -1, I think thats the problem.

Attachments (2)

mythbackend-crash.log (31.7 KB) - added by Dave Alverson <dalverson28@…> 9 years ago.
vers+gdb.log (46.8 KB) - added by Dave Alverson <dalverson28@…> 9 years ago.
version info and gdb info from core file

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by Dave Alverson <dalverson28@…>

Attachment: mythbackend-crash.log added

Changed 9 years ago by Dave Alverson <dalverson28@…>

Attachment: vers+gdb.log added

version info and gdb info from core file

comment:1 Changed 9 years ago by robertm

Status: newassigned

Segfault in libhdhomerun, need SiliconDust? to look at this.

comment:2 Changed 9 years ago by Silicondust

Threading bug in mythtv - two threads are trying to use the same hdhomerun_device object.

Recommend creating a second hdhomerun_device object for the second thread.

comment:3 Changed 9 years ago by robertm

Owner: changed from Silicondust to danielk

comment:4 Changed 9 years ago by beirdo

Summary: BE segfault on start of recording 3 HD programs (HDHR)[CRASH] BE segfault on start of recording 3 HD programs (HDHR)

comment:5 Changed 9 years ago by danielk

Resolution: Won't Fix
Status: assignedclosed

I'm not maintaining the HDHR code anymore. If it is a very serious problem I can remove HDHR support, but at this point this appears to be a rare issue.

comment:6 Changed 7 days ago by Klaas de Waal

Resolution: Won't Fix
Status: closednew

comment:7 Changed 7 days ago by Klaas de Waal

Milestone: unknown31.0
Resolution: Fixed
Status: newclosed

The problem is similar but not identical to the problem reported in ticket #13519. The fix for ticket #13519 also includes the fix for this ticket. This ticked is therefore now closed.

comment:8 Changed 2 days ago by Klaas de Waal <kdewaal@…>

In ec2a518f20/mythtv:

Extend instance locking in HDHomeRun stream handler

Extend the instance locking already present in HDHRStreamHandler
functions TunerGet? and TunerSet? to GetTunerStatus?.
This fixes a segfault in libhdhomerun, reported in ticket #13519,
that appeared when doing a UK DVB-T/T2 scan with offset frequencies.
The segfault happened because GetTunerStatus? was called from the
HDHRSignalMonitor in a different thread than the TunerGet/TunerSet? functions.
Extend the instance locking also to the HDHRStreamHandler::run function
where the libhdhomerun functions are called. This should fix the segfault
in the mythbackend startup as reported in ticket #9027.

Refs #9027

Fixes #13519

comment:9 Changed 2 days ago by Klaas de Waal <kdewaal@…>

In a27754ae7/mythtv:

Extend instance locking in HDHomeRun stream handler

Extend the instance locking already present in HDHRStreamHandler
functions TunerGet? and TunerSet? to GetTunerStatus?.
This fixes a segfault in libhdhomerun, reported in ticket #13519,
that appeared when doing a UK DVB-T/T2 scan with offset frequencies.
The segfault happened because GetTunerStatus? was called from the
HDHRSignalMonitor in a different thread than the TunerGet/TunerSet? functions.
Extend the instance locking also to the HDHRStreamHandler::run function
where the libhdhomerun functions are called. This should fix the segfault
in the mythbackend startup as reported in ticket #9027.

Refs #9027

Fixes #13519

(cherry picked from commit ec2a518f20385b06f0fe730fa6f567409f34d50e)
Signed-off-by: Klaas de Waal <kdewaal@…>

Note: See TracTickets for help on using tickets.