discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc -Thtml crashing for certain inputs
@ 2017-05-13 13:06 Abhinav Upadhyay
  2017-05-13 13:47 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Abhinav Upadhyay @ 2017-05-13 13:06 UTC (permalink / raw)
  To: discuss

Hi,

mandoc -Thtml seems to be crashing in some cases, when you pass the
-Ostyle option to it, such as `mandoc -Thtml -Ostyle=s/style.css'.

 The core indicates a null pointer dereference at line 754 in
mdoc_html.c (1.14.1 release):

if (h->style != NULL && !bl->norm->Bl.comp &&
     (n->parent->prev == NULL ||
      n->parent->prev->body->child != NULL)) {
...

I am able to hit it with the following test case:

.Dd May 13, 2017
.Dt FOO 8
.Os
.Sh NAME
.Nm foo
.Nd man page for foo
.Sh DESCRIPTION
foo bar
.Bl -tag -width Ds
.Sm off
.It Ar device
Open the specified device
.El

It crashes because of the presence of `.Sm off' inside the list. The
actual issue was happening while generating html for the rmt(8) man
page from FreeBSD-12.0-current but I tried to reduce it down to a
smaller test case for ease of debugging.

-
Abhinav
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mandoc -Thtml crashing for certain inputs
  2017-05-13 13:06 mandoc -Thtml crashing for certain inputs Abhinav Upadhyay
@ 2017-05-13 13:47 ` Ingo Schwarze
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Schwarze @ 2017-05-13 13:47 UTC (permalink / raw)
  To: Abhinav Upadhyay; +Cc: discuss

Hi Abhinav,

Abhinav Upadhyay wrote on Sat, May 13, 2017 at 06:36:53PM +0530:

> mandoc -Thtml seems to be crashing in some cases, when you pass the
> -Ostyle option to it, such as `mandoc -Thtml -Ostyle=s/style.css'.
> 
>  The core indicates a null pointer dereference at line 754 in
> mdoc_html.c (1.14.1 release):
> 
> if (h->style != NULL && !bl->norm->Bl.comp &&
>      (n->parent->prev == NULL ||
>       n->parent->prev->body->child != NULL)) {
> ...
> 
> I am able to hit it with the following test case:
> 
> .Dd May 13, 2017
> .Dt FOO 8
> .Os
> .Sh NAME
> .Nm foo
> .Nd man page for foo
> .Sh DESCRIPTION
> foo bar
> .Bl -tag -width Ds
> .Sm off
> .It Ar device
> Open the specified device
> .El
> 
> It crashes because of the presence of `.Sm off' inside the list. The
> actual issue was happening while generating html for the rmt(8) man
> page from FreeBSD-12.0-current but I tried to reduce it down to a
> smaller test case for ease of debugging.

That crash was first reported by Gabriel Guzman and i fixed it
in mdoc_html.c rev. 1.272 on Feb 22, 2017.  The HEAD revision
of that file currently is rev. 1.287.

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-13 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-13 13:06 mandoc -Thtml crashing for certain inputs Abhinav Upadhyay
2017-05-13 13:47 ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).