Created attachment 722 [details] Evil protocol decoder If a protocol decoder uses an annotation id, that is not assigned to any annotation row, PV crashes with the error message "Caught exception of type St12out_of_range (map::at)" How to reproduce 1. Install attached protocol decoder evil_pd or have SIGROKDECODE_DIR point to it 2. Start PV with demo device 3. Add protocol decoder evil_pd and assign any logic channel to "in (input)" 4. Capture some data 5. Zoom in If you remove the comment ('#') from line 48 in pd.py, PV runs fine. I can reproduce the crash with current nightly build PulseView-NIGHTLY-x86_64.AppImage. I am unsure, whether this is a libsigrokdecode or PV bug. sigrok-cli works fine with that decoder.
Hello Ralf, thanks for your report. A crash in PV is never good and I'll fix this of course. However, that's a bug in the offending protocol decoder, as annotation classes must be assigned to a row. Otherwise, it is unclear which row shall receive such annotations.
Hello Soeren, Thanks for looking into this. I agree, that the PD behaves badly, but would prefer a proper error message. OTOH if it is required to have all annotation ids assigned to an annotation row, shouldn't it be enforced by libsigrokdecode, so that all applications benefit from it? If I can help with testing or by looking into libsigrokdecode, please let me know.
I assume a strict enforcement wasn't intended or else Uwe would've added it, I'm sure. So maybe there's some reasoning there that I'm not aware of. As for PV, I'll have annotations without rows placed into a catch-all row named "UNASSIGNED" or such. That way, the annotations will appear but users will see that something's not quite right. Would that work for you?
That would be perfectly fine for me. It does not crash and gives a hint where to look.
Fixed in eb31c238473de0784ec57b9782e11082613a7a7a