look for help!

junjie_lu@sohu.com
Wed, 15 May 2002 10:45:03 +0800 (CST)


When i use the function "malloc",i meet a mistake.The error message is "segmentation fault".
the code is :
typedef struct Link
{
int num;
int *data;
Link *nexe;
}Link;
Link *mLink;
void *p=malloc(sizeof(Link));
mLink=(Link *)p;
In my code,I use them for several times,there is no error,but when the number of item in frame stack arrive 10,then occur the error.
when the error occur ,the status of the frame stack is
#0 0x40128341 in chunk_alloc(ar_ptr=0x401d1f00,nb=16) at malloc.c:2781
#1 0x4012813a in __libc_malloc(bytes=12) at mallo.c:2714
2781 malloc.c:No such file or directory
#2 0x08070c78 in................
................................
#10 ...................................
But these code is right under Windows + VC 6.0.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/