--===============0305406689== Content-Type: multipart/signed; boundary="nextPart4013037.uS1idoFeHc"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart4013037.uS1idoFeHc Content-Type: multipart/alternative; boundary="Boundary-00=_P4xOIcuAUy5I4Dv" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-00=_P4xOIcuAUy5I4Dv Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Sunday 25 May 2008, Sebastian Sauer wrote: > raymond.meyer@rambler.ru wrote: > > I can't start kde on netbsd sparc machine, because kdelibs contains code > > that causes segfault. It terminates with "Bus error" which indicates > > unaligned memory access. Below is the backtrace. > > > > The problem is with kdelibs-4.0.4/kdeui/icons/kpixmapcache.cpp. On line > > 159 it has > > > > *mSize =3D *((quint32*)(mMemory + mSizeEntryOffset)); > > > > So looks like a pointer to char is cast to a pointer to some form of > > uint32_t and then dereferenced. Can anyone suggest a proper fix? > > iirc mMemory is the start of a buffer used to cache icons and at > mMemory+mSizeEntryOffset is a 4byte quint32 that is used to know how much > icons are within those buffer. mSizeEntryOffset needs to always point to a properly aligned memory address= =2E =20 i.e. if memory accesses must be aligned to a multiple of 16, then=20 mSizeEntryOffset must be a multiple of 16. Note that to my knowledge we wo= n't=20 hit this on x86 as that architecture will automatically (but slowly) fix it= up=20 for us. > https://bugs.kde.org/show_bug.cgi?id=3D160284 I'm not sure if this is the same bug. It depends on what architecture the = bug=20 reporter is running I think. I'll try to take a look at it but low-level=20 stuff is not my thing. ;) Regards, - Michael Pyne --Boundary-00=_P4xOIcuAUy5I4Dv Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit

On Sunday 25 May 2008, Sebastian Sauer wrote:

> raymond.meyer@rambler.ru wrote:

> > I can't start kde on netbsd sparc machine, because kdelibs contains code

> > that causes segfault. It terminates with "Bus error" which indicates

> > unaligned memory access. Below is the backtrace.

> >

> > The problem is with kdelibs-4.0.4/kdeui/icons/kpixmapcache.cpp. On line

> > 159 it has

> >

> > *mSize = *((quint32*)(mMemory + mSizeEntryOffset));

> >

> > So looks like a pointer to char is cast to a pointer to some form of

> > uint32_t and then dereferenced. Can anyone suggest a proper fix?

>

> iirc mMemory is the start of a buffer used to cache icons and at

> mMemory+mSizeEntryOffset is a 4byte quint32 that is used to know how much

> icons are within those buffer.

mSizeEntryOffset needs to always point to a properly aligned memory address. i.e. if memory accesses must be aligned to a multiple of 16, then mSizeEntryOffset must be a multiple of 16. Note that to my knowledge we won't hit this on x86 as that architecture will automatically (but slowly) fix it up for us.

> https://bugs.kde.org/show_bug.cgi?id=160284

I'm not sure if this is the same bug. It depends on what architecture the bug reporter is running I think. I'll try to take a look at it but low-level stuff is not my thing. ;)

Regards,

- Michael Pyne

--Boundary-00=_P4xOIcuAUy5I4Dv-- --nextPart4013037.uS1idoFeHc Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEABECAAYFAkg7HhMACgkQqjQYp5Omm0qVnwCg4f5wbhdDtQSslLeJvulWHB71 Rs0Anj9BZhVfXeZeq+Be9C6HdiANQ2eG =9ilr -----END PGP SIGNATURE----- --nextPart4013037.uS1idoFeHc-- --===============0305406689== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============0305406689==--