From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.sgregoratto.me (mail.sgregoratto.me [149.28.166.45]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 45ec316d for ; Thu, 18 Apr 2019 23:28:38 -0500 (EST) Received: from mail.sgregoratto.me (localhost [127.0.0.1]) by mail.sgregoratto.me (Postfix) with ESMTP id E016A3E8C6 for ; Fri, 19 Apr 2019 14:28:34 +1000 (AEST) Authentication-Results: mail.sgregoratto.me (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=sgregoratto.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sgregoratto.me; h=user-agent:content-disposition:content-type:content-type :mime-version:message-id:subject:subject:to:from:from:date:date; s=dkim; t=1555648114; x=1558240115; bh=m3nfaCWjEFlg7wiaMdy4uXA0 bVX6GKeBdzvnMV3V2LI=; b=mm9CutVL2B2yCMVTLsxVxMbEs65jhq3nEDHXSBmm 8hue6RSzbrCvczlDos0MK5IsLJ/aBizCnja9nSJgrvbm4Ad2e3a98UuyFGMfZrbu jM+It6eGs6bhPRN5lcViv5Fu63UtkV/sddyb7klGW1YCi3yMz6/0MY9rI6G+M/V8 /4M= X-Virus-Scanned: Debian amavisd-new at mail.sgregoratto.me Received: from mail.sgregoratto.me ([127.0.0.1]) by mail.sgregoratto.me (mail.sgregoratto.me [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BA39SpQhU1hE for ; Fri, 19 Apr 2019 14:28:34 +1000 (AEST) Received: from localhost (172.44.179.58.sta.dodo.net.au [58.179.44.172]) by mail.sgregoratto.me (Postfix) with ESMTPSA id 12F7E3E8B3 for ; Fri, 19 Apr 2019 14:28:34 +1000 (AEST) Date: Fri, 19 Apr 2019 14:28:33 +1000 From: Stephen Gregoratto To: tech@mandoc.bsd.lv Subject: [docbook2mdoc] Segfault encountering href attr in xml preamble(s) Message-ID: <20190419042833.r5h33msa4h3pbej5@BlackBox> Mail-Followup-To: tech@mandoc.bsd.lv X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: NeoMutt/20180716 I tried testing the new 1.0.0 release on some of my files and came across this bug. Some refentry files encode their chosen xsl stylesheet by putting it in the file itself. I believe this is to help converters like xmlto(1). The format is: When docbook2mdoc encounters the href attribute, it eventually calls xml_attrkey() in parse.c, failing in the TAILQ_INSERT_TAIL macro. Having stepped through the code in GDB, I believe this is because the queue hasn't been allocated yet. I also realised that this happens on any xml declaration. The smallest - and of course invalid - file that triggers this behaviour is: or even smaller: -- Stephen Gregoratto PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8B -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv