Subject: Re: fontconfig-2.4.1 is seriously broken
To: Lubomir Sedlacik <salo@Xtrmntr.org>
From: Raymond Meyer <raymond.meyer@rambler.ru>
List: pkgsrc-users
Date: 10/15/2006 13:16:29
On Sun, 15 Oct 2006 10:49:13 +0200
Lubomir Sedlacik <salo@Xtrmntr.org> wrote:

> On Sun, Oct 15, 2006 at 02:55:20AM +0100, Raymond Meyer wrote:
> > On Solaris after fontconfig is built, fc-cache is run, it enters
> > endless loop consuming all available memory. I think this is
> > absolutely ridiculous, how do people manage to write such shabby
> > code??
> > 
> > Has anyone noticed this?
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=8633
> 
> regards,
> 
> -- 
> -- Lubomir Sedlacik <salo@{NetBSD,Xtrmntr,silcnet}.org>   --
> 

I used truss to see what it was doing when it was allocating huge amounts of 
memory. It seems to get stuck in the following function calls, the fragment
below is repeated over and over again

4171/1@1:                                           <- libfreetype:ft_lzwstate_stack_grow() = 0
4171/1@1:                                           -> libfreetype:ft_lzwstate_stack_grow(0x8079f3c)
4171/1@1:                                             -> libfreetype:ft_mem_realloc(0x80628f0, 0x1, 0x127577, 0x1bb036)
4171/1@1:                                               -> libfreetype:ft_mem_qrealloc(0x80628f0, 0x1, 0x127577, 0x1bb036)
4171/1@1:                                                 -> libfreetype:ft_realloc(0x80628f0, 0x127577, 0x1bb036, 0x80dd088)
4171/1@1:                                                   -> libc:realloc(0x80dd088, 0x1bb036)
4171/1@1:                                                     -> libc:lmutex_lock(0xd256a4d0)
4171/1@1:                                                     <- libc:lmutex_lock() = 0xd256a4d0
4171/1@1:                                                     -> libc:cleanfree(0x80dd088)
4171/1@1:                                                     <- libc:cleanfree() = 0
4171/1@1:                                                     -> libc:sbrk(0x0)
4171/1@1:                                                       -> libc:lmutex_lock(0xd256c568)
4171/1@1:                                                       <- libc:lmutex_lock() = 0xd256c568
4171/1@1:                                                       -> libc:_sbrk_unlocked()
4171/1@1:                                                         -> libc:_brk_unlocked(0x82047b8)
4171/1:         brk(0x082047B8)                                 = 0
4171/1@1:                                                         <- libc:_brk_unlocked() = 0
4171/1@1:                                                       <- libc:_sbrk_unlocked() = 0x82047b8
4171/1@1:                                                       -> libc:lmutex_unlock(0xd256c568)
4171/1@1:                                                       <- libc:lmutex_unlock() = 0
4171/1@1:                                                     <- libc:sbrk() = 0x82047b8
4171/1@1:                                                     -> libc:_morecore(0x1bb038)
4171/1@1:                                                       -> libc:sbrk(0x0)
4171/1@1:                                                         -> libc:lmutex_lock(0xd256c568)
4171/1@1:                                                         <- libc:lmutex_lock() = 0xd256c568
4171/1@1:                                                         -> libc:_sbrk_unlocked()
4171/1@1:                                                           -> libc:_brk_unlocked(0x82047b8)
4171/1:         brk(0x082047B8)                                 = 0
4171/1@1:                                                           <- libc:_brk_unlocked() = 0
4171/1@1:                                                         <- libc:_sbrk_unlocked() = 0x82047b8
4171/1@1:                                                         -> libc:lmutex_unlock(0xd256c568)
4171/1@1:                                                         <- libc:lmutex_unlock() = 0
4171/1@1:                                                       <- libc:sbrk() = 0x82047b8
4171/1@1:                                                       -> libc:sbrk(0x94000)
4171/1@1:                                                         -> libc:lmutex_lock(0xd256c568)
4171/1@1:                                                         <- libc:lmutex_lock() = 0xd256c568
4171/1@1:                                                         -> libc:_sbrk_unlocked()
4171/1@1:                                                           -> libc:_brk_unlocked(0x82987b8)
4171/1:         brk(0x082987B8)                                 = 0
4171/1@1:                                                           <- libc:_brk_unlocked() = 0
4171/1@1:                                                         <- libc:_sbrk_unlocked() = 0x82047b8
4171/1@1:                                                         -> libc:lmutex_unlock(0xd256c568)
4171/1@1:                                                         <- libc:lmutex_unlock() = 0
4171/1@1:                                                       <- libc:sbrk() = 0x82047b8
4171/1@1:                                                     <- libc:_morecore() = 0x80dd080
4171/1@1:                                                     -> libc:realfree(0x82980c8)
4171/1@1:                                                     <- libc:realfree() = 0x82987b8
4171/1@1:                                                     -> libc:lmutex_unlock(0xd256a4d0)
4171/1@1:                                                     <- libc:lmutex_unlock() = 0
4171/1@1:                                                   <- libc:realloc() = 0x80dd088
4171/1@1:                                                 <- libfreetype:ft_realloc() = 0x80dd088
4171/1@1:                                               <- libfreetype:ft_mem_qrealloc() = 0x80dd088
4171/1@1:                                             <- libfreetype:ft_mem_realloc() = 0x80dd088
4171/1@1:                                           <- libfreetype:ft_lzwstate_stack_grow() = 0