Tuesday, June 11, 2013

Windows never ceases to Amaze!


These past few days I have been working towards my scholarly paper which hopefully will culminate into a thesis. The problem at hand requires me to implement a system. I will not talk anything about the system itself, but rather the programming part. Programming furiously, I had designed a system ground up after reading a paper on the same. It was a tough task, more so on the GNU C++ compiler, which is rather strict in adherence to some technical specifications- more specifically the ways I could call an object constructor and initialise the object.

It was a little irritating at first, but I like programming and it only required a minor change in my style. Plus I really had no other option than to oblige. Majbuuri ka naam Mahatma Gandhi.

While compiling the program, though it seldom happens with me, but this time it happened big. The dreaded word “Segmentation Fault” appeared on the gnome-terminal. Now, since I was using an older version of Linux the debugger plugins simply won’t install. Attaching the gdb manually is a little too mundane for me, plus the extra code I would have to write would only have bloated the program and given more headaches. What to do?

At time like this when faith in Linux is shaken, I always look towards Saint Bill Gates. Windows to the rescue!

Now the funny part happens, I fired up Orwell Dev C++, and put all the critical variables in the watch stack. But every time I compiled and ran my program, somehow the IDE would crash every time, without any sufficient explanation.  There had to be one. I double checked by writing a dummy “Hello World” program, the compiler install was intact. There had to be another reason.

And then one of those Eureka moment happened, when realisation dawns upon you.

Windows have a feature of DEP (Dynamic Execution Prevention), which when translated into English means, whenever a program tries to access memory locations other than its own, the Windows OS shuts down the program as a potential malware which could cause harm. Due to Segmentation Fault, my program was accessing memory locations which were out of bounds, hence the sudden IDE crash.

Sometimes I forget how amazing Windows OS is. But moments like these remind me why it’s still the most popular. Speaking of Windows, I recently and finally acquired Windows Phone 8. A proper review of my phone Lumia 720 shall soon follow. But in one word it is simply beautiful.

No comments:

Post a Comment