Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 147267

Summary: media-video/noad crashes very badly when deleting the recording which is being cut
Product: Gentoo Linux Reporter: Matthias Schwarzott <zzam>
Component: New packagesAssignee: Gentoo VDR Project <vdr>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to add better error-checking for preventing segfault

Description Matthias Schwarzott gentoo-dev 2006-09-12 00:06:41 UTC
A running noad process will crash badly when the recording to be cut is deleted while it runs.
This leads to noad only be killable via "kill -9".
This hanging noad-process will keep vdr from shutting down.

Thus something should be done against. There are several possibilities:
1. Construct a timeout for noad-runs and kill it after 30m or so.
(From the calling shell-script, or from shutdown-script when noad-process is too old).
2a. Implement the timeout directly in noad-executable.
2b. (Better, but more complicated) Find the real cause of the crash.
Comment 1 Matthias Schwarzott gentoo-dev 2006-09-22 06:42:51 UTC
Steps to reproduce the error:
1. Record something, recording should contain multiple files 001.vdr 002.vdr ...
1a. either record something very long
1b. or reduce the max-filesize of recording-files

2. stop the recording/wait for its end.
3. when noad started, delete the recording
4. when noad tries to access the next file it will hang

This is due to bad error-checking in noad.
File cannot be opened => set filenr=-1, the read-command will not check this condition and noad will segfault.

Attached patch will check this condition in read-code-path and kill noad sane (at least I hope so).
Comment 2 Matthias Schwarzott gentoo-dev 2006-09-22 06:43:47 UTC
Created attachment 97749 [details, diff]
patch to add better error-checking for preventing segfault
Comment 3 Matthias Schwarzott gentoo-dev 2006-10-07 04:19:43 UTC
Added patch to ebuild.