Skip to content

segfault rendering man7/man.html #719

@stroucki

Description

@stroucki

Diagnosing this was made more difficult by libthread/daemonize.c declaring a null signal handler for SIGSEGV, the only indication was from Linux kernel messages at the end of compilation.

Analysis from core of troff2html:

#0  0x000055f15de7583b in iputs (b=0x55f15de853c0 <bout>,
    s=0x31 <error: Cannot access memory at address 0x31>) at troff2html.c:341
341             if(s[0]=='<' && s[1]=='+'){
(gdb) up
#1  0x000055f15de75aaf in setattr (a=94495150899200) at troff2html.c:391
391                             iputs(&bout, onattr[j]);
(gdb) print j
$1 = 26
(gdb) l
386             for(i=0; i<nelem(attrorder); i++){
387                     j = attrorder[i];
388                     if(on&(1<<j)){
389                             if(j == Anchor)
390                                     onattr[j] = anchors[nanchors++];
391                             iputs(&bout, onattr[j]);
392                             nest[nnest++] = j;
393                     }
394             }
395             attr = a;
(gdb) print Anchor+0
$2 = 26
(gdb) print nanchors
$3 = 4
(gdb) print anchors[3]
$4 = 0x31 <error: Cannot access memory at address 0x31>

I couldn't figure out what a correction would be; the values of the nonexistent anchors never made it into the final html file. But as nanchors is a global, and the anchors array is filled elsewhere, increasing nanchors here looks suspicious.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions