You should step through the code with a debugger and determine exactly which line the segfault happens on. This will give you (and us) a better starting point.
daviddoria 334 Posting Virtuoso Featured Poster
daviddoria 334 Posting Virtuoso Featured Poster
daviddoria 334 Posting Virtuoso Featured Poster
daviddoria 334 Posting Virtuoso Featured Poster