Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Aug 2002 10:19:47 -0400
From:      "Kevin B. Hendricks" <kevin.hendricks@sympatico.ca>
To:        dev@porting.openoffice.org, Martin Blapp <mb@imp.ch>
Cc:        <openoffice@FreeBSD.ORG>
Subject:   Re: [porting-dev] Re: Crash with Test-Document in the second run. Memory allocation problem
Message-ID:  <200208101019.47869.kevin.hendricks@sympatico.ca>
In-Reply-To: <20020810152027.Q92422-100000@levais.imp.ch>
References:  <20020810152027.Q92422-100000@levais.imp.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Martin,

That code does atomic increment and decrement for reference counted 
strings.

If you look further down the interlck.c file you will see a version that 
does not use the assembler version of atomic increment and decrement and 
instead uses a mutex  to guard the counts.

Try recompiling sal with the "mutex" enabled version and not the assmebler 
version and see if your trouble goes away.

If so, then the problem is with the assmebler for atomic increment and 
decrement code under FreeBSD.

Hope this helps,

Kevin

On August 10, 2002 09:24, Martin Blapp wrote:
> What may be wrong here ?
>
> (gdb) frame 1
> #1  0x285f6889 in rtl_uString_assign (ppThis=0x86cc894, pStr=0x2b822750)
>     at strtmpl.c:1370
> 1370        IMPL_RTL_AQUIRE( pStr );
> (gdb) list
> 1365
> 1366    void SAL_CALL IMPL_RTL_STRINGNAME( assign )(
> IMPL_RTL_STRINGDATA** ppThis,
> 1367                                                
> IMPL_RTL_STRINGDATA* pStr ) 1368    {
> 1369        /* must be done at first, if pStr == *ppThis */
> 1370        IMPL_RTL_AQUIRE( pStr );
> 1371
> 1372        if ( *ppThis )
> 1373            IMPL_RTL_STRINGNAME( release )( *ppThis );
> 1374
>
> (gdb) p pStr
> $1 = (struct _rtl_uString *) 0x2b822750
>
> (gdb) p ppThis
> $2 = (struct _rtl_uString **) 0x86cc894
>
> (gdb) p pStr->refCount
> $3 = 1474660693
>
> (gdb) p pStr->length
> $4 = -326937770
>
>       ^^^^^^^^^
>
> This looks very wrong to me.
>
>
> (gdb) p pStr->buffer
> $5 = {59412}
>
> (gdb) p pStr->buffer[1]
> $6 = 0
>
> If I use FORCE_SYSALLOC I end with:
>
> (gdb) frame 0
> #0  0x285e18e2 in osl_incrementInterlockedCount (pCount=0x2b822750) at
> interlck.c:81
> 81              __asm__ __volatile__ (
>
> (gdb) list
> 76
> /***********************************************************************
>******/ 77      oslInterlockedCount SAL_CALL
> osl_incrementInterlockedCount(oslInterlockedCount* pCount)
> 78      {
> 79              oslInterlockedCount nCount;
> 80
> 81              __asm__ __volatile__ (
> 82                      "movl $1, %0\n\t"
> 83                      "lock\n\t"
> 84                      "xadd %0, %1\n\t"
> 85                      "incl %0"
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@porting.openoffice.org
> For additional commands, e-mail: dev-help@porting.openoffice.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-openoffice" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208101019.47869.kevin.hendricks>