From owner-freebsd-hackers@freebsd.org Sat Dec 29 12:54:41 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE197141BBA8 for ; Sat, 29 Dec 2018 12:54:41 +0000 (UTC) (envelope-from srs0=/ph1=pg=sigsegv.be=kristof@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BEE26D454 for ; Sat, 29 Dec 2018 12:54:40 +0000 (UTC) (envelope-from srs0=/ph1=pg=sigsegv.be=kristof@codepro.be) Received: from [10.0.2.193] (ptr-8rh08k1xb3xxxgjknkb.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:240e:402:fdd0:982a:91a4:374b]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 5CD8B31066; Sat, 29 Dec 2018 13:54:31 +0100 (CET) From: "Kristof Provost" To: "Mark Saad" Cc: "Chris Torek" , "FreeBSD Hackers" Subject: Re: libxo question Date: Sat, 29 Dec 2018 13:54:29 +0100 X-Mailer: MailMate (2.0BETAr6133) Message-ID: In-Reply-To: References: <201812282040.wBSKeWPL023999@elf.torek.net> MIME-Version: 1.0 X-Rspamd-Queue-Id: 9BEE26D454 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dmarc=fail reason="" header.from=sigsegv.be (policy=none); spf=pass (mx1.freebsd.org: domain of srs0=/ph1=pg=sigsegv.be=kristof@codepro.be designates 2a01:4f8:162:1127::2 as permitted sender) smtp.mailfrom=srs0=/ph1=pg=sigsegv.be=kristof@codepro.be X-Spamd-Result: default: False [-5.69 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[sigsegv.be : SPF not aligned (relaxed), No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:162:1127::2]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(-2.66)[ip: (-8.10), ipnet: 2a01:4f8::/29(-2.79), asn: 24940(-2.42), country: DE(-0.01)]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.7.2.1.1.2.6.1.0.8.f.4.0.1.0.a.2.list.dnswl.org : 127.0.9.2]; MX_GOOD(-0.01)[mx2.codepro.be,mx1.codepro.be]; NEURAL_HAM_SHORT(-0.92)[-0.917,0]; FORGED_SENDER(0.30)[kristof@sigsegv.be,srs0=/ph1=pg=sigsegv.be=kristof@codepro.be]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; FROM_NEQ_ENVFROM(0.00)[kristof@sigsegv.be,srs0=/ph1=pg=sigsegv.be=kristof@codepro.be]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 12:54:42 -0000 On 28 Dec 2018, at 23:12, Mark Saad wrote: > On Fri, Dec 28, 2018 at 3:40 PM Chris Torek > wrote: >> >>> Attached is a copy of the xml. Any guidance would be helpful. >> >> Your attachment was stripped before it got here, but the problem >> is clear enough. Procstat / libxo is generating invalid XML. >> >> Here's a bit of sample "procstat --libxo xml" output, which >> I generated locally by running >> >> procstat --libxo xml -ta >> >> and hand massaging the result: >> >> >> >> <0> >> 0 >> kernel >> >> <100000> >> 100000 >> swapper >> -1 >> [snip] >> >> Valid XML tags must begin with an alphabetic character or an >> underscore (see https://www.w3schools.com/xml/xml_elements.asp), >> and neither <0> nor <100000> do so. >> >> A quick workaround is to use json instead. However, libxo >> probably should "work smarter" with tags. >> >> (XML is a terrible data-encoding language because of all of its >> special rules. If you think you've found them all, watch out for >> CDATA! JSON is better but still has some issues with encoding, >> requiring that arbitrary binary data be atob or base64 encoded or >> similar.) >> >> Chris > > I updated the patch form kb to work on 12 > https://mirrors.nycbug.org/pub/patches/procstat-libxo-12-STABLE.patch > > Here is the xml output as well > https://mirrors.nycbug.org/pub/patches/procstat.xml > > This works better then before and python's xml parser, mozilla and > edge think its valid xml. > > I think this should be fixed what should we do to make it happen ? > I’ve posted https://reviews.freebsd.org/D18679 as a more generic way of addressing this. It’s quite possible that there are other users of libxo with the same problem, and this will help all of them. Regards, Kristof