[OpenSIPS-Users] segmentation fault when calling pkg_malloc

Dan Pascu dan at ag-projects.com
Sun Mar 15 04:34:42 CET 2009


On Thursday 12 March 2009, Sergio Gutierrez wrote:
> Hi Iñaki.
>
> You are right. I neither see the reason of crashing; that is why I said
> "just to be sure" (I have seen strange thins in compilers)  :-)

The backtrace clearly indicates that the segfault happens in 
mem/f_malloc.c, which is inside the memory allocator. It has nothing to 
do with his module code, other than the fact that it seems to be the 
trigger.

>
> Chevio, please, could you print the value of size at frame 0?
>
> Regards.
>
> Sergio
>
> On Wed, Mar 11, 2009 at 5:45 PM, Iñaki Baz Castillo <ibc at aliax.net> 
wrote:
> > El Miércoles, 11 de Marzo de 2009, Sergio Gutierrez escribió:
> > > After calling pkg_malloc, you should evaluate the return value; it
> >
> > returns
> >
> > > NULL if memory allocation could not be performed. That would be a
> > > way to determine whether you exhausted memory.
> >
> > True, but still I see no reason for a segmentation fault even if
> > pkg_malloc didn't success. Note that the segmentation fault occurs in
> > the line 97 (where 'pkg_malloc' is invoked), not when trying to use
> > it later (which would
> > make sense).
> >
> > Regards.
> >
> > --
> > Iñaki Baz Castillo
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users



-- 
Dan



More information about the Users mailing list