Opened 18 years ago

Closed 18 years ago

#4695 closed defect (fixed)

EIT causes backend crashes

Reported by: anonymous Owned by: Janne Grunau
Priority: minor Milestone: 0.21
Component: mythtv Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: no

Description

When EIT is enable the backend crashes frequently. When disabled, the backend is perfectly stable. Attached are backtraces; during the test nothing else was active (ie. no recordings, no frontend livetv). Ref #4112

Attachments (4)

gdb3.txt (42.8 KB ) - added by anonymous 18 years ago.
gdb backtrace #1
gdb4.txt (38.1 KB ) - added by anonymous 18 years ago.
gdb backtrace 2
gdb5.txt (36.5 KB ) - added by anonymous 18 years ago.
gdb backtrace 3
myth5.log (146.9 KB ) - added by anonymous 18 years ago.
myth log for backtrace #3 (ignore other one)

Download all attachments as: .zip

Change History (12)

by anonymous, 18 years ago

Attachment: gdb3.txt added

gdb backtrace #1

by anonymous, 18 years ago

Attachment: gdb4.txt added

gdb backtrace 2

by anonymous, 18 years ago

Attachment: gdb5.txt added

gdb backtrace 3

by anonymous, 18 years ago

Attachment: myth5.log added

myth log for backtrace #3 (ignore other one)

comment:1 by anonymous, 18 years ago

sorry for confusion, myth5.log is for gdb3.txt. The log for gdb4.txt shows nothing un-usually. For gbd5.txt, there just a few sql errors "No error type from QSqlError? Strange..." when quering from GetOverlappingPrograms

comment:2 by stuartm, 18 years ago

Milestone: unknown0.21

comment:3 by Janne Grunau, 18 years ago

Quoting David <david@…> on the dev ml

The problem is quite subtle and connected to the way Qt caches regular expression engine instances. MythTV creates threads directly using pthread primitives, bypassing Qt's QThread class. This is a problem, because QThread sets up thread local data structures that it expects to be able to use in QRegExp methods. These are uninitialised when the thread is created outside of Qt.

The actual (mis)behaviour caused by this is rather random. QRegExp may decide to create and destroy an engine during each regexp call, in which case everything works OK (if more slowly that it could). At other times threads end up sharing regexp engines and the associated control structures. Sometimes, if two threads execute inside QRegExp simultaneously then heap corruption occurs and the backend crashes.

comment:4 by Janne Grunau, 18 years ago

(In [16189]) Avoid QRegExp when possible. Refs #4695

comment:4 by Janne Grunau, 18 years ago

Owner: changed from Isaac Richards to Janne Grunau
Status: newassigned

comment:6 by Janne Grunau, 18 years ago

(In [16191]) Convert EITScanner pthread from pthread to QThread

From: David <david at unsolicited point net> Fixes a segfault in the EITFixup QRegExps. QRegExp depends on QThreadStorage which can only be used in threads created by QThread.

I'm just converting the EITScanner thread due to the near release date. Other threads using QRegExp should be converted too or maybe not. I have not seen the same warning in the qt 4.3 docs. Refs #4695, Refs #4733

comment:7 by Janne Grunau, 18 years ago

(In [16274]) Merges [16191] from trunk: Convert EITScanner pthread from pthread to QThread

From: David <david at unsolicited point net> Fixes a segfault in the EITFixup QRegExps. QRegExp depends on QThreadStorage which can only be used in threads created by QThread.

I'm just converting the EITScanner thread due to the near release date. Other threads using QRegExp should be converted too or maybe not. I have not seen the same warning in the qt 4.3 docs. Refs #4695, Refs #4733

comment:8 by Janne Grunau, 18 years ago

Resolution: fixed
Status: assignedclosed

fixed by [16274] and [16191]

Note: See TracTickets for help on using tickets.