3 ms·
A couple of decades ago i worked with GSM handsets, and because you certify the GSM stack along with the compiler, you're pretty much tied to a specific compile
by 8fingerlouie 6y ago
A couple of decades ago i worked with GSM handsets, and because you certify the GSM stack along with the compiler, you're pretty much tied to a specific compiler version.
At the time we were working on a new "feature phone" with a 160x120 pixel display in 4 shades of grey, which was a huge upgrade compared to our previous models. Another feature was full screen images for the various applications, and we'd been implementing is into the software and testing it for weeks without problem. After the development cycle came to an end, our release team created a new software release and sent it to our test department, which almost instantly reported graphical errors back to us. We tested the software image on our own handsets, and half the screen was "garbage".
We spent weeks looking over the merged code, as well as debugging pointers code and found nothing. It wasn't until we were stepping through the paint code with a Lauterbach debugger that we noticed something was "off" with a pointer.
The platform was a 16 bit platform and memory was addressed using a page pointer pointing to a 64kb memory page. When we traversed the bitmaps fate would have it that this particular bitmap, in this particular build, was split between two pages, and when incrementing a pointer beyond the page limit, instead of incrementing the page pointer, it simply just overflowed and started from the beginning of the current page.
Another interesting bug we chased in the compiler was it's inability to add more than 2 variables in initial assignment.
i.e.
int a = 1+2; // a = 3
int b = 1+2+3; // b = 3
int c = 10 + a + b; // c = 13
That took a while to figure out.
- ptsneves 6y agoOf note to me: certified compiler was actually non performing :) Lauterbach, the savior of embedded wizardry. Still in use today with chips one would not consider "embedded".
- widforss 6y agoThe first example sounds like a bug that could sneak in anywhere, but the second one makes me question how they laid out the compiler architecture. Did they write a special expression parser just for declarations? I mean, this shouldn't be possible if there was just one expression parser?
- devthrowawy 6y agoProbably more to do with compile time static expression evaluation (optimization) than parsing. Seems like it's not actually recursing down, just evaluating the root.
- phaedrus 6y agoThat could be, but my first thought was it's only compiling it to a single assembly instruction (which can only have two operands). Or it generates ADD instructions using a succession of registers or stack locations, but the initialization code blindly assumes the result is in the first register or stack location.
- hyperman1 6y agoLong ago, I bought the MIX C compiler for DOS. It had a tendency to miscompile basic things like the ++ operator. Lost hours of my life on it. One day I found out about DJGPP, and even if the download cost a fortune in phone time, life was so much better. Now the C reference book included with MIX C turned out to be much better than the compiler itself, and served me well for a decade.