Hi, (to those reading, please treat this message as urgent)
I am having trouble in a cgi using libpq. The source compiles properly, but 
seems to be crashing at the statement:
result = PQExec(conn, "BEGIN");

It does not even get to the error trapping right after this.
Compiling with the -Wall option gives one unrelated warning, that I am 
typecasting the returned value of a getcgivars() function to (char **). 
That's no problem because I do that in all my other working cgi's.
All the stuff that could go wrong would have output nicely as html before 
this statement. For this purpose, I have debugging printf() and exit() 
statements before this, so I can gradually remove exit() statements until 
the problem occurs. That is how I pinpointed it to the PQExec function.
In case someone is wondering, the exit()'s are needed because Apache buffers 
all output, and writes it once the cgi is done. If it crashes before it's 
done, you just get an error with hardly an indication of what's wrong.
  The apache side of the problem is that I get the standard Internal Server 
Error page, while the error_log says 'premature end of script headers'. This 
error, from what I've experienced, occurs for two different reasons. One, 
the proper 'content type' header with the two newlines is not being written. 
I've done that properly.
Second, the cgi is dumping core before it finishes executing. I wouldn't 
know, but I think this is most likely what is happening. However, this is 
very strange, because the source I am using is almost identical to other 
cgi's I have.
I would greatly appreciate any help on this urgent matter, as sadly, the 
fate of my job rests on the online community once again :)
Thanks,
Alex


________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to