When does a program receive SIGABRT

  • Follow


Hello experts,

I have an application which generated a core while functioning.
Examining the core with gdb, I saw that the application has received
signal 6 (SIGABRT) at a call to strcmp().

In the code I find the following lines:

static statsTableEntry *dt_find (statsTable *dt, char *appID, char
*statID, char *statInfo) {
    int pos;
    unsigned long bucketIndex;
    statsTableEntry *entry = NULL;
    char key [APP_ID_LENGTH + STAT_ID_LENGTH + EXT_STAT_DETAIL_LENGTH];

    if (dt->numEntries == 0) {
        return NULL;
    }

    if (appID == NULL || statID == NULL || statInfo == NULL) {
        cmnError (LOGGED_ERROR, "dt_find: Require appID, statID,
statInfo all non-NULL");
        return NULL;
    }

    strcpy (key, appID);
    strcat (key, statID);
    strcat (key, statInfo);

    pos = (hashBucket (dt)) [bucketIndex];

    if (pos >= 0 && pos < dt->numEntries) {

        entry = &(dt->rec [pos]);
        while ((entry->chain != -1)
            &&  (strcmp (entry->appID,  appID)      != 0    ||
                strcmp (entry->statID,  statID)     != 0    ||
                strcmp (entry->statInfo, statInfo)  != 0)) {

            entry = &(dt->rec [entry->chain]);
        }

        if (    strcmp (entry->appID,   appID)  == 0
            &&  strcmp (entry->statID,  statID) == 0
            &&  strcmp (entry->statInfo, statInfo) == 0) {

            return entry;
        }
    }

    return NULL;
}

Can someone tell me the source of the problem. I mean is it possible
that at the time of strcmp(), some other process sends SIGABRT to my
application. Is there any system log which can tell me what signals
have been sent to what processes or something like that. Any link or
information will be appreciated.

Thank you.

0
Reply pktiwary (82) 4/27/2005 5:57:03 AM


0 Replies
437 Views

(page loaded in 0.035 seconds)

Similiar Articles:





7/25/2012 5:45:35 AM


Reply: