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 42db8139 for ; Mon, 3 Jun 2019 21:53:34 -0500 (EST) Received: from mail.sgregoratto.me (localhost [127.0.0.1]) by mail.sgregoratto.me (Postfix) with ESMTP id 0F40A3EB47 for ; Tue, 4 Jun 2019 12:53:31 +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=1559616810; x=1562208811; bh=kXeVWlmsj2mFwfZVkHi1/sIY E0Bq8kuXaPXI5lK9gd8=; b=HIbWQWcY5NbmG06FVJnmKoarTHvN7csqHQfVZioy Aad3tL225K5oAcnKWvlJzCBIlukPtVG6uDP2yRAGvZuTQXVLUBjTLVSv2c3r0O9N Hq7Cm9HnFAgEXLOpBNc5F+9EimFEw87N8goDufKvAbf8/njuw8d//ZnGx31J/o2w 9Gw= 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 6-8pNDjLNYUD for ; Tue, 4 Jun 2019 12:53:30 +1000 (AEST) Received: from localhost (natpool-84.uow.edu.au [203.10.91.84]) by mail.sgregoratto.me (Postfix) with ESMTPSA id 36C5D3E83C for ; Tue, 4 Jun 2019 12:53:30 +1000 (AEST) Date: Tue, 4 Jun 2019 12:53:29 +1000 From: Stephen Gregoratto To: tech@mandoc.bsd.lv Subject: [mandoc] segfault due to missing tbl layout Message-ID: <20190604025329.4h75kp6lq7dyglcn@BlackBox> Mail-Followup-To: tech@mandoc.bsd.lv X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="6f625jkwgzzrc4a2" Content-Disposition: inline User-Agent: NeoMutt/20180716 --6f625jkwgzzrc4a2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Here's an interesting bug I found in the wild. First, some backstory. The aerc[1] email client uses scdoc[2] to generate its manpages (same author). Scdoc files are kinda like markdown, but they have a funky way of setting out tables (see the TABLES section of scdoc(5)[3]). So, the aerc-config document has a long table for command keys, and in the middle of it the author forgot to set the alignment for a cell. I'm attaching the formatted document, but I can trigger the same bug with this (bug.5): .TS allbox; l c l l l. Foo Bar FooBar Foo Bar .TE This occurs on Arch Linux and OpenBSD 6.5, with the latest changes from CVS. This is the output from GDB: #0 0x000055632eb7ff52 in tbl_hrule (tp=0x55632edc6d00, spp=0x55632edc31a0, sp=0x55632edc31a0, spn=0x55632edc3310, flags=1) at tbl_term.c:626 626 col = tp->tbl.cols + cp->col; (gdb) p tp->tbl.cols $2 = (struct roffcol *) 0x55632edcb890 (gdb) p cp->col Cannot access memory at address 0x24 I've tested this with groff and Plan 9 troff/tbl and they handle this fine. [1] https://git.sr.ht/~sircmpwn/aerc2 [2] https://git.sr.ht/~sircmpwn/scdoc [3] https://git.sr.ht/~sircmpwn/scdoc/blob/master/scdoc.5.scd [4] https://git.sr.ht/~sircmpwn/aerc/blob/master/doc/aerc-config.5.scd -- Stephen Gregoratto PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8B --6f625jkwgzzrc4a2 Content-Type: application/x-troff-man Content-Disposition: attachment; filename="bug.5" Content-Transfer-Encoding: quoted-printable =2ETS=0Aallbox;=0Al c=0Al=0Al l.=0AFoo Bar=0AFooBar=0AFoo Bar=0A.TE=0A --6f625jkwgzzrc4a2 Content-Type: application/x-troff-man Content-Disposition: attachment; filename="aerc-config.5" Content-Transfer-Encoding: quoted-printable =2E\" Generated by scdoc 1.9.4=0A.ie \n(.g .ds Aq \(aq=0A.el .ds Aq '= =0A.nh=0A.ad l=0A.\" Begin generated content:=0A.TH "aerc-config" "5" "2019= -06-02"=0A.P=0A.SH NAME=0A.P=0Aaerc-config - configuration file formats for= \fBaerc\fR(1)=0A.P=0A.SH CONFIGURATION=0A.P=0AThere are three aerc config = files: \fBaerc.conf\fR, \fBbinds.conf\fR, and=0A\fBaccounts.conf\fR. The la= st one must be kept secret, as it may include your=0Aaccount credentials. W= e look for these files in your XDG config home plus=0A"aerc", which default= s to ~/.config/aerc.=0A.P=0AExamples of these config files are typically in= cluded with your installation of=0Aaerc and are usually installed in /usr/s= hare/aerc.=0A.P=0AEach file uses the \fIini\fR format, and consists of sect= ions with keys and values.=0AA line beginning with # is considered a commen= t and ignored, as are empty lines.=0ANew sections begin with [section-name]= on a single line, and keys and values are=0Aseparated with "=3D".=0A.P=0A.= SH AERC.CONF=0A.P=0AThis file is used for configuring the general appearanc= e and behavior of aerc.=0A.P=0A.SS UI OPTIONS=0A.P=0AThese options are conf= igured in the \fB[ui]\fR section of aerc.conf.=0A.P=0A\fBindex-format\fR=0A= =2ERS 4=0ADescribes the format for each row in a mailbox view. This field i= s=0Acompatible with mutt's printf-like syntax. TODO: document properly=0A.P= =0ADefault: %4C %Z %D %-17.17n %s=0A.P=0A.RE=0A\fBtimestamp-format\fR=0A.RS= 4=0ASee strftime(3)=0A.P=0ADefault: %F %l:%M %p (ISO 8501 + 12 hour time)= =0A.P=0A.RE=0A\fBsidebar-width\fR=0A.RS 4=0AWidth of the sidebar, including= the border. Set to zero to disable the=0Asidebar.=0A.P=0ADefault: 20=0A.P= =0A.RE=0A\fBempty-message\fR=0A.RS 4=0AMessage to display when viewing an e= mpty folder.=0A.P=0ADefault: (no messages)=0A.P=0A.RE=0A.SS VIEWER=0A.P=0AT= hese options are configured in the \fB[viewer]\fR section of aerc.conf.=0A.= P=0A\fBpager\fR=0A.RS 4=0ASpecifies the pager to use when displaying emails= =2E Note that some filters=0Amay add ANSI escape sequences to add color to = rendered emails, so you may=0Awant to use a pager which supports ANSI.=0A.P= =0ADefault: less -R=0A.P=0A.RE=0A\fBalternatives\fR=0A.RS 4=0AIf an email o= ffers several versions (multipart), you can configure which=0Amimetype to p= refer. For example, this can be used to prefer plaintext over=0AHTML emails= =2E=0A.P=0ADefault: text/plain,text/html=0A.P=0A.RE=0A.SS COMPOSE=0A.P=0ATh= ese options are configured in the \fB[viewer]\fR section of aerc.conf.=0A.P= =0A\fBeditor\fR=0A.RS 4=0ASpecifies the command to run the editor with. It = will be shown in an=0Aembedded terminal, though it may also launch a graphi= cal window if the=0Aenvironment supports it. Defaults to \fB$EDITOR\fR, or = \fBvi\fR(1).=0A.P=0A.RE=0A.SS FILTERS=0A.P=0AFilters allow you to pipe an e= mail body through a shell command to render=0Acertain emails differently, e= =2Eg. highlighting them with ANSI escape codes.=0AThey are configured in th= e \fB[filters]\fR section of aerc.conf.=0A.P=0AThe first filter which match= es the email's mimetype will be used, so order=0Athem from most to least sp= ecific.=0A.P=0AYou can also match on non-mimetypes, by prefixing with the h= eader to match=0Aagainst (non-case-sensitive) and a comma, e.g. subject,tex= t will match a=0Asubject which contains "text". Use header,~regex to match = against a regex.=0A.P=0AMost aerc installations come with some useful filte= rs, typically installed in=0A/usr/share/aerc/filters. Here is an example co= nfig which uses these filters:=0A.P=0A.nf=0A.RS 4=0Asubject,~^[PATCH=3D/usr= /share/aerc/filters/hldiff\&.py=0Atext/html=3D/usr/share/aerc/filters/html= =0Atext/*=3D/usr/share/aerc/filters/plaintext\&.py=0A.fi=0A.RE=0A.P=0ANote = that the filters which are installed with aerc have additional=0Adependenci= es, such as Python, colorama, socksify, and w3m.=0A.P=0A.SH ACCOUNTS.CONF= =0A.P=0AThis file is used for configuring each mail account used for aerc. = Each section=0Ais the name of an account you want to configure, and the key= s & values in that=0Asection specify details of that account's configuratio= n. In addition to the=0Aoptions documented here, specific transports for in= coming and outgoing emails=0Amay have additional configuration parameters, = documented on their respective man=0Apages.=0A.P=0ANote that many of these = configuration options are written for you, such as=0A\fBsource\fR and \fBou= tgoing\fR, when you run the account configuration wizard=0A(\fB:new-account= \fR).=0A.P=0A\fBcopy-to\fR=0A.RS 4=0ASpecifies a folder to copy sent mails = to, usually "Sent".=0A.P=0ADefault: none=0A.P=0A.RE=0A\fBdefault\fR=0A.RS 4= =0ASpecifies the default folder to open in the message list when aerc=0Acon= figures this account.=0A.P=0ADefault: INBOX=0A.P=0A.RE=0A\fBfolders\fR=0A.R= S 4=0ASpecifies the list of folders to display in the sidebar.=0A.P=0ADefau= lt: all folders=0A.P=0A.RE=0A\fBfrom\fR=0A.RS 4=0AThe default value to use = for the From header in new emails. This should be=0Aan RFC 5322-compatible = string, such as "Your Name ".=0A.P=0ADefault: none=0A.P=0A= =2ERE=0A\fBoutgoing\fR=0A.RS 4=0ASpecifies the transport for sending outgoi= ng emails on this account. It=0Ashould be a connection string, and the spe= cific meaning of each component=0Avaries depending on the protocol in use. = See each protocol's man page for=0Amore details:=0A.P=0A.RS 4=0A.ie n \{\= =0A\h'-04'\(bu\h'+03'\c=0A.\}=0A.el \{\=0A.IP \(bu 4=0A.\}=0A\fBaerc-smtp\f= R(5)=0A=0A.RE=0A.P=0A.RE=0A\fBoutgoing-cred-cmd\fR=0A.RS 4=0ASpecifies an o= ptional command that is run to get the outgoing account's=0Apassword. See e= ach protocol's man page for more details.=0A.P=0ADefault: none=0A.P=0A.RE= =0A\fBsource\fR=0A.RS 4=0ASpecifies the source for reading incoming emails = on this account. This key=0Ais required for all accounts. It should be a co= nnection string, and the=0Aspecific meaning of each component varies depend= ing on the protocol in use.=0ASee each protocol's man page for more details= :=0A.P=0A.RS 4=0A.ie n \{\=0A\h'-04'\(bu\h'+03'\c=0A.\}=0A.el \{\=0A.IP \(b= u 4=0A.\}=0A\fBaerc-imap\fR(5)=0A=0A.RE=0A.P=0ADefault: none=0A.P=0A.RE=0A\= fBsource-cred-cmd\fR=0A.RS 4=0ASpecifies an optional command that is run to= get the source account's=0Apassword. See each protocol's man page for more= details.=0A.P=0A.P=0A.RE=0A.SH BINDS.CONF=0A.P=0AThis file is used for con= figuring keybindings used in the aerc interactive=0Aclient. You may configu= re different keybindings for different contexts by=0Awriting them into diff= erent \fB[sections]\fR of the ini file. The available contexts=0Aare:=0A.P= =0A\fB[messages]\fR=0A.RS 4=0Akeybindings for the message list=0A.P=0A.RE= =0A\fB[view]\fR=0A.RS 4=0Akeybindings for the message viewer=0A.P=0A.RE=0A\= fB[compose]\fR=0A.RS 4=0Akeybindings for the message composer=0A.P=0A.RE=0A= \fB[compose::editor]\fR=0A.RS 4=0Akeybindings for the composer, when the ed= itor is focused=0A.P=0A.RE=0A\fB[compose::review]\fR=0A.RS 4=0Akeybindings = for the composer, when reviewing the email before it's sent=0A.P=0A.RE=0A\f= B[terminal]\fR=0A.RS 4=0Akeybindings for terminal tabs=0A.P=0A.RE=0AYou may= also configure global keybindings by placing them at the beginning of=0Ath= e file, before specifying any context-specific sections. For each \fBkey=3D= value\fR=0Aoption specified, the \fIkey\fR is the keystrokes pressed (in or= der) to invoke this=0Akeybinding, and \fIvalue\fR specifies keystrokes that= aerc will simulate when the=0Akeybinding is invoked. Generally this is use= d to execute commands, for example:=0A.P=0A.RS 4=0Arq =3D :reply -q= =0A.P=0A.RE=0APressing r, then q, will simulate typing in ":reply -q= ", and execute=0A:reply -q accordingly. It is also possible to invoke keybi= ndings recursively in=0Aa similar fashion. Additionally, the following spec= ial options are available in=0Aeach binding context:=0A.P=0A\fB$noinherit\f= R=0A.RS 4=0AIf set to "true", global keybindings will not be effective in t= his context.=0A.P=0ADefault: false=0A.P=0A.RE=0A\fB$ex\fR=0A.RS 4=0AThis ca= n be set to a keystroke which will bring up the command input in this=0Acon= text.=0A.P=0ADefault: =0A.P=0A.RE=0AIn addition to letters, spec= ial keys may be specified in . The=0Afollowing special keys= are supported:=0A.P=0A.TS=0Aallbox;l c=0Al c=0Al c=0Al c=0Al c=0Al c=0Al c= =0Al c=0Al c=0Al c=0Al c=0Al c=0Al c=0Al c=0Al c=0Al c=0Al c=0Al c=0Al c=0A= l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l= =0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l=0A= l l=0Al l=0Al l=0Al l=0Al l=0Al l=0Al l.=0AT{=0A\fBName\fR=0AT} T{=0A\fBDes= cription\fR=0AT}=0AT{=0Aspace=0AT} T{=0A" "=0AT}=0AT{=0Asemicolon=0AT} T{= =0A;=0AT}=0AT{=0Atab=0AT} T{=0A=0AT}=0AT{=0Aenter=0AT} T{=0A=0AT}=0AT{=0Aup= =0AT} T{=0A=0AT}=0AT{=0Adown=0AT} T{=0A=0AT}=0AT{=0Aright=0AT} T{=0A=0AT}= =0AT{=0Aleft=0AT} T{=0A=0AT}=0AT{=0Apgup=0AT} T{=0A=0AT}=0AT{=0Apgdn=0AT} T= {=0A=0AT}=0AT{=0Ahome=0AT} T{=0A=0AT}=0AT{=0Aend=0AT} T{=0A=0AT}=0AT{=0Ains= ert=0AT} T{=0A=0AT}=0AT{=0Adelete=0AT} T{=0A=0AT}=0AT{=0Aexit=0AT} T{=0A=0A= T}=0AT{=0Acancel=0AT} T{=0A=0AT}=0AT{=0Aprint=0AT} T{=0A=0AT}=0AT{=0Apause= =0AT} T{=0A=0AT}=0AT{=0Abacktab=0AT}=0AT{=0Ac-space=0AT} T{=0ACtrl+Space=0A= T}=0AT{=0Ac-a=0AT} T{=0ACtrl+a=0AT}=0AT{=0Ac-b=0AT} T{=0ACtrl+b=0AT}=0AT{= =0Ac-c=0AT} T{=0ACtrl+c=0AT}=0AT{=0Ac-d=0AT} T{=0ACtrl+d=0AT}=0AT{=0Ac-e=0A= T} T{=0ACtrl+e=0AT}=0AT{=0Ac-f=0AT} T{=0ACtrl+f=0AT}=0AT{=0Ac-g=0AT} T{=0AC= trl+g=0AT}=0AT{=0Ac-h=0AT} T{=0ACtrl+h=0AT}=0AT{=0Ac-i=0AT} T{=0ACtrl+i=0AT= }=0AT{=0Ac-j=0AT} T{=0ACtrl+j=0AT}=0AT{=0Ac-k=0AT} T{=0ACtrl+k=0AT}=0AT{=0A= c-l=0AT} T{=0ACtrl+l=0AT}=0AT{=0Ac-m=0AT} T{=0ACtrl+m=0AT}=0AT{=0Ac-n=0AT} = T{=0ACtrl+n=0AT}=0AT{=0Ac-o=0AT} T{=0ACtrl+o=0AT}=0AT{=0Ac-p=0AT} T{=0ACtrl= +p=0AT}=0AT{=0Ac-q=0AT} T{=0ACtrl+q=0AT}=0AT{=0Ac-r=0AT} T{=0ACtrl+r=0AT}= =0AT{=0Ac-s=0AT} T{=0ACtrl+s=0AT}=0AT{=0Ac-t=0AT} T{=0ACtrl+t=0AT}=0AT{=0Ac= -u=0AT} T{=0ACtrl+u=0AT}=0AT{=0Ac-v=0AT} T{=0ACtrl+v=0AT}=0AT{=0Ac-w=0AT} T= {=0ACtrl+w=0AT}=0AT{=0Ac-x=0AT} T{=0ACtrl+x=0AT}=0AT{=0Ac-y=0AT} T{=0ACtrl+= y=0AT}=0AT{=0Ac-z=0AT} T{=0ACtrl+z=0AT}=0AT{=0Ac-]=0AT} T{=0ACtrl+]=0AT}=0A= T{=0Ac-[=0AT} T{=0ACtrl+[=0AT}=0AT{=0Ac-^=0AT} T{=0ACtrl+^=0AT}=0AT{=0Ac-\f= I=0AT} T{=0ACtrl+\fR=0AT}=0A.TE=0A.sp 1=0A.SH SEE ALSO=0A.P=0A\fBaerc\fR(1)= \fBaerc-imap\fR(5) \fBaerc-smtp\fR(5)=0A.P=0A.SH AUTHORS=0A.P=0AMaintained= by Drew DeVault , who is assisted by other open=0Asource co= ntributors. For more information about aerc development, see=0Ahttps://git.= sr.ht/~sircmpwn/aerc.=0A --6f625jkwgzzrc4a2-- -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv