Domino on Linux/Unix, Troubleshooting, Best Practices, Tips and more ...

FTIndex Crash with C-API based tools caused by a change in D8.5.3

Daniel Nashed  10 April 2012 08:43:21

We ran into this problem quite badly and the root cause was hard to track.
One of my applications (nshrun -- a tool to do multiple tasks in parallel on multiple databases) started to crash without a meaningful call-stack.
I started to figure out the root cause and identified that the C-API call FTIndex causes a crash of the calling function because the stack is damaged.

It turned out that IBM changed the structure of the statistic buffer for FTIndex by adding two new variables.
This change caused incompatibility with all existing applications using this structure with FTIndex.
When using a previous version of the C-API toolkit the memory buffer passed to the function was to small and the function did overwrite memory which caused the stack to be corrupt.

The problem exists with 8.5.3 and 8.5.3 FP1 and will be corrected in 8.5.3 FP2 and 8.5.4. The exposed structure will be reverted back to the old format.
In the meantime to get your application working you have multiple options

a.) wait for 8.5.3 FP2 or 8.5.4
b.) don't use the statistics returned and pass NULL as the parameter
c.) recompile just for 8.5.3 with the current 8.5.3 C-API
d.) redefine the structure in your earlier toolkit version and compile -- for older versions the bigger buffer does not cause any issues

There is a upcoming technote (TN #1590244) which is not yet released and the SPR we got for the problem is APAR#LO68258/SPR #VDES8SMFCJ.

I am going to compile my applications with a changed header structure to ensure it will continue to work with all releases of Domino.

-- Daniel



STATUS LNPUBLIC FTIndex(DBHANDLE hDB,WORD Options,char far *StopFile, FT_INDEX_STATS far *retStats);

In version 853, the structure FT_INDEX_STATS was updated as shown below in both product code and the C API toolkit.
typedef struct
{
DWORD DocsAdded; /* # of new documents */
DWORD DocsUpdated; /* # of revised documents */
DWORD DocsDeleted; /* # of deleted documents */
DWORD BytesIndexed; /* # of bytes indexed */
DWORD Merges; /* # of index merges */
DWORD MergeMsec; /* Msec spent merging */
}
FT_INDEX_STATS;

In previous versions on the product, this structure was defined as shown below.
typedef struct
{
DWORD DocsAdded; /* # of new documents */
DWORD DocsUpdated; /* # of revised documents */
DWORD DocsDeleted; /* # of deleted documents */
DWORD BytesIndexed; /* # of bytes indexed */
}
FT_INDEX_STATS;