Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Dec 2011 10:33:55 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r228616 - head/usr.bin/tar
Message-ID:  <20111217083355.GZ50300@deviant.kiev.zoral.com.ua>
In-Reply-To: <201112170136.pBH1apEH036884@svn.freebsd.org>
References:  <201112170136.pBH1apEH036884@svn.freebsd.org>

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

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

On Sat, Dec 17, 2011 at 01:36:51AM +0000, Dimitry Andric wrote:
> Author: dim
> Date: Sat Dec 17 01:36:50 2011
> New Revision: 228616
> URL: http://svn.freebsd.org/changeset/base/228616
>=20
> Log:
>   In usr.bin/tar/tree.c, if you really want to poke to NULL, you must use
>   volatile, otherwise the indirection will not be emitted.
>  =20
>   MFC after:	1 week
>=20
> Modified:
>   head/usr.bin/tar/tree.c
>=20
> Modified: head/usr.bin/tar/tree.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/usr.bin/tar/tree.c	Sat Dec 17 01:29:46 2011	(r228615)
> +++ head/usr.bin/tar/tree.c	Sat Dec 17 01:36:50 2011	(r228616)
> @@ -315,7 +315,7 @@ tree_next(struct tree *t)
>  		const char *msg =3D "Unable to continue traversing"
>  		    " directory hierarchy after a fatal error.";
>  		write(2, msg, strlen(msg));
> -		*(int *)0 =3D 1; /* Deliberate SEGV; NULL pointer dereference. */
> +		*(volatile int *)0 =3D 1; /* Deliberate SEGV; NULL pointer dereference=
. */
>  		exit(1); /* In case the SEGV didn't work. */
>  	}
> =20
Why this hack is used instead of abort(3) or abort2(2) ?

--lpp+eiGMS9nGU1lc
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk7sU/MACgkQC3+MBN1Mb4hqWwCfV1fv1gU4yVIFa/joVJoIAph3
HWgAmwWe73QJ40q9P+POHVzGMZTtYK0E
=XdaY
-----END PGP SIGNATURE-----

--lpp+eiGMS9nGU1lc--



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