From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nawin Somyat To: help-gcc@gnu.org Subject: Segmentation fault on malloc call Date: Wed, 29 Sep 1999 13:48:00 -0000 Message-id: <37F1267C.A43C951F@engr.tu.ac.th> X-SW-Source: 1999-09/msg00457.html I'm tring to test memory allocation on my system and get SIGSEGV with the following (extracted) code ..... SYM_ENTRY* entry; if ((entry = malloc(sizeof(SYM_ENTRY)) == NULL) return (NULL); ..... where SYM_ENTRY is a pointer. When I do a loop on this code, only after a few loops, the program gives me SIGSEGV. This fault is reproducible after the same number of loops. I tried to debug on gdb and get to the point where it told me that the SIGSEGV is from _malloc_unlocked (). Can anyone give me where I should check out next? My system is Solaris 2.5 on UltraSparc I using gcc version 2.7.2.3. I also tried the same program on Solaris 2.5.1 with the same version of gcc and it gave me the same result. I use the malloc function that comes with Sun library. Thank you Nawin If possible, could you reply to my email address "snawin@engr.tu.ac.th" From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nawin Somyat To: help-gcc@gnu.org Subject: Segmentation fault on malloc call Date: Thu, 30 Sep 1999 23:56:00 -0000 Message-ID: <37F1267C.A43C951F@engr.tu.ac.th> X-SW-Source: 1999-09n/msg00457.html Message-ID: <19990930235600.Z0JOp_iXQvixnSAS8Zg7ZE-lMzDIMVbjsG4oe_yNYT0@z> I'm tring to test memory allocation on my system and get SIGSEGV with the following (extracted) code ..... SYM_ENTRY* entry; if ((entry = malloc(sizeof(SYM_ENTRY)) == NULL) return (NULL); ..... where SYM_ENTRY is a pointer. When I do a loop on this code, only after a few loops, the program gives me SIGSEGV. This fault is reproducible after the same number of loops. I tried to debug on gdb and get to the point where it told me that the SIGSEGV is from _malloc_unlocked (). Can anyone give me where I should check out next? My system is Solaris 2.5 on UltraSparc I using gcc version 2.7.2.3. I also tried the same program on Solaris 2.5.1 with the same version of gcc and it gave me the same result. I use the malloc function that comes with Sun library. Thank you Nawin If possible, could you reply to my email address "snawin@engr.tu.ac.th" From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nawin Somyat To: help-gcc@gnu.org Subject: Segmentation fault on malloc call Date: Fri, 01 Oct 1999 00:00:00 -0000 Message-ID: <37F1267C.A43C951F@engr.tu.ac.th> X-SW-Source: 1999-q3/msg00863.html Message-ID: <19991001000000.UhuUfEYyty0trz_kb4KGhsMjXIofpMVh4lME7X3kE7c@z> I'm tring to test memory allocation on my system and get SIGSEGV with the following (extracted) code ..... SYM_ENTRY* entry; if ((entry = malloc(sizeof(SYM_ENTRY)) == NULL) return (NULL); ..... where SYM_ENTRY is a pointer. When I do a loop on this code, only after a few loops, the program gives me SIGSEGV. This fault is reproducible after the same number of loops. I tried to debug on gdb and get to the point where it told me that the SIGSEGV is from _malloc_unlocked (). Can anyone give me where I should check out next? My system is Solaris 2.5 on UltraSparc I using gcc version 2.7.2.3. I also tried the same program on Solaris 2.5.1 with the same version of gcc and it gave me the same result. I use the malloc function that comes with Sun library. Thank you Nawin If possible, could you reply to my email address "snawin@engr.tu.ac.th"