[AP-UTILS] Bus Error on Linux/Sparc

Erik Rossen ap-utils@kiev.iorta.com
Sun, 4 Aug 2002 08:56:08 +0200


--IiVenqGWf+H9Y6IX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 03, 2002 at 05:02:21PM +0300, Roman Festchook wrote:
> On ??? 31 ??? 2002 15:36, Erik Rossen wrote:
> > The problem seems to be coming from the fact that raw structs are being
> > used to unpack information coming from SNMP requests.  One of the hard
> > lessons to learn in C is *never* use structs to unpack a data stream -
> > always parse it piece-by-piece, even if it is painfully unelegant.  This
> > is also necessary for taking care of endianess conversion.
> I rewrote code to do not use structures for unpack data comming from AP. =
Hope=20
> this fix problems with nonintel architectures. Latest tarball accesible a=
t=20
> web site:  http://ap-utils.polesye.net/files/ap-utils-1.0.3-020802.tar.bz=
2.
> Please test and report about success or fail.

Did you also look into the endianess problems?  Parsing the data into a
structure field-by-field is good and will stop bus errors from occuring,
but it will not stop 0xAABBCCDD from being misinterpretted as
0xDDCCBBAA.

> > This software will probably never reliably work on any architecture
> > except i386 until it is re-written to not use structs for unpacking.  I
> I think its done - wait for your test.

I will take a look at it today.  I will also be checking for endianess.

> > feel sorry for the guy who posted an ITP on debian-devel: he has a lot
> > of work in front of him.
> What you mean?

Most of the people in Debian who file an ITP (Intent To Package) are
usually unwilling or unable to test it on any archecture except i386.
If the software has any architecture-related issues, they have a very
difficult time trying to resolve them.  In the end, they just file a bug
report with the author of the software after struggling for a bit.


--=20
Erik Rossen                          ^    OpenPGP key: 2935D0B9
rossen@freesurf.ch                  /e\   "Use GnuPG, see the
http://people.linux-gull.ch/rossen  ---    black helicopters."

--IiVenqGWf+H9Y6IX
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9TNAHY88aPik10LkRAtyvAKCGM19UvTVgmYno/J3nQT+fpCYtMACeMR/H
11+sgSlZDdZy+851f25PL5I=
=fOQk
-----END PGP SIGNATURE-----

--IiVenqGWf+H9Y6IX--