From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kenneth C Stahl To: help-gcc@gnu.org Subject: Re: Segmentation fault on malloc call Date: Thu, 30 Sep 1999 06:03:00 -0000 Message-id: <37F35D74.5FCA96B5@Unforgettable.com> References: <37F1267C.A43C951F@engr.tu.ac.th> X-SW-Source: 1999-09/msg00473.html What is your ulimit? Nawin Somyat wrote: > > 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: Kenneth C Stahl To: help-gcc@gnu.org Subject: Re: Segmentation fault on malloc call Date: Thu, 30 Sep 1999 23:56:00 -0000 Message-ID: <37F35D74.5FCA96B5@Unforgettable.com> References: <37F1267C.A43C951F@engr.tu.ac.th> X-SW-Source: 1999-09n/msg00473.html Message-ID: <19990930235600.BSWWfdKKEw-INHry72BcdIXp-S7QuXpapgPSzmEZM5I@z> What is your ulimit? Nawin Somyat wrote: > > 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: Kenneth C Stahl To: help-gcc@gnu.org Subject: Re: Segmentation fault on malloc call Date: Fri, 01 Oct 1999 00:00:00 -0000 Message-ID: <37F35D74.5FCA96B5@Unforgettable.com> References: <37F1267C.A43C951F@engr.tu.ac.th> X-SW-Source: 1999-q3/msg00879.html Message-ID: <19991001000000.8UaSDjobZunET_ChuGMyE2nUUqLQ1RcGPp49YHWqWkc@z> What is your ulimit? Nawin Somyat wrote: > > 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"