I've adapted pbm/netpbm image manipulation routines as a module for
AOLServer.
The module loads successfully into AOLserver.
And the tcl commands, such as pbm_new, are also recognized. Guess that was
the easy part.
However, I keep getting a segmentation violation, when my script issues a
command such as...
pbm_new myimg -transparent white -fill white 6 6
myimg /* this leads to segmentation violation */
Interestingly enough, when the script issues
pbm_new myimg -transparent white -fill white 5 5
myimg /* this doesn't lead to segmentation violation. Seems like up to 5
pixels by 5 pixels its ok, but not higher */
After launching the nsd8x executable, and then using gdb to attach to the
first process, I still am not able to trace the C code because the
breakpoint even within PBMInterpInit is not reached.
/* this is the initial C code within nspbm.c */
int
Ns_ModuleInit(char *hServer, char *hModule)
{
return(Ns_TclInitInterps(hServer, PBMInterpInit, NULL));
}
I do notice that there's 5 threads/processes running (RedHat 7.1 Linux) - so
perhaps its being serviced through another thread. Can I limit nsd8x
startup process to 1 thread, so that I can trap the call within gdb?
Is there a (better) established way to debug C module code within AOLServer?
BTW, can the segmentation violation be occuring because of some malloc
(which the C code does do) but the AOLserver is running out of heap space?
Any guidance is appreciated.
Thanks,
Sanju.