[Info-ingres] RE: OpenAPI Weirdness
- From: martin.bowes@xxxxxxxxxxxxx
- Date: Thu, 11 Aug 2005 11:40:23 +0100
Hi Grant et al,
Sorry to bother you directly Grant, but I'm at my wits end on this one
and could use some advice. If anyone else in the newsgroup would like
to chip in 2c worth, I'd be happy too.
I've written a C program which has a subroutine full of API stuff. This
subroutine controls connecting to three databases in sequence to do
stuff. From the final database connection it reads in a lot (17511 rows)
of data to the program before disconnecting and then terminating the
API before returning to the main program.
All of which appears to work perfectly well. The data returned to the
program is exactly what is in the database.
But after the IIapi_terminate succeeds, the subroutine will return a
TRUE. Diagnostics indicates this is all happening. But the subroutine
NEVER returns to the main program. Instead it either loops? or causes
a coredump.
The code is literally:
main (...) {
if (Generate_Analysed_Data(&SayWhat)) {
printf("Generate_Analysed_Data completed OK!\n");
} else {
printf("Unexpected Error: Failed to Generate Analysed Data\n");
printf("Program Aborts\n");
exit (1);
};
} /*main*/
int Generate_Analysed_Data ( ParmDetails *buf) {
.... stuff ...
/* Initialise OpenAPI */
if (!Init_API(&InitParm)) {return(FALSE);};
.... Lots of stuff ...
/* In all cases we an now terminate the API connection */
printf("Terminate me!\n");
if (!Terminate_API) {
printf("Failure in API termination!\n");
ret_value=FALSE;
};
printf("Generate_Analysed_Data returns %d\n", ret_value);
return (ret_value);
} /*Generate_Analysed_Data*/
int Terminate_API (void) {
IIAPI_TERMPARM termParm;
IIapi_terminate(&termParm);
if ( termParm.tm_status != IIAPI_ST_SUCCESS ) {
printf( "Open_API::Terminate_API. Error in IIapi_terminate: %d\n",
termParm.tm_status );
};
return termParm.tm_status;
} /*Terminate_API*/
The diagnostic output is:
Terminate me!
Generate_Analysed_Data returns 1
Segmentation fault (core dumped)
I've run in api_trace mode (5) and the trace file (1.2M) is beautiful:
grep 'status =' $II_SYSTEM/ingres/files/api_trace.log| grep -v
SUCCESS
!IIapi_appCallback: request completed, status = NO_DATA
All the connects/disconnects are cool. All started statements are
closed, commits are issued etc.
I've run this on II2.5 and from an II2.6 installation using vnodes back to
the II2.5 database and the effect is the same.
Any Ideas gratefully received. I have the core dump and dbx but I have
no idea what I'm looking for or how to drive dbx....
Martin Bowes
--
Random Duckman Quote #20:
Ajax - By the hand of Zeus what manner of deviltry is this?
I mean... what gives?
.
- Prev by Date: Re: [Info-ingres] vnode puzzle
- Next by Date: Re: [Info-ingres] writing VARCHAR strings including the backslash character into the database 'as is'
- Previous by thread: RE: [Info-ingres] NAIUA meeting at CA World 2005?
- Next by thread: RE: [Info-ingres] RE: OpenAPI Weirdness
- Index(es):
Relevant Pages
|