You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that sometimes the vhduino program reports a problem
2021-03-31 20:01:30 sigHandler: Unhandled signal 11, terminating
I'm using a Raspberry Pi 3B+ with Raspbian 10.9, libpigpio1 1.71-0~rpt1, kernel 5.4.72-v7+ and an RXB6 receiver connected to GPIO 17.
I was able to reproduce the problem when running vhduino in gdb. When I type a command RF receive 17 and step through the program, the signal occurs after stepping over the call to gpioSetAlertFunc() in rfcontrol_command_receive(). Unfortunately I was not able to get a useful stacktrace.
By analyzing the source code I found that rfcontrol_command_receive() calls gpioSetAlertFunc() to set handle_pigpio_interrupt() as a callback function and then calls RFControl::startReceiving which will assign an inner callback function handleInterrupt() to _hw_interruptCallback using hw_attachInterrupt().
If an interrupt occurs between gpioSetAlertFunc() and hw_attachInterrupt(), the function pointer _hw_interruptCallback can be NULL which can result in a segmentation fault when this function pointer is called.
When debugging, the time between gpioSetAlertFunc() and hw_attachInterrupt() is rather long and the problem occurs every time. When running the program in the normal way, the problematic time interval is short, so the problem doesn't seem to occur every time.
I'm preparing a fix.
The text was updated successfully, but these errors were encountered:
bomm
added a commit
to bomm/virtualhomeduino
that referenced
this issue
Apr 1, 2021
I am very sorry for the delay in reply. Currently, the project is lacking maintainers and I have hardly no time due to work and private commitments. I am very grateful for your detailed problem analysis and PR. I'll look into this asap.
I noticed that sometimes the
vhduino
program reports a problemI'm using a Raspberry Pi 3B+ with Raspbian 10.9, libpigpio1 1.71-0~rpt1, kernel 5.4.72-v7+ and an RXB6 receiver connected to GPIO 17.
I was able to reproduce the problem when running
vhduino
ingdb
. When I type a commandRF receive 17
and step through the program, the signal occurs after stepping over the call togpioSetAlertFunc()
inrfcontrol_command_receive()
. Unfortunately I was not able to get a useful stacktrace.By analyzing the source code I found that
rfcontrol_command_receive()
callsgpioSetAlertFunc()
to sethandle_pigpio_interrupt()
as a callback function and then callsRFControl::startReceiving
which will assign an inner callback functionhandleInterrupt()
to_hw_interruptCallback
usinghw_attachInterrupt()
.If an interrupt occurs between
gpioSetAlertFunc()
andhw_attachInterrupt()
, the function pointer_hw_interruptCallback
can beNULL
which can result in a segmentation fault when this function pointer is called.When debugging, the time between
gpioSetAlertFunc()
andhw_attachInterrupt()
is rather long and the problem occurs every time. When running the program in the normal way, the problematic time interval is short, so the problem doesn't seem to occur every time.I'm preparing a fix.
The text was updated successfully, but these errors were encountered: