Bug #3491
Crash from dvr_inotify.c:160 when target directory exists as a dead link
0%
Description
A recording wants to write into a directory that is a dead symbolic link, i.e., the target directory has been deleted.
ln -T -s Marvel_s\ Agents\ of\ S\.H\.I\.E\.L\.D\. Agents\ of\ SHIELD
Now we have an Agents of Field link that is dead. If I code this name as target directory of a recording, a crash happens:
Jan 11 03:04:30 sat tvheadend[1296]: dvr: "Marvel's Agents of S.H.I.E.L.D." on "E4" recorder starting Jan 11 03:04:30 sat tvheadend[1296]: mpegts: 10729V in 28.2E - tuning on STV090x Multistandard : DVB-S #3 Jan 11 03:04:31 sat tvheadend[1296]: capmt: oscam: Starting CAPMT server for service "E4" on adapter 3 Jan 11 03:04:31 sat tvheadend[1296]: subscription: 3212: "DVR: Marvel's Agents of S.H.I.E.L.D." subscribing on channel "E4", weight: 300, adapter: "STV090x Multistandar d : DVB-S #3", network: "28.2E", mux: "10729V", provider: "BSkyB", service: "E4", profile="pass" Jan 11 03:05:00 sat tvheadend[1296]: settings: Unable to create dir "/data/tv/recordings/Agents of SHIELD": File exists Jan 11 03:05:00 sat tvheadend[1296]: dvr: Recording error: "Marvel's Agents of S.H.I.E.L.D.": Unable to create file Jan 11 03:05:00 sat tvheadend[1296]: subscription: 3212: "DVR: Marvel's Agents of S.H.I.E.L.D." unsubscribing from "E4" Jan 11 03:05:00 sat tvheadend[1296]: capmt: oscam: Removing CAPMT Server from service "E4" on adapter 3 Jan 11 03:05:00 sat tvheadend[1296]: CRASH: Signal: 11 in PRG: tvheadend (4.1-1221~g66e5d27) [bb172ac8fe936882860767bee626c087f15c3754] CWD: / Jan 11 03:05:00 sat tvheadend[1296]: CRASH: Fault address (nil) (Address not mapped) Jan 11 03:05:00 sat tvheadend[1296]: CRASH: Loaded libraries: /usr/lib/libdvben50221.so /usr/lib/libdvbapi.so /usr/lib/libucsi.so /lib/x86_64-linux-gnu/libssl.so.1.0.0 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/liburiparser.so.1 /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 /usr/lib/x86_64-linux -gnu/libavahi-client.so.3 /lib/x86_64-linux-gnu/libdbus-1.so.3 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/librt.so.1 /lib/x86_64-linux-gnu/libdl.so.2 / lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/libc.so.6 /lib64/ld-linux-x86-64.so.2 /lib/x86_64-linux-gnu/libnss_compat.so.2 /lib/x86_64-linux-gnu/libnsl.so.1 /l ib/x86_64-linux-gnu/libnss_nis.so.2 /lib/x86_64-linux-gnu/libnss_files.so.2 Jan 11 03:05:00 sat tvheadend[1296]: CRASH: Register dump [23]: 00000000000000000000000000000010fffffffffffff8a200007f9b0db431db0000000000000001000000000000006800000000 000000010000000001de526000007f9abc013dd0000000000050db2800007f9abc013dd000007f9abc013dd000000000000000000000000000000000000000000000001000007f9adbffe8c000000000004ee29a 000000000001020600000000000000330000000000000004000000000000000efffffffe7ffbba110000000000000000 Jan 11 03:05:00 sat tvheadend[1296]: CRASH: STACKTRACE Jan 11 03:05:00 sat tvheadend[1296]: CRASH: /usr/local/src/tvheadend/src/trap.c:148 0x44707c Jan 11 03:05:00 sat tvheadend[1296]: CRASH: ??:0 0x7f9b0e597cb0 Jan 11 03:05:00 sat tvheadend[1296]: CRASH: /usr/local/src/tvheadend/src/dvr/dvr_inotify.c:160 0x4ee29a Jan 11 03:05:00 sat tvheadend[1296]: CRASH: /usr/local/src/tvheadend/src/dvr/dvr_db.c:453 0x47ed6c Jan 11 03:05:00 sat tvheadend[1296]: CRASH: /usr/local/src/tvheadend/src/dvr/dvr_db.c:1795 0x48141b Jan 11 03:05:00 sat tvheadend[1296]: CRASH: /usr/local/src/tvheadend/src/dvr/dvr_rec.c:1146 0x4843b8 Jan 11 03:05:00 sat tvheadend[1296]: CRASH: /usr/local/src/tvheadend/src/dvr/dvr_rec.c:1350 0x485832 Jan 11 03:05:00 sat tvheadend[1296]: CRASH: /usr/local/src/tvheadend/src/wrappers.c:177 0x41712e Jan 11 03:05:00 sat tvheadend[1296]: CRASH: ??:0 0x7f9b0e58fe9a Jan 11 03:05:00 sat kernel: [556942.433203] show_signal_msg: 9 callbacks suppressed Jan 11 03:05:00 sat kernel: [556942.433212] tvh:dvr[8720]: segfault at 0 ip 00000000004ee29a sp 00007f9adbffe8c0 error 4 in tvheadend[400000+197000]
History
Updated by Rob vh almost 9 years ago
I agree with the message "unable to create file" if someone creates a file with the same name as the target directory, they're stupid.
I can understand that the recording is denied with "time missed."
But the crash in inotify should be prevented.
Updated by Jaroslav Kysela almost 9 years ago
Try latest. It looks like a memory corruption - many of them were fixed in last commits. I don't see any issue in the code where tvh crashed.
Updated by Rob vh almost 9 years ago
You are right, with the current version 1351, we get a nice message and no crash:
Jan 11 10:39:30 sat tvheadend[6968]: dvr: "Judge Judy" on "ITV3" recorder starting Jan 11 10:39:30 sat tvheadend[6968]: mpegts: 10906V in 28.2E - tuning on STV090x Multistandard : DVB-S #3 Jan 11 10:39:30 sat tvheadend[6968]: capmt: oscam: Starting CAPMT server for service "ITV3" on adapter 3 Jan 11 10:39:30 sat tvheadend[6968]: subscription: 0017: "DVR: Judge Judy" subscribing on channel "ITV3", weight: 300, adapter: "STV090x Multistandard : DVB-S #3", network: "28.2E", mux: "10906V", provider: "BSkyB", service: "ITV3", profile="pass" Jan 11 10:40:00 sat tvheadend[6968]: settings: Unable to create dir "/data/tv/recordings/Judge Judy": File exists Jan 11 10:40:00 sat tvheadend[6968]: dvr: Recording error: "Judge Judy": Unable to create file Jan 11 10:40:00 sat tvheadend[6968]: subscription: 0017: "DVR: Judge Judy" unsubscribing from "ITV3" Jan 11 10:40:00 sat tvheadend[6968]: capmt: oscam: Removing CAPMT Server from service "ITV3" on adapter 3 Jan 11 10:40:00 sat tvheadend[6968]: dvr: "Judge Judy" on "ITV3": End of program: File not created