The responses included so far are excellent. I would add the following:
When the pbuilder creates stub functions, they are made to be modified. In fact the "get" functions must be modified. For example, the standrd "get" stub functions begin with something like char * the return. It might end with return theReturn. This is returning a char * stack variable. Depending on timing that char * could be out of scope when returned to the web server engine and thus cause a crash looking like what you presented. At minimum, change char * theReturn to static char * theReturn. This will keep the variable in scope. Though be careful, doing so, the variable is now not cleared out on the next call to the function. So you'll need to memset it before use.
But in general, I'd be looking for a memory issue in one of your stub functions.