News for hackers. Stuff that matters.
Re:“Unexplainable” core dump (2011) by lisper on Tuesday January 03, 2023 @04:09PM (#34238100)
I had one of these back in the 90s that turned out to be a compiler bug. It was code that ran a mobile robot with an arm. Exact same code running on a Sun workstation never failed, but running on an embedded system running vxWorks crashed intermittently, but only when the arm was moving. Entire heap was corrupted, so by the time the crash occurred there was no hope of getting a stack trace or any hint of what went wrong upstream. Turned out to be two mis-ordered instructions that accessed a value on the stack after the stack pointer had been popped. On vxWorks, interrupts used the same stack as the currently running process, so if an interrupt occurred exactly between these two instructions it would clobber that value, and chaos ensued.

Took a full year to figure it out. Good times.

Re:“Unexplainable” core dump (2011) by aw1621107 on Tuesday January 03, 2023 @05:03PM (#34238750)
How did you end up piecing together what happened?
Re:“Unexplainable” core dump (2011) by lisper on Tuesday January 03, 2023 @05:32PM (#34239092)
Long story but the tldr is that it happened in two stages. First someone figured out a way to reliably reproduce the problem. And then I spent a very long time single stepping through machine instructions until I had a eureka moment.
Re:“Unexplainable” core dump (2011) by dekhn on Tuesday January 03, 2023 @06:18PM (#34239546)
And the compiler was emitting the two instructions in the wrong order?
Re:“Unexplainable” core dump (2011) by lisper on Tuesday January 03, 2023 @11:12PM (#34241935)
Yes.
Re:“Unexplainable” core dump (2011) by dylan604 on Tuesday January 03, 2023 @11:53PM (#34242174)
I hope someone bought you a beer
Re:“Unexplainable” core dump (2011) by lisper on Wednesday January 04, 2023 @05:20AM (#34243993)
Discovery is its own reward ;-)

Actually, I remember reporting the bug to the compiler authors and being stunned when they told me that they were not going to issue a new version with the bug fix because the project was no longer being funded. (This was the T dialect of Lisp in case you're wondering.)

Re:“Unexplainable” core dump (2011) by aw1621107 on Wednesday January 04, 2023 @12:38AM (#34242402)
Sounds like quite the arduous process!

What was done in the time period between discovering the bug and its cause?

Re:“Unexplainable” core dump (2011) by lisper on Wednesday January 04, 2023 @05:14AM (#34243958)
A lot of rebooting and cursing.

Fortunately, it only happened when the robot's arm was moving, and we were mostly doing mobility research so we were able to be productive simply by not using the arm.