NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: jemalloc SEGV problem



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