Opened 12 years ago

Closed 11 years ago

#4768 closed defect (duplicate)

After 16233, channel change to new input segfaults backend

Reported by: Mark Buechler <Mark.Buechler@…> Owned by: Isaac Richards
Priority: minor Milestone: 0.22
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This happens very reliably. Two sets of backtraces and backend logs attached. The backtraces don't make any sense to me.

Attachments (8)

bt.log (26.7 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backtrace 1
backend.log (26.7 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backend 1
bt2.txt (32.7 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backtrace 2
backend2.txt (18.2 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backend 2
backend3.txt (27.0 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backend 3
bt3.txt (32.0 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backtrace 3
backend4.txt (65.2 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backend 4
bt4.txt (26.1 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backtrace 4

Download all attachments as: .zip

Change History (20)

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: bt.log added

Backtrace 1

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: backend.log added

Backend 1

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: bt2.txt added

Backtrace 2

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: backend2.txt added

Backend 2

comment:1 Changed 12 years ago by danielk

(In [16236]) Refs #4768. Fix some QString usage in SignalMonitorValue?.

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: backend3.txt added

Backend 3

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: bt3.txt added

Backtrace 3

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: backend4.txt added

Backend 4

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: bt4.txt added

Backtrace 4

comment:2 Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

After more investigation, this issue appears to be a race condition. By adding an extra VERBOSE within mythevent, I'm unable to make it fail. I don't know that valgrind will catch this, but admittedly, I'm not well versed in valgrind.

comment:3 Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Daniel, can we change that QDeepCopy<QStringList> to:

QStringList list = lextradata; QStringList::Iterator it; for (it = list.begin(); it != list.end(); ++it)

extradata << QDeepCopy<QString>(*it);

To be honest, I have no evidence as to why this should work better than the other and it may very well simply be slowing it down just enough to avoid the race.

comment:4 Changed 12 years ago by danielk

(In [16247]) Refs #4768. Fixes a small memory leak discovered when looking at channel change to new input segfault.

comment:5 Changed 12 years ago by danielk

Mark, I think the problem may actually be somewhere in the overall handling of MythEvents? with extradata. There are only 16 instances in the MythTV code where this type of MythEvent? is used and the signal monitor dispatches by far the greatest number of these events.

The code you posted just slows down the copy a little, adding a usleep() in there would probably have the same effect.

comment:6 Changed 12 years ago by danielk

Resolution: duplicate
Status: newclosed

Hmm, it looks like this is a duplicate of #4168...

comment:7 Changed 12 years ago by danielk

Resolution: duplicate
Status: closednew

not really a duplicate of #4168...

comment:8 Changed 12 years ago by danielk

(In [16382]) Refs #4768. Reverts [16233], [16247]. These didn't fix the segfault Mark was seeing and caused segfaults for others..

comment:9 Changed 12 years ago by danielk

Milestone: unknown0.22

Moving to 0.22, my stop-gap fixes appear to have just made the problem worse, we need to address the QString is not thread-safe problem with a more comprehensive solution.

comment:10 Changed 11 years ago by stuartm

Status: newinfoneeded_new

Is this this an issue in current trunk?

comment:11 Changed 11 years ago by Mark Buechler <Mark.Buechler@…>

Well, it was an issue with QString/QStringList not being thread safe, I believe. Last I looked, there was a ticket in trunk to come up with a new MString class to work around the issue.

  • Mark.

comment:12 Changed 11 years ago by stuartm

Resolution: duplicate
Status: infoneeded_newclosed

Duplicate of #5311

Note: See TracTickets for help on using tickets.