Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jun 2018 13:56:18 -0400
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Mark Johnston <markj@freebsd.org>, "O. Hartmann" <ohartmann@walstatt.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt
Message-ID:  <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org>
In-Reply-To: <20180609173951.GB1394@pesky>
References:  <201806091510.w59FAnIW036815@repo.freebsd.org> <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> <20180609173951.GB1394@pesky>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--xAno8dCexq5pH0BiwSog1ZnXvV9NY1ODs
Content-Type: multipart/mixed; boundary="N11eYmmkGd9QdcWYJEoq1ie8ISq3Cx3ZB";
 protected-headers="v1"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Mark Johnston <markj@freebsd.org>, "O. Hartmann" <ohartmann@walstatt.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Message-ID: <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org>
Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt
References: <201806091510.w59FAnIW036815@repo.freebsd.org>
 <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de>
 <20180609173951.GB1394@pesky>
In-Reply-To: <20180609173951.GB1394@pesky>

--N11eYmmkGd9QdcWYJEoq1ie8ISq3Cx3ZB
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 6/9/18 1:39 PM, Mark Johnston wrote:
> On Sat, Jun 09, 2018 at 07:35:00PM +0200, O. Hartmann wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA512
>>
>> Am Sat, 9 Jun 2018 15:10:49 +0000 (UTC)
>> Mark Johnston <markj@FreeBSD.org> schrieb:
>>
>>> Author: markj
>>> Date: Sat Jun  9 15:10:49 2018
>>> New Revision: 334883
>>> URL: https://svnweb.freebsd.org/changeset/base/334883
>>>
>>> Log:
>>>   Don't process DWARF generated from non-C/C++ code.
>>>  =20
>>>   ctfconvert(1) is not designed to handle DWARF generated from such c=
ode,
>>>   and will generally fail in non-obvious ways.  Use an explicit check=
 to
>>>   help catch such potential failures.
>>>  =20
>>>   Reported by:	Johannes Lundberg <johalun0@gmail.com>
>>>   MFC after:	2 weeks
>>>
>>> Modified:
>>>   head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
>>>
>>> Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.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/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c	Sat Jun  9 15=
:10:39
>>> 2018	(r334882) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.=
c
>>> Sat Jun  9 15:10:49 2018	(r334883) @@ -1901,7 +1901,7 @@ should_have_=
dwarf(Elf
>>> *elf) int
>>>  dw_read(tdata_t *td, Elf *elf, char *filename __unused)
>>>  {
>>> -	Dwarf_Unsigned abboff, hdrlen, nxthdr;
>>> +	Dwarf_Unsigned abboff, hdrlen, lang, nxthdr;
>>>  	Dwarf_Half vers, addrsz, offsz;
>>>  	Dwarf_Die cu =3D 0;
>>>  	Dwarf_Die child =3D 0;
>>> @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename _=
_unused
>>>  	}
>>> =20
>>>  	if ((rc =3D dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abbof=
f,
>>> -		&addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) !=3D DW_DLV_OK) {
>>> -		if (dw.dw_err.err_error =3D=3D 	DW_DLE_NO_ENTRY)
>>> +	    &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) !=3D DW_DLV_OK) {
>>> +		if (dw.dw_err.err_error =3D=3D DW_DLE_NO_ENTRY)
>>>  			exit(0);
>>>  		else
>>>  			terminate("rc =3D %d %s\n", rc, dwarf_errmsg(dw.dw_err));
>>> @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename =
__unused
>>>  		debug(1, "DWARF emitter: %s\n", prod);
>>>  		free(prod);
>>>  	}
>>> +
>>> +	if (dwarf_attrval_unsigned(cu, DW_AT_language, &lang, &dw.dw_err) =3D=
=3D 0)
>>> +		switch (lang) {
>>> +		case DW_LANG_C:
>>> +		case DW_LANG_C89:
>>> +		case DW_LANG_C99:
>>> +		case DW_LANG_C11:
>>> +		case DW_LANG_C_plus_plus:
>>> +		case DW_LANG_C_plus_plus_03:
>>> +		case DW_LANG_C_plus_plus_11:
>>> +		case DW_LANG_C_plus_plus_14:
>>> +			break;
>>> +		default:
>>> +			terminate("file contains DWARF for unsupported "
>>> +			    "language %d", lang);
>>> +		}
>>> +	else
>>> +		warning("die %llu: failed to get language attribute: %s\n",
>>> +		    die_off(&dw, cu), dwarf_errmsg(dw.dw_err));
>>> =20
>>>  	if ((dw.dw_cuname =3D die_name(&dw, cu)) !=3D NULL) {
>>>  		char *base =3D xstrdup(basename(dw.dw_cuname));
>>> _______________________________________________
>>> svn-src-head@freebsd.org mailing list
>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.or=
g"
>> This commit makes buildworld (WITH_META_MODE) failing:
>=20
> I added these identifiers in r334881, and the CI build is passing. Migh=
t
> this be a problem with META_MODE?
>=20
>> [...]
>> =3D=3D=3D> cddl/usr.bin/ctfconvert (obj,all,install)
>> Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfco=
nvert/dwarf.o

obj-tools means it is trying to build a HOST NATIVE version of this.
Where are these defined? In this case they need to be defined in
/usr/include already unless the build has -I.CURDIR/somewhere/to/headers
instead.

>> - --- dwarf.o ---
>> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1980:8: error:=
 use of undeclared
>> identifier 'DW_LANG_C11' case DW_LANG_C11:
>>                      ^
>> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1982:8: error:=
 use of undeclared
>> identifier 'DW_LANG_C_plus_plus_03' case DW_LANG_C_plus_plus_03:
>>                      ^
>> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1983:8: error:=
 use of undeclared
>> identifier 'DW_LANG_C_plus_plus_11' case DW_LANG_C_plus_plus_11:
>>                      ^
>> /usr/src/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c:1984:8: error:=
 use of undeclared
>> identifier 'DW_LANG_C_plus_plus_14' case DW_LANG_C_plus_plus_14:
>>                      ^
>> 4 errors generated.
>> *** [dwarf.o] Error code 1


--=20
Regards,
Bryan Drewery


--N11eYmmkGd9QdcWYJEoq1ie8ISq3Cx3ZB--

--xAno8dCexq5pH0BiwSog1ZnXvV9NY1ODs
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAlscFMIACgkQNddxu25G
l88pIAgApDMCc6Fp4TsWioe0uuL9ro98tgHa2rtemKiyB/W20I7UhBniUOLSv8oQ
X8UFUM10NEeBT0qpYpH1T2x1JfN4f0fu5K0mDqL67j6hgJItTZqSr+O7Q7y8t6v9
ki1LFDBQpurwXPTQ54UpL2Oi+dfsqCZB//7ja/AsSUlvqXyt9ybnWA7AtBbriF8l
j6jARKc4jFhhsgg+xxbUGnak8B/5CMYU3/uQK5m9TqaDJdb5DRzB+d43DG0rNM41
EXmS7dyfipBZguLpAkU+J1rFLhB5ul1sP6V2YcvsCL/qcTwIhQ++5qjG89SC6lg2
TIFSU9A0Wrt7Rsk84LlGK8CsCCp/Rw==
=MbHG
-----END PGP SIGNATURE-----

--xAno8dCexq5pH0BiwSog1ZnXvV9NY1ODs--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?80b8176b-61c5-c3b2-49b1-36ba9be77d1b>