[Gems-users] Receiving SIGSEGV when running gnome on LogTM


Date: Thu, 17 Sep 2009 03:02:55 -0700
From: ruzhu <kaoruzhu@xxxxxxxxx>
Subject: [Gems-users] Receiving SIGSEGV when running gnome on LogTM
Hi all:
   I have compiled gnome from STAMP which I got from Jayaram Bobba with
some minor modifications. However the results come out does indicate
some abnormal events happened during its executing. When I use gdb to
debug the program, it shows that:

/**below is the out put from gdb**/
(gdb) r -g256 -s16 -n 16384
.......
I'm using this value
binding to cabinet 1

Program rerceived signal SIGSEGV, Segmentation fault.
memory_private_get (threadID=100012, numByte=136) at ../lib/memory.c:323
323	block_t* blockptr = poolPtr->blocksPtr; 

/**end the output of gdb**/

it seems related to malloc call. Below are the summary of the related
codes:

/** starting codes **/
static void*
getMemoryFromPool (pool_t* poolPtr, size_t numByte)
{
    block_t* blockPtr = poolPtr->blocksPtr;
    
    /* Align allocation to prevent misaligned stores in SPARC */  
    size_t alignSize = (blockPtr->size % numByte == 0) ? 0 : (numByte -
blockPtr->size % numByte);

    if ((blockPtr->size + alignSize + numByte) > blockPtr->capacity) {
#ifdef SIMULATOR
        assert(0);
#endif
#ifdef LOGTM
        LOGTM_ASSERT(0)
#endif                
        blockPtr = addBlockToPool(poolPtr, alignSize + numByte);
        if (blockPtr == NULL) {
            return NULL;
        }
    }

    return getMemoryFromBlock(blockPtr, numByte);
}


void*
memory_get( int threadID, size_t numByte )
{
    pool_t* poolPtr;
    void* dataPtr;

    poolPtr = global_memoryPtr->pools[threadID];
    dataPtr = getMemoryFromPool(poolPtr, numByte);

    return dataPtr;
}

/**ending  codes**/

Using these to convert system malloc to user call,add them to tm.h

#  define TM_MALLOC(size)           \
    _tm_malloc(size) 
 
__TM_INLINE__ void*
_tm_malloc (int size)
{
    void *ptr;      
    BEGIN_ESCAPE
    ptr = memory_get(TM_SIM_GET_THREAD_ID(), size);
    END_ESCAPE
    return ptr;
}
  
the output of XACT are these:
 XACT CYCLE BREAKDOWN 
 XACT_BREAKDOWN_NON_TRANS_CYCLES:  1420144
 XACT_BREAKDOWN_TRANS_CYCLES:      40537890
 XACT_BREAKDOWN_GOOD_TRANS_CYCLES: 40537890
 XACT_BREAKDOWN_ABORTING_CYCLES:   0
 XACT_BREAKDOWN_COMMITING_CYCLES:  0
 XACT_BREAKDOWN_BACKOFF_CYCLES:    0
 XACT_BREAKDOWN_BARRIER_CYCLES:    999
 XACT_BREAKDOWN_STALL_CYCLES:      0

 XACT_TIMED_CYCLES:      0

does anyone ever encounter this problem before, could you guide me how
to solve this problem. 
any comments will be welcomed.
thanks in advance.

[← Prev in Thread] Current Thread [Next in Thread→]
  • [Gems-users] Receiving SIGSEGV when running gnome on LogTM, ruzhu <=