Subject: Re: more gcc4 woes
To: Christos Zoulas <christos@astron.com>
From: Michael Lorenz <macallan@netbsd.org>
List: port-sparc
Date: 07/02/2006 19:40:20
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Jul 2, 2006, at 18:27, Christos Zoulas wrote:

> In article <20060702221317.GE28174@drowsy.duskware.de>,
> Martin Husemann  <martin@duskware.de> wrote:
>> On Sun, Jul 02, 2006 at 02:51:14PM -0400, Michael Lorenz wrote:
>>> trap type 0x7: pc=0xf010ce2c npc=0xf010ce30 psr=44000c6<S,PS>
>>> kernel: alignment fault trap
>>> Stopped in pid 430.3 (gcvs) at netbsd:sa_upcall_userret+0x1e4:
>>> std %g2, [%o0 + 0x18]
>>
>> Can you show %o0 here?
>>
>> The code is:
>>
>>        kup = kmem_zalloc(sizeof(*kup), KM_SLEEP);
>>        kup->uc_stack = sau->sau_stack;
>>
>> where kup is a ucontext_t and the store to kup->uc_stack is faulting.
>> I can't see a reason for this to happen unless kmem_zalloc returned
>> badly aligned memory (the %o0 should show that).
>
> The vmem stuff is a bit borken:
>
> #define   KMEM_QUANTUM_SIZE       sizeof(void *)  /* XXX */
>
> This will not work on the sparc when it tries to split a block.
> Maybe KMEM_QUANTUM_SIZE should be defined on a per arch basis.
>
> For now, try:
>
> #ifdef __sparc__
> #define   KMEM_QUANTUM_SIZE       sizeof(long long)
> #else
> #define   KMEM_QUANTUM_SIZE       sizeof(void *)
> #endif

With that gcvs just works.
Strange thing though - gtk1 apps triggered the panic ( tried gcvs, 
dillo and xmms ) while gtk2 apps - like gaim - didn't.

have fun
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iQEVAwUBRKhZZMpnzkX8Yg2nAQIFSggAsHrV5zz+fQdruiVEqCy6cfujGGZNmN5a
i8uG5Noj/mIaqENp7O9Wqplg6HlaZQNmrTRc9PBcN5cbNmSjHRbAFGD5R0YdqIw3
3WxsVTdjbFbSnohRpi+dxIGRzkl1z/PrK70ka0y5VolwKGWMmLMyMq4GTR9UxNKf
gC91Ntg2uGu9tV9TgMsBiN4ZFQq50qf/KglVz1mKDcY6AcopP6+5vMSUAhmiKE+d
+JJA8gnwPBZ5jGjN5Ge/nPKA6QyVQM0MjIaDedVYkSa6vnbx+toycBOD5rHpAgjK
tRxO8TPw8cCl06xciIGJ+Nx0STb+nDPDLSiUpXv6iXFFN9s7pjEljQ==
=HoDr
-----END PGP SIGNATURE-----