Opened 12 years ago

Closed 12 years ago

#2895 closed defect (fixed)

mythbackend CPU temperature code not re-entrant - causes crashes

Reported by: andrew@… Owned by: skamithi
Priority: minor Milestone: 0.21
Component: mythtv Version: 0.20
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The code at around httpstatus.cpp line 2487 uses the lm_sensors library. As this library keeps it's status in a static variable it is not re-entrant and crashes the backend if there are two calls to the http service at the same time.

Attachments (1)

cpu_temp.diff (1.1 KB) - added by skamithi 12 years ago.
add qmutex lock/unlocking around lmsensor calls.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by skamithi

Owner: changed from Isaac Richards to skamithi
Priority: majorminor
Severity: highmedium

Changed 12 years ago by skamithi

Attachment: cpu_temp.diff added

add qmutex lock/unlocking around lmsensor calls.

comment:2 Changed 12 years ago by skamithi

Status: newassigned

andrew, please test patch and let me know of the results.

comment:3 in reply to:  2 Changed 12 years ago by andrew@…

Replying to skamithi:

andrew, please test patch and let me know of the results.

I have built this patch into the atrpms source code for backend version 0.20-149.fc5.at. I have replaced the mythbackend binary on the two slaves and the master server. I am running the system very hard, so it will crash for other reasons. I will report back in a couple of days to see how much of a reduction there has been.

Thanks

comment:4 Changed 12 years ago by skamithi

Milestone: unknown0.21

comment:5 Changed 12 years ago by andrew@…

Yum nightly update automatically updated the servers to 0.20-150 and the problem (of course) started again. Once I had patched and rebuilt the failure rate went down from 2 or 3 times an hour to 3 or 4 times a day.

This patch works a treat. Thanks.

It would be fantastic if it could be folded into the 0.20 release. It is a very small change and it has a huge effect on stability in some circumstances (eg mine).

comment:6 Changed 12 years ago by skamithi

(In [12568]) Refs #2895. fix mythbackend crash cause cpu temp code is not re-entrant.

comment:7 Changed 12 years ago by skamithi

Resolution: fixed
Status: assignedclosed

(In [12569]) Closes #2895. commit to fixes as requested by ticket submitter.

Note: See TracTickets for help on using tickets.