mtest, ptest segmentation fault

When I run mtest and ptest, I got segmentation fault.
From gdb, both mtest and ptest break at the following line

if (gkmcore != NULL)

Do you have any idea about this? My gcc is 4.2.0, glibc version 2.3.3.

Thanks!
Hui

RE: mpicc broken?

I just found gcc is ok to test the following program, but not for mpicc. So can I say it must be mpicc is broken?

#include
#include
#include
#include "gk_struct.h"

static __thread gk_mcore_t *ptr = NULL;

int main()
{
ssize_t ss;

if (ptr==NULL)
printf("ptr is NULL\n");

return 0;
}