12-11-2013 11:59 AM - edited 12-11-2013 12:01 PM
I've had my share of weird bugs raising their head over the years. The ones which disappear as soon as you try to find out where they're coming from, or as soon as you call a colleague over to have a look are always the most annoying.
What are the most unreproducible (and therefore annoying) bugs you've run into.
Mine was as follows:
A random RT VI was being debugged and I suddenly saw the execution time of a simple "divide" primitive started changing it's execution speed (during execution) depending on the values being fed to it (It's best not to ask what kind of benchmarking I was doing to notice something like that). I'm talking 10x times slower when fed with numbers leading to "possible" rounding errors. I managed to show it to a colleague but by the time I had reported it in the forums, the problem had gone away most likely laughing at me as it went. LINK.
Anyone else?
12-11-2013 12:53 PM
I want to chime in!
I took a LabVIEW project from 8.2 to 2010. In LabVIEW, everything was fine: The update warnings contained minor issues. The entire code worked pretty fine in LabVIEW. Quite soon the time came to build the application and test it. Actually, the application crashed (I do not remember the exact kind of crash) in one specific scenario - which it never did when produced with 8.2. It took a good amount of time until I found the reason for it: On the BD there was a section that wrote to two property nodes of one menu ring without any data flow control there ... Adding an error wire between the property nodes fixed the issue.
It was just the compiler improvements of 2010 that made me identify this bug that was in the code since about 400(?) years ...
12-11-2013 02:26 PM
A few years back I was working on a program for a client and ran into a wonderfully undebuggable issue - I don't remember if the guy testing the EXE with me saw it first or if I saw it first in LV, but occasionally, LV would produce different results from the same Number to Fractional String primitive, even though it was getting the exact same input. It was weird to see, because changing something in the UI which caused a rerunning of the code without changing the value would then also cause the values in some indicators to change. Do it again, and it would change back. I even managed to create a VI which would demo this once the bug would start happening.
Not only was this a super-weird bug in its behavior (and scary, because it made the math come out slightly wrong), but I couldn't figure out what was causing it to manifest. There was no good set of repro steps. It would just appear sometimes and persist until LV was closed. Eventually, someone from NI figured it out - there were calls to .NET functions in the program and under specific execution paths, they were changing the precision of the processor for the thread and failing to change it back, which would then cause LV's calculation to come out wrong. I think the solution was to move all the relevant .NET calls to a separate thread.
12-12-2013 05:33 AM
I have a related comment to make, although not directly answering the OP. It has happened that I witness something odd and spend hours/days debugging my software only to find that some part of the hardware or the UUT isn't responding properly. The other posts are very interesting, but this type of thing happens often.
12-12-2013 07:23 AM - edited 12-12-2013 07:24 AM
I'm suffering one right now and it's driving me nuts!!!!
In my code I appear to have a memory leak. When I build the code into an executable it's worse (or so it seems).
I don't keep re-opening references to things (such as named queues).
I am not hoarding objects or class instances.
The worst thing is, as I work through a copy of the code removing small chunks and retesting to determine the culprit, the memory leak will suddenly vanish, only to not reappear when I put back the last bit of code removed! I can then revert to the original full code and remove something somewhere else, and again the memory leak will vanish, only to not come back when I reinstate that code. It's untrackable!!!!
What's the emoticon for crying uncontrollably?
12-12-2013 08:43 AM
Do you use dynamic events? If you register for them but don't handle them, don't they start eating memory?
12-12-2013 09:53 AM
I am using dynamic events, but only one per event structure (with one event structure per component, total 5 components). And I handle them everywhere that I register them. Plus, I'd only heard that an unhandled registered dynamic event caused the event structure timeout to reset. Nothing about memory leaks!?
Looking at my code, the memory leak rate is related to the user event generation rate. Yikes...
12-12-2013 10:11 AM
I have two other things that come to mind which aren't undebuggable, but were a bit tricky: