dvipng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dvipng] DVIPNG segfault on DVI output of simple TEX file?


From: Shriramana Sharma
Subject: Re: [Dvipng] DVIPNG segfault on DVI output of simple TEX file?
Date: Mon, 17 Jun 2013 14:24:42 +0530

On Mon, Jun 17, 2013 at 2:03 PM, Shriramana Sharma <address@hidden> wrote:
> 352             colornamep=LoadColornameFile(colordef[0]);
> (gdb)
> 353           tmp=colornamep;
> (gdb) print tmp
> $11 = (struct colorname *) 0x0
> (gdb) next
> 354           while((tmp->next!=NULL || colordef[unloaded]!=NULL)
> (gdb) print tmp
> $13 = (struct colorname *) 0x0
> (gdb) next
> Program received signal SIGSEGV, Segmentation fault.
>
> It is evident that there is no check here to ensure that tmp is *not*
> NULL before dereferencing it by -> on line 354.

So tmp evidently becomes NULL only because it is assigned to the
output of LoadColorFileName. I figured that function returned NULL
because it couldn't find the file asked for. So I did the next/step
routine again and asked gdb what colordef[0] was:

352             colornamep=LoadColornameFile(colordef[0]);
(gdb) print colordef[0]
$1 = 0x417de8 "xcolor.sty"
(gdb) print colordef
$2 = {0x417de8 "xcolor.sty", 0x417df3 "dvipsnam.def", 0x417e00
"svgnam.def", 0x417e0b "x11nam.def", 0x0}

Then I did searched on packages.ubuntu.com for packages providing
xcolor.sty: 
http://packages.ubuntu.com/search?searchon=contents&keywords=xcolor.sty&mode=exactfilename&suite=raring&arch=any

Sure enough, latex-xcolor
(http://packages.ubuntu.com/raring/latex-xcolor) wasn't installed on
my system and installing it fixed everything right up to the
functioning of SymPyPrt on IPy3.

So there are two bugs here:

dvipng's color.c has a bug whereby it does not test for the output of
LoadColorFileName to be NULL when it should output a meaningful error
message complaining that it could not find xcolor.sty.

Debian's dvipng packaging (inherited by Ubuntu) has the bug whereby it
does not have a dependency on latex-xcolor to provide the requisite
color data files that dvipng expects.

I hope this helps. I'll be filing a Debian bug and update the Ubuntu
bug accordingly. Please do fix this and issue a point release for
dvipng.

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा



reply via email to

[Prev in Thread] Current Thread [Next in Thread]