cesanta / mongoose-wizard

1 stars 1 forks source link

Generating (or subscribing to?) the mqtt rx topic crashes the application with a corrupted backtrace if the rx topic contains an variable whose value is not empty. To duplicate: Enable MQTT in the wizard and build the default project. Optionally adjust the device_id default value to be an empty string to observe a successful connection instead. Observed on ESP32. #7

Closed cpq closed 2 months ago

cpq commented 2 months ago

@robertc2000 I was not able to reproduce it. Please try to reproduce on your side.

"Generating (or subscribing to?) the mqtt rx" - cannot reproduce that. If I just enable MQTT in a default config, works fine (uses non-empty device_id expansion). If I use a non-existent variable, works too. Let me know the way to reproduce, please!

@dvosully please let us know the sequence to reproduce that

dvosully commented 2 months ago

I think the functions doing variable expansion have been changed since I reported that issue, I'll check again later but it may have been fixed already. At the time, running the default project with MQTT enabled would cause it to occur.

dvosully commented 2 months ago

I can confirm this is no longer an issue. expandvar got patched between reporting and now. The fix was:

---      n2 = mg_snprintf(tmp + n1, len - n1, "%M", s_vars[vi].fn);
+++      n2 = mg_snprintf(tmp + n1, len - n1, "%M", glue_pfn, s_vars[vi].fn);
cpq commented 2 months ago

@dvosully thanks David!