Thursday, September 28, 2006

Linking langour

Most basic coding errors will usually result in a compiler error, here and there; like a spell checker in a word document, the compiler points you to the exact source of the problem. Unfortunatly, life isn't always so grand.

Earlier this week, I spent hours debugging a single dynamic linking error. You know, it's the kind of error that doesn't show you what the problem is. Unlike the linker error that tells you cryptic things like "unreferenced blah blah", this "error" happened at run time. This resulted in the program running part of the way, after a point at which it would just crash, making the abominable segmentation fault.

Eventually, by using the "gdb processName PID" method, I was able to localize the error to one library. To make a long story short, it turns out, to my surprise, this library was built on a different computer then the rest of the libraries; this caused the segmentation fault. I switched to the correct, compatible library and wholla, it worked!