Thomas (boggyb) wrote,

  • Mood:
  • Music:
At work today I was debugging a problem in a bit of code, where somewhere between two systems a string was being truncated. There's three units and multiple programs involved in this, so to try and narrow it down I decided to add some debug to one program. The particular system on that unit uses a flowchart-like execution structure, separating actual code from the flowchart diagram. So, add in a debug node to print out the string when one flowchart has grabbed it from the other, rebuild the chart and transfer it to the unit, run it and it's still truncating the string. But that debug node was rather unhelpful and only printed out the first few characters, so I still don't know where the truncation is occuring. Not to be defeated I dug out a better debug node from the depths of the source control, compiled it, transfered it to the unit and plonked it into the flowchart.

At which point it stops truncating the string and sends the full text all the way through the system. Ah-hah, I think, this must be a heisenbug (adding debugging code can have very subtle effects on program behaviour). I'll remove my debug node from the flowchart, rejoin the original pair of nodes together, and upload the chart.

And it's still working. Ok, I think, the act of converting the chart for the unit must have changed it slightly from the original. It shouldn't do so as that implies non-deterministic code somewhere, but that'd at least explain what's going on. So I dug out the original already-converted chart and transfer that, thinking that this'll now restore the broken behaviour (when debugging it's always helpful to be able to reproduce the original bug - if you can reliably reproduce it, you can use a debugger to see every step involved and often quickly spot the actual problem).

Except it's still working!
Tags: programming

  • Remember, remember, the Fifth of November...

    ...gunpowder, treason and plot. I see no reason why gunpowder, treason Should ever be forgot... Today's traditional filler post reminded me of the…

  • (no subject)

    There seems to be a lot of FUD flying around at the moment, all because of this quote from the PM: "When people are using social media for…

  • New shiny toy!

    The Nyx replacement build has been in the planning for a long time. It was originally pencilled in for late 2019, and looking at my notes would have…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.