Pulse-Eight / libcec

USB CEC Adapter communication Library http://libcec.pulse-eight.com/
Other
722 stars 290 forks source link

cec-client generates segmentation fault after command seems to work? #531

Open Nodi-Rubrum opened 4 years ago

Nodi-Rubrum commented 4 years ago

Just recently cec-client generates segmentation fault after command seems to work. This is a random issue, it will happen, then stop for many commands, then reappear on every command, until it disappears again.

The command sequence is almost always accept by the target device, and device executes said command, say pow, or on, or standby for example. But cec-client monitor log returns sometimes 'unhandled response received: opcode=36 initiator=1 destination=0 response=0' when this happens, the result code is 139, and cec-client failed with a segmentation fault error reported to console.

Details... Raspberry Pi OS, latest image 05-27-2020 with all updates to date

# uname -a Linux eccentric.dachshund-digital.org 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux # cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

# cec-client -i libCEC version: 4.0.4, compiled on Linux-4.15.0-48-generic ... , features: P8_USB, DRM, P8_detect, randr, RPi, Exynos, AOCEC

Nodi-Rubrum commented 4 years ago

A bit more information, when the seemingly random segmentation fault happens, in the testing I have done, most of the time, it is when a 'on' command is issued. Some times the on command seems to complete, other times if clearly fails to complete before the segmentation fault is reported. No sure if this is just because the fault reporting lags, due to code design or such. Below is an example where issued on command and the segmentation fault was immediate, the receiving entity seemed to never get the cec command.

Command failed: /bin/echo on 0 | /usr/bin/cec-client -s -d 1 /bin/bash: line 1: 13627 Done /bin/echo on 0 13628 Segmentation fault | /usr/bin/cec-client -s -d 1

IMHO it almost looks like the cec-client (or library call?) chokes on the input stream/pipe content in this case. But the on command is basic to any cec protocol use.

RichiG88 commented 3 years ago

I get the same error, when I use the command „echo tx 15:70:24:00 | /usr/bin/cec-client -s -d 1“ to activate the audio output on my av receiver. But I don’t get the error when I use „echo tx 1f:82:24:00 | /usr/bin/cec-client -s -d 1“. Both commands work nonetheless. I‘m running this on a Raspberry Pi 3B with Kernel 5.10.17-v7+ #1403