NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: jemalloc SEGV problem
Hi,
Yes i included
All these header files.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char *ptr;
ptr=malloc(10);
strcpy(ptr,"hello");
printf("%s\n",ptr);
return 0;
}
But i am not able to understand where exactly is the problem to use jemalloc.c
Since in the jemalloc.c code i have not modified much apart from the
things i mentioned in my prev mail.
Thanks in Advance,
Channagoud
2008/11/6 Christos Zoulas <christos%astron.com@localhost>:
> In article
> <515c64960811060431g3f4301e3se4a52cb4183a5f95%mail.gmail.com@localhost>,
> Channa <channa.kad%gmail.com@localhost> wrote:
>>Hi,
>>I am using the jemalloc.c file for my own library i could successfully build
>>it.
>>
>>But when i run a test cases i am getting segmentation fault.
>>
>>The stack trace is as below:
>>#0 0x4006c304 in arena_run_split () from
>>/home/channagoud/channagoud_work/ARM/GIT/jemalloc/sslibc/build/lib//libsonyc.so
>>#1 0x4006cb6c in arena_run_alloc () from
>>/home/channagoud/channagoud_work/ARM/GIT/jemalloc/sslibc/build/lib//libsonyc.so
>>#2 0x4006e8a4 in arena_malloc () from
>>/home/channagoud/channagoud_work/ARM/GIT/jemalloc/sslibc/build/lib//libsonyc.so
>>#3 0x4006ea50 in malloc () from
>>/home/channagoud/channagoud_work/ARM/GIT/jemalloc/sslibc/build/lib//libsonyc.so
>>#4 0x4007512c in __smakebuf () from
>>/home/channagoud/channagoud_work/ARM/GIT/jemalloc/sslibc/build/lib//libsonyc.so
>>#5 0x4007ab08 in __swsetup () from
>>/home/channagoud/channagoud_work/ARM/GIT/jemalloc/sslibc/build/lib//libsonyc.so
>>#6 0x400747e0 in __sfvwrite () from
>>/home/channagoud/channagoud_work/ARM/GIT/jemalloc/sslibc/build/lib//libsonyc.so
>>#7 0x400757e8 in puts () from
>>/home/channagoud/channagoud_work/ARM/GIT/jemalloc/sslibc/build/lib//libsonyc.so
>>#8 0x00008494 in main () at test.c:5
>>
>>I am getting SEGV in arena_run_split ().
>>My test case is as below:
>>
>>int main()
>>{
>>char *ptr;
>>ptr=malloc(10);
>>strcpy(ptr,"hello");
>>printf("%s\n",ptr);
>>return 0;
>>}
>>
>>But if i allocate memory huge memory as
>>int main()
>>{
>>char *ptr;
>>ptr=malloc(1000*1024);
>>strcpy(ptr,"hello");
>>printf("%s\n",ptr);
>>return 0;
>>}
>>
>
> did you #include <stdio.h>, <string.h>, <stdlib.h>?
>
> christos
>
>
Home |
Main Index |
Thread Index |
Old Index