Bug 510525

Summary: kio_http_cache_cleaner is stealing and hanging on accessing digital TV tuner files
Product: [Frameworks and Libraries] frameworks-kio Reporter: jujjyl
Component: HTTPAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description jujjyl 2025-10-12 12:59:01 UTC
I have Linux Mint 22 Cinnamon installation set up as a dedicated digital TV recorder.

This whole system runs just a Python script that looks at TV program guide, and tunes and launches DVB-T recording. (dvbv5-zap to tune, and ffmpeg to record).

The digital TV recorder hardware (the video stream) is accessed as by opening a file `/dev/dvb/adapter<num>/frontend0`.

That file is exclusive, so only one process can open it for reading at a time. Attempting to open the file twice concurrently will yield a `Device or resource busy` error.

The system has worked well for a days, sometimes weeks at a time. But then after some days of uptime, the recorder hangs in these `Device or resource busy` errors, unable to record anything.

When debugging, the TV recorder is unable to proceed because the file `/dev/dvb/adapter<num>/frontend0` is already in use.

Troubleshooting, it looks like it is the executable `kio_http_cache_cleaner` that has opened the digital TV recorder device, preventing my digital TV recorder script from opening the file:

```
$ sudo fuser -v /dev/dvb/adapter2/*
                     USER        PID ACCESS COMMAND
/dev/dvb/adapter2/frontend0:
                     clb       1805289 F.... kio_http_cache_
$ lsof /dev/dvb/adapter2/*
COMMAND       PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
kio_http_ 1805289  clb   44u   CHR  212,8      0t0 1358 /dev/dvb/adapter2/frontend0
$ ps -p 1805289 -o pid,ppid,uid,gid,cmd,etime
    PID    PPID   UID   GID CMD                             ELAPSED
1805289       1  1000  1000 /usr/lib/x86_64-linux-gnu/l  3-01:09:20
```

Force-killing with `pkill -f kio_http_cache_cleaner` resolves this situation, and the digital TV recorder is able to continue again.

It seems like a bug of `kio_http_cache_cleaner` that it would ever attempt to open these digital TV recorder files.

Further, when `kio_http_cache_cleaner` does so, it seems to get permanently stuck on them. I.e. it is not just temporarily opening and closing these, but it seems to steal/hang these file descriptors indefinitely.

Should `kio_http_cache_cleaner` blacklist itself from attempting to access anything under `/dev/`? Or under `/dev/dvb/`?