Open eknoes opened 6 years ago
I've got a similar looking segfault, but it happens unpredictably. I have some code that scans for BLE devices, waiting for a certain match, then lists the characteristics of the matching device. It runs in a loop forever. Except it never does run forever, because of this segfault. It seems to go about an hour (during which my two devices come alive for 12 times each, for 12 seconds at a time, producing 4 beacons per second, so ~1200 beacons processed and about ~20 characteristics listings produced -- because it only produces one such listing each on period per device -- before crash).
I guess bluepy-helper
ought to be run in gdb
. For me I don't think I can reproduce this enough to consider debugging it yet (actually I've been working on moving away from using this library entirely) but if you're willing to debug, then I will try to help.
So far I have managed to get it running in gdb
. What I did was this:
continue
in gdb]I literally just did this, and the program hasn't crashed yet since I did, so I have no gdb results.
That approach won't work if your bluepy-helper
is crashing close to startup, not giving gdb -p
enough time to attach. For that you might be able to use some kind of wrapper. I see that bluepy-helper
is called here: https://github.com/IanHarvey/bluepy/blob/53ce2f2388a936663b94f00636cc2e3677325182/bluepy/btle.py#L22
It is just using $PATH to find the executable. So you could put a wrapper of the same name in the front of the $PATH, and have it call the real bluepy-helper
via gdb
. I am not sure exactly how to do that though. But it's probably been done before.
OK, I just discovered that bluepy-helper
actually gets restarted by bluepy
. So gdb -p
isn't really sufficient. It needs to be re-attached time and time again. Just going to post this message and do something else for a while now.
Hey, when I use Bleah to write certain data to a specific handle, I get the following error:
dmesg:
As this error appears to me using bleah, this is my call:
If you tell me how to debug this further, I am happy doing so!