-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception (LoadProhibited) in run_ook_demods() #116
Comments
Thanks for identifying this To confirm which decoder is triggering this, can you add this line back in ( you may need to fiddle with it a bit, but want to see r_dev->name )
It will give the decoder name I don't think it is Once you identify which one, you can add a disabled flag to the device decoder similar to |
Is added the printf into lines 523 und 524 as: for (unsigned priority = 0; !p_events && priority < UINT_MAX; priority = next_priority) {
next_priority = UINT_MAX;
for (void** iter = r_devs->elems; iter && *iter; ++iter) {
r_device* r_dev = *iter;
logprintfLn(LOG_DEBUG, "demod(%d) - %s", r_dev->modulation, r_dev->name);
fflush(stdout);
// Find next smallest priority Result is shown below:
I have deactivated the corresponding device and the exception has disappeared. But of course the "Oregon Scientific" sensor is no longer recognized. Is there any way to fix this? I would definitely try to help. |
Two thumbs up on having the back trace enabled Looking at the backtrace I thought it would have pointed to the line within Oregon_scientific.c, but it didn't. As the device decoders are sourced from rtl_433, my approach would be to first refresh that decoder to see if the issue is already resolved ( hopefully no dramatic API changes where made), then do a code review to see if I can spot the issue, then worst case put a lot of debug statements in to see where it is failing. And once I find the issue, resolve it, and send the fix upstream to rtl_433. Not sure how much time you want to put into this. |
On further investigation of this problem, I found that the error always seems to occur in malloc() .... However, the stack trace is also always different. The case shown in the following trace occurs most frequently. In src/rtl_433/r_api.c:985 // callback to external function that receives message from device (
// rtl_433_ESPCallBack )
(cfg->callback)(cfg->messageBuffer); then to enqueueJsonObject in main/ZgatewayRTL_433.ino:261 and jsonQueue.push(bundle); in main/main.ino:436 RFrtl_433_ESPdata["origin"] = (char*)topic.c_str();
enqueueJsonObject(RFrtl_433_ESPdata); // <===
storeSignalValue(MQTTvalue);
pubOled((char*)topic.c_str(), RFrtl_433_ESPdata);
----------
JsonBundle bundle;
bundle.doc = jsonDoc;
jsonQueue.push(bundle); // <===
Log.trace(F("Queue length: %d" CR), jsonQueue.size());
and down to components/heap/multi_heap.c:200 where it finally crashes.
I would suspect a storage overlay either in the decoder or another memory problem. |
That section of code is from the openMQTTGateway package, and I believe it is queuing the message for sending via MQTT. I'm wondering if the object is larger than others or for some reason it is exceeding a buffer size. Visually it doesn't appear to be extremely large. |
An annoying problem, a simple cause. After increasing the value of |
@dilmash - If you watch the logs and status messages, the high water mark for that stack is logged so you can tune it further as needed. The log entry is RTL_HWM alogprintf(LOG_INFO, ", RTL_HWM: %d", uxTaskGetStackHighWaterMark(rtl_433_ReceiverHandle)); |
I have added your 48 byte tweak to release 0.3.2 |
Analysis
I am running a vanilla OpenMQTTGateway on a LilyGo RTL 433 Module. Sometime the firmware crashes with the information shown below. I can reproduce the exception when I power on an OregonScientifc Thermo/Hygro Sensor
Most likely a THGN132N
I compiled with:
and I also added 2 debug printf's to identify the element that may have caused the exception as:
As the counter indicates, the loop is at either position 87 or 88 (Last last digit of 88 may have been dropped by the exception)
Most probably mebus433 ?
I can reproduce the issue almost imediately when activating the THGN132N
Expected Behavior
run_ook_demods() should not cause an exception when scanning the list of protocols
Steps To Reproduce
Activating a THGN132N temparature sensor will cause the exception almost immediatley
Logs
Configuration
Environment
Process Supervisor
not applicable
Additional Context
No response
The text was updated successfully, but these errors were encountered: