ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
kenny has joined #rust-embedded
jiande20208 has joined #rust-embedded
jiande2020 has quit [Ping timeout: 255 seconds]
jiande20208 is now known as jiande2020
cinemaSundays has joined #rust-embedded
emerent has quit [Ping timeout: 272 seconds]
emerent has joined #rust-embedded
gauteh[m] has joined #rust-embedded
<gauteh[m]> Hi, I'm storing a pin in a Mutex<RefCell<Option>>> to access it from an GPIO interrupt. However, before I even get to that the static is being reset to None...... (full message at <https://catircservices.org/_irc/v1/media/download/Aep7j23TdayvBTHfNXWYY0O98xFCqBub3aT5E2CQXhu9woVXH6WRLUVvlA8o7UDsNCbeYaGWiMLD8FRuxG3kEAxCeSmaIR_wAGNhdGlyY3NlcnZpY2VzLm9yZy9SZ3l0WklEa0hVVndTTENKenRrdVlHT0M>)
<gauteh[m]> * Hi, I'm storing a pin in a Mutex\<RefCell\<Option>>> to access it from an GPIO interrupt. However, before I even get to that the static is being reset to None...... (full message at <https://catircservices.org/_irc/v1/media/download/AdLdTYRkKPiy3ypy0A-2dX8zD2FIv9iI_eSKFmRtbAgaVM9fevUyzzxRtCNIMGhdNVMvxK9GAc8YTft48z8n2wRCeSmaJsuAAGNhdGlyY3NlcnZpY2VzLm9yZy9kYUxxUVlIekJ3anpFV0JLdGJJbXF1ZGo>)
<gauteh[m]> At this point interrupts are not enabled yet. This is a single core MCU.
<gauteh[m]> * Hi, I'm storing a pin in a Mutex\<RefCell\<Option>>> to access it from an GPIO interrupt. However, before I even get to that the static is being reset to None...... (full message at <https://catircservices.org/_irc/v1/media/download/AZDPAUbt599vXeDsSnMBif-WaB8BmL2s22Abr2S87AtS99MMlVge4oD_oBQUTD4b2mJFYIn0cVXTY5k9k7pJv-ZCeSmaTCmAAGNhdGlyY3NlcnZpY2VzLm9yZy94UEVyeVVDWkdSYlFQZ05pVEZhWGJVU1Q>)
juliand[m] has quit [Quit: Idle timeout reached: 172800s]
<gauteh[m]> Yeah, looks like stack overflow.
cinemaSundays has quit [Quit: Connection closed for inactivity]
Makarov has joined #rust-embedded
zeenix[m] has quit [Quit: Idle timeout reached: 172800s]
<thejpster[m]> jamesmunns: I think the OOM handler on Linux doesn’t terminate the process that wanted the memory - it terminates a random process weighted by how much memory they’ve allocated. So the odds are good that in fact it’s the program that ate all the memory that gets terminated and not the poor process that just wanted a few more bytes for something.
<thejpster[m]> I’ve listened to two back to back and I very much enjoyed the telegraph analogy.
Makarov has quit [Ping timeout: 256 seconds]
Makarov has joined #rust-embedded
Makarov has quit [Quit: Client closed]
crabbedhaloablut has quit []
crabbedhaloablut has joined #rust-embedded
<JamesMunns[m]> <thejpster[m]> "jamesmunns: I think the OOM..." <- TIL!
<Ralph[m]> <gauteh[m]> "Yeah, looks like stack overflow." <- do you know [flip-link](https://crates.io/crates/flip-link)? it "adds zero-cost stack overflow protection to your embedded programs"
kenny has quit [Quit: WeeChat 4.4.2]
pronvis has joined #rust-embedded
<gauteh[m]> <Ralph[m]> "do you know [flip-link](https..." <- I couldn't get it to work
Makarov has joined #rust-embedded
<JamesMunns[m]> There's a lot of static mut and unsafe in your code gauteh, at least some of it is at least theoretically UB
<JamesMunns[m]> you put a pointer to note in log::NOTE and then continue using a mutable reference to it
Henk[m] has quit [Quit: Idle timeout reached: 172800s]
<gauteh[m]> yeah 🫣
<gauteh[m]> I don't think the compiler noticed
<JamesMunns[m]> I mean, you're asking us about debugging things that "seem impossible"
<JamesMunns[m]> :/
<gauteh[m]> fair enough. it did turn out to likely be stack overflow though, i reduced some buffers and queues and it was ok. seems pretty likely that the static A2 was overwritten with those
<JamesMunns[m]> fair!
<gauteh[m]> I use the reference to the note(modem) to try and do a last-ditch attempt at sending panics home before resetting: https://github.com/gauteh/sfy/blob/2597c7688655ec2c161ffbf06c504e520b7ec986/sfy-buoy/sfy-artemis/src/main.rs#L536
<gauteh[m]> I hope I only use the static reference in the panic handler/hardfault, since I have access to it the regular way usually.
<huayra1[m]> what is the "recommended" way to do c++ bindings? i know of cxxbridge and include macro. btw, is it normal for a file using cxxbridge to take like 15 seconds?
romancardenas[m] has quit [Quit: Idle timeout reached: 172800s]
vollbrecht[m] has quit [Quit: Idle timeout reached: 172800s]
rmsyn[m] has quit [Quit: Idle timeout reached: 172800s]
i509vcb[m] has quit [Quit: Idle timeout reached: 172800s]
therealprof[m] has quit [Quit: Idle timeout reached: 172800s]
RockBoynton[m] has quit [Quit: Idle timeout reached: 172800s]
Makarov46 has joined #rust-embedded
Makarov has quit [Ping timeout: 256 seconds]
omani[m] has quit [Quit: Idle timeout reached: 172800s]
kenny has joined #rust-embedded
xnor has quit [Ping timeout: 248 seconds]
xnor has joined #rust-embedded
Charles[m] has quit [Quit: Idle timeout reached: 172800s]
Makarov46 has quit [Quit: Client closed]
Makarov has joined #rust-embedded
Makarov has quit [Quit: Client closed]
Foxyloxy has quit [Read error: Connection reset by peer]
Foxyloxy has joined #rust-embedded
cinemaSundays has joined #rust-embedded