FactbirdHQ / ublox-cellular-rs

A driver crate for the entire u-blox cellular family in Rust
21 stars 10 forks source link

Stack overflow in hard_reset when not using power pin #87

Open diekleinekuh opened 1 year ago

diekleinekuh commented 1 year ago

We have some rare crashes in the wild which we traced back to an issue in https://github.com/BlackbirdHQ/ublox-cellular-rs/blob/master/ublox-cellular/src/power.rs:

hard_reset calls power_on at the end which in turn will try a soft_reset in case the power pin is not used. If this fails too hard_reset is called which closes the loop.

MathiasKoch commented 1 year ago

That's a nice catch!

I can take a look as soon as I get a few minutes, unless you would like to add a PR for it?

diekleinekuh commented 1 year ago

I will do a local fix first anyway and can try to do a PR if I have something that works. I would probably try to move the hard reset out of power_on and call it explicitly where it is needed. But I didn't look at the full picture yet.