ring buffer overflows -> cDevice::Detach() blockiert...

  • device.c.5.diff ist doch keine Lösung dafür.

    Denn die Ursache ist:
    AttachReceiver() hält den mutexReceiver und stoppt nach AddPid() am cCamSlot-mutex.
    In cCiAdapter::Action() wird der cCamSlot-mutex gehalten, und Detach() stoppt am mutexReceiver.
    => deadlock

    Um das zu lösen, muss man tiefer im VDR-Code drin sein, als ich es bin.
    Möglicherweise muss die ganze mutexReceiver Sache noch mal von Grund auf neu überdacht werden.

    So lange bleibt es bei device.c.4.diff.

  • jrie

    Danke für Deine Mühen.

    Regards
    fnu

    HowTo: APT pinning

    Click for my gear

    [¹] Intel NUC Kit NUC7i5BNH, Akasa Newton S7, 8GB DDR4, WD Black SN700 500GB NVMe, Crucial MX500 2TB, CIR, SAT>IP, Ubuntu LTS 18.04.5, VDR 2.4.1 (15W)
    [²] Intel NUC Kit NUC7i3BNH, 8GB DDR4, WD PC SN520 250GB NVMe, Crucial MX500 1TB, CIR, SAT>IP, Ubuntu LTS 20.04.1, VDR 2.4.1 (13W)
    [³] BQ500, Asrock X470D4U, AMD Ryzen 5 5600, 32GB DDR4 ECC, 2x WDC SN750 512GB, 4x Samsung SSD 4TB, 1x Samsung SSD 8TB, 1x Crucial MX500 500GB, 1x WDC Blue SSD 500GB, Windows Server 2019 Hyper-V (35W)
    [⁴] Jultec JPS0501-12AN, JPS0501-8M2, Octopus Net (DVBS2-8) & openHABian 3.3.0

  • Jo, jedenfalls danke. Mit der v4 konnte ich bei mir keinen Absturz mehr feststellen. Vorher war das bei wildem Rumgezäppe und gleichzeitigem Aufnehmen Stand der Dinge, dass die Mühle sich verabschiedet hat.

    Mein VDR

    Hartware: Gehäuse: Ahanix MCE 302, Mobo: Kontron 986LCD-M/mITX, CPU: Intel Core2 Duo Mobile T7400 2,16GHz, 2GB RAM, SAT: Digital Devices DuoFlex S2 miniPCIe, Graka: ASUS GeForce GT 1030 Silent, 2x4TB + 2x8TB 3,5" WD Red HD, 1x DVD-Brenner Pioneer, Atric IR-Einschalter+Empfänger, FB One-For-All URC-7960, SoundGraph iMON LCD ( MFP5I, 15c2:0038 )
    Weichware: Debian Stretch (x86_64), Kernel 4.15, NVidia v396.54, ffmpeg 3.4.4, VDR 2.4.0 gepatched

    Edited once, last by iNOB (June 22, 2016 at 4:15 PM).

  • ...

    Um das zu lösen, muss man tiefer im VDR-Code drin sein, als ich es bin.
    Möglicherweise muss die ganze mutexReceiver Sache noch mal von Grund auf neu überdacht werden.

    Wenn doch jetzt die Situation von @jfie genau analisiert ist, könnte sich denn da nicht mal der ursprüngliche Author der Sache annehmen? Von wem stammt dieser Code? Bei mir sorgt das fast täglich für einen Hänger da ich praktisch nur die verschlüsselten CH Sender schaue.

    Gruss, Xcoder

    VDR: Zotac ZBOX EN860, 16GB RAM, 2 TB HDD, Debian Bookworm, vdr-2.7.3, softhdcuvid, satip

  • Bis Klaus mal dazu kommt, ist deine einzige Option, die Plugins mit Receivern wegzulassen, also osdteletext, permashift etc.
    Ich bin auch viel auf diesen Sendern, und bei mir knallt es praktisch nie.

  • Seit welcher VDR-Version besteht denn etwa das Problem?

    Bzw. andersherum gefragt:
    Ich bin momentan noch auch 2.0.7, benutze osdteletext und habe keine Probleme.
    Besteht die Gefahr, dass mich das mach einem Update auf 2.2.x erwischt?

    Gruss
    SHF

    Mein (neuer) VDR:

    Software:
    Debian Wheezy mit Kernel 3.14
    VDR 2.0.7 & div. Plugins aus YaVDR-Paketen
    noad 0.8.6

    Hardware:
    MSI C847MS-E33, onboard 2x1,1GHz Sandybridge Celeron 847, 4GiB RAM
    32GB SSD (System), 4TB 3,5" WD-Red HDD (Video)
    TT FF DVB-S 1.5 FullTS-Mod PWM-Vreg-Mod, DVB-Sky 852 Dual DVB-S2
    Das ganze im alten HP Vectra VLi8-Gehäuse versorgt von:
    PicoPSU-160-XT und Meanwell EPP-150 im ATX-NT-Gehäuse

  • Also bei mir ist das in den paar Tagen seit Umstellung des einen Geräts von VDR 2.2.0 auf VDR 2.3.4 nicht mehr aufgetreten.

    Gruß
    Frank

    HowTo: APT pinning

    Click for my gear

    [¹] Intel NUC Kit NUC7i5BNH, Akasa Newton S7, 8GB DDR4, WD Black SN700 500GB NVMe, Crucial MX500 2TB, CIR, SAT>IP, Ubuntu LTS 18.04.5, VDR 2.4.1 (15W)
    [²] Intel NUC Kit NUC7i3BNH, 8GB DDR4, WD PC SN520 250GB NVMe, Crucial MX500 1TB, CIR, SAT>IP, Ubuntu LTS 20.04.1, VDR 2.4.1 (13W)
    [³] BQ500, Asrock X470D4U, AMD Ryzen 5 5600, 32GB DDR4 ECC, 2x WDC SN750 512GB, 4x Samsung SSD 4TB, 1x Samsung SSD 8TB, 1x Crucial MX500 500GB, 1x WDC Blue SSD 500GB, Windows Server 2019 Hyper-V (35W)
    [⁴] Jultec JPS0501-12AN, JPS0501-8M2, Octopus Net (DVBS2-8) & openHABian 3.3.0

  • Hi, after a few weeks I have had the same lock about 3 times.

    I still believe it is related to the above.

    A little investigation:

    Thread one:

    cTransfer::~cTransfer transfer.c:22 = cReceiver::Detach();

    cReceiver::Detach receiver.c:128 = device->Detach(this);

    cDevice::Detach device.c:1822 = camSlot->Assign(NULL); locking cCamslot &mutex !!!!

    cCamSlot::Assign ci.c:2162 = assignedDevice->Detach(caPidReceiver)

    cDevice::Detach device.c:1807 = Lock()

    Thus waiting for device lock

    Thread two:

    cDevice::Action device.c:1678 = Receiver->Receive(b, TS_SIZE);

    This is holding the device lock during "Distribute the packet to all attached receivers:"

    cCaPidReceiver::Receive ci.c:217 = AddEmmPid(EmmPid);

    cReceiver::AddPid receiver.c:49 = device->AddPid(Pid);

    cDevice::AddPid device.c:598 = camSlot->SetPid(Pid, true);

    waiting for cCamslot mutex


    Greetings Rene

  • Hi Rene,

    sorry it's been a while ;-).

    Please take a look at the attached patch.

    I believe the Lock()/Unlock() in cDevice::AttachReceiver() and cDevice::Detach() is superfluous, because the receiver[] list is already protected by mutexReceiver, which is held in both cases. Consequently we need to hold mutexReceiver in cDevice::Action() now, too, but this seems only natural, because now every access to receiver[] is protected only by mutexReceiver, and we totally avoid the deadlock in waiting for the device lock.

    Klaus

  • Hi Klaus,

    Thanks for looking at this.

    I will patch my vdr, and let you know the results.

    However that can take a while, my last lock was about 3 weeks ago :(

    Greetings Rene

  • The question now is, whether it also fixes the initial problem reported in this thread...

    I will check asap. With the osdteletex-plugin the deadlock appeared rather reliable.

    BTW, very nice that this bug is treated now.

    Gruss, Xcoder

    VDR: Zotac ZBOX EN860, 16GB RAM, 2 TB HDD, Debian Bookworm, vdr-2.7.3, softhdcuvid, satip

  • I expirienced the following Issue with the applied patch vdr-2.3.8-fixdevicedetachlock-2.diff:

    During a recording is running:

    New vnsi clients are not able to get the channel list from vnsiserver the first entry is recived then it waits.

    Existings clients a not able to switch channels it waits for a stream.


    The recording keeps running, the programmed end time is not respected anymore.

    VDR needs to get restarted.

    After removing this patch anything is working as it should.

    Gruß RHS

    My system is vdr-2.3.8 with satip live dvbapi and vnsiserver plugins.

  • I have a second Problem with the vdr-2.3.8-fixdevicedetachlock-2 Patch. If I use the patch, the streamdev client on a Rapberry PI can not switch the channel.

    A VDR streamdev client of the same sources on a x86 PC don't has this issue.

    MLD 6.5 mit vdr 2.7 - lirc yaUSBir - 4 x DD-Sat - SCR - Intel N100M - 4GB RAM - WD Green 12TB HDD - 22TB HDD - SanDisk 64GB SSD - Lian Li PC-C37B - Samsung LE40A559
    MLD 6.5 mit vdr 2.7 - Raspberry Pi 3 - rpihddevice
    MLD 5.5 mit Squeeze Play - Raspberry Pi 2 - 32GB SD - 7" Touch TFT

  • Hi,

    It is now more then 4 weeks ago, that I applied the patch.

    Since then no deadlock :)

    N.B. I also have 3 RPI's with mpd as streamdev client, all working as expected.

    So fingers crossed.

    Greetings Rene

  • Hi,

    The question now is, whether it also fixes the initial problem reported in this thread...

    I did now a backport to vdr-2.2 and it seems to work well. Multiple recordings, streamdev operation, PiP, no problem so far.

    Originally I had often lockups when using the osdteletext-plugin. Even when the osdteletext is started there is no lockup. But the osdteletext does not work but this seems to be related to softhddevice-openglosd which I use in the meantime.

    Here the vdr-2.2.0 backported version of the patch from kls:

    vdr-2.2.0-fixdevicedetachlock-2.diff


    Cheers

    VDR: Zotac ZBOX EN860, 16GB RAM, 2 TB HDD, Debian Bookworm, vdr-2.7.3, softhdcuvid, satip

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!