grace produces mangled svg

Bug #1068095 reported by Andrew Sharff on 2012-10-18
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grace (Debian)
Fix Released
Unknown
grace (Ubuntu)
Low
Unassigned
Nominated for Precise by Thomas Ward
Nominated for Quantal by Thomas Ward

Bug Description

The grace package supplied with precise produces mangled svg output.

i.e. the output of gracebat -hardcopy -hdevice SVG

The problem would appear to be in one of the patches applied to the original source code.

A binary built on precise from the original source (./configure ; make ; make install) is fine.

Vibhav Pant (vibhavp) wrote :

Thank you for reporting this bug. Can you please tell us which version of Ubuntu are you using?

Changed in grace (Ubuntu):
status: New → Incomplete

12.04.1

On 18/10/12 13:37, Vibhav Pant wrote:
> Thank you for reporting this bug. Can you please tell us which version
> of Ubuntu are you using?
>
> ** Changed in: grace (Ubuntu)
> Status: New => Incomplete
>

--
----------------------------------------------------------
*Dr. Andrew J. Sharff D.Phil**
*Research Scientist / Software Developer
Global Phasing Ltd
Sheraton House
Castle Park
Cambridge CB3 0AX
UK
Tel: +(0)1223 353033
Fax: +(0)1223 366889

Vibhav Pant (vibhavp) wrote :

Can you please tell us steps via which we can reproduce this bug?

Changed in grace (Ubuntu):
status: Incomplete → New
status: New → Incomplete
Andrew Sharff (asharff) wrote :

Simply run the command gracebat -hardcopy -hdevice SVG and look at
the output file Untitled.svg.

Look in particular at the ends of the lines beginning <text
style="font-family:'
I enclose two file good.svg and bad.svg.

bad.svg results from running the above command using the ubuntu
installed grace
good.svg results from running grace that I have compiled on the same
system from the original source code.
I should also point out that running the supplied grace on an Ubuntu
10.04 lts system also gives good output.

Hope this helps

Andrew

On 18/10/12 14:10, Vibhav Pant wrote:
> Can you please tell us steps via which we can reproduce this bug?
>

--
----------------------------------------------------------
*Dr. Andrew J. Sharff D.Phil**
*Research Scientist / Software Developer
Global Phasing Ltd
Sheraton House
Castle Park
Cambridge CB3 0AX
UK
Tel: +(0)1223 353033
Fax: +(0)1223 366889

Vibhav Pant (vibhavp) on 2012-10-18
Changed in grace (Ubuntu):
status: Incomplete → New
Alex Valavanis (valavanisalex) wrote :

Confirmed with grace_1:5.1.22-13 on Quantal amd64.

Changed in grace (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Andrew Sharff (asharff) wrote :

I have localised the problem to the patch file source-hardening.diff

Having downloaded the source and applied the patches one after the
other and compiling and testing after each one, grace gives the correct
output after all of the previous patches are applied but gives the wrong
output after source-hardening.diff is applied.

Hope that helps further

Andrew

On 18/10/12 15:12, Vibhav Pant wrote:
> ** Changed in: grace (Ubuntu)
> Status: Incomplete => New
>

--
----------------------------------------------------------
*Dr. Andrew J. Sharff D.Phil**
*Research Scientist / Software Developer
Global Phasing Ltd
Sheraton House
Castle Park
Cambridge CB3 0AX
UK
Tel: +(0)1223 353033
Fax: +(0)1223 366889

Alex Valavanis (valavanisalex) wrote :

Nice work tracking it down... here's the relevant change to the SVG driver code:

Index: grace-5.1.22/src/svgdrv.c
===================================================================
--- grace-5.1.22.orig/src/svgdrv.c 2012-05-17 19:00:52.144748609 -0700
+++ grace-5.1.22/src/svgdrv.c 2012-05-17 19:00:54.000000000 -0700
@@ -745,7 +745,7 @@
             -tm->cxy, -tm->cyy,
             scaleval(vp.x), scaleval(vp.y));

- fprintf(prstream, escape_specials((unsigned char *) s, len));
+ fprintf(prstream, "%s%s", escape_specials((unsigned char *) s, len));

     fprintf(prstream, "</text>\n");
 }

Alex Valavanis (valavanisalex) wrote :

At first glance, I don't see why the format string is "%s%s" when there is only one string. Shouldn't it be just "%s"?

This should also be forwarded to the Debian maintainer.

Alex Valavanis (valavanisalex) wrote :

Forwarded to Debian. I'll link to the report once I get the acknowledgement.

Changed in grace (Ubuntu):
status: Confirmed → Triaged
Changed in grace (Debian):
status: Unknown → New
Alex Valavanis (valavanisalex) wrote :

Fixed in grace_1:5.1.23-1 (now in Ubuntu Raring archive).

We can fix this in earlier versions of Ubuntu with a backport.

Changed in grace (Ubuntu):
milestone: none → ubuntu-13.04-beta-1
status: Triaged → Fix Released
Andrew Sharff (asharff) wrote :

A backport to ubuntu 12.04 would be welcome. Please!

Changed in grace (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.