xfig cannot display EPS graphics

Bug #777230 reported by Darren Peets
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
xfig (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: xfig

After an upgrade to Natty, xfig can no longer parse EPS files. The simplest test of this is to draw, for instance, a circle in xfig, export to EPS (which works), then try to place it in an xfig file as a Picture object. I get the following error:

===============================================
Could not parse EPS file with ghostscript: $­û
ERROR from ghostscript:
Error: /invalidfileaccess in --run--
Operand stack:
   3 --nostringval-- (test.eps) (r)
Execution stack:
   %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop 1893 1 3 %oparray_pop 1787 1 3 %oparra
_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 1910 3 3 %oparray_pop --nostringval--
Dictionary stack:
   --dict:1159/1684(ro)(G)-- --dict:0/20(G)-- --dict:81/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 9.01: Unrecoverable error, exit code 1
EPS object read OK, but no preview bitmap found/generated
===============================================

Its final claim here is partially correct. Although I can't see what I'm doing, if I now export the file to EPS, the result looks exactly as I would expect. However, it doesn't seem to be correctly reading bounding boxes -- if, when importing the EPS file, I ask xfig to expand or shrink the Picture to its original h/w ratio, the second x coordinate is set to (the first x coordinate - 4772185.8844).

GV and transfig seem to work just fine, so I'd have difficulty blaming ghostscript.

Ubuntu 11.04
xfig 1:3.2.5.b-1.1ubuntu1
ghostscript 9.01~dfsg-1ubuntu5

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: xfig 1:3.2.5.b-1.1ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic i686
Architecture: i386
Date: Wed May 4 17:51:58 2011
ProcEnviron:
 LANGUAGE=en_CA:en
 PATH=(custom, user)
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: xfig
UpgradeStatus: Upgraded to natty on 2011-04-28 (5 days ago)

Revision history for this message
Darren Peets (dpeets) wrote :
Revision history for this message
jtappin (sjt) wrote :

I also see the same problem on an X86_64 system, both with new fig and eps files and with a set that I know worked perfectly on Maverick.

Revision history for this message
cluracan (josephsonjunction) wrote :

I have the same problem - xfig displays an error when I try to add eps files. Old xfig projects which I know worked in the prev. distrib. (and have eps files in them) display the same error when I load them.

Revision history for this message
cluracan (josephsonjunction) wrote :

I have found the exact same problem affecting fedora and suse about a year ago, but they apparently fixed them already:

https://bugzilla.novell.com/show_bug.cgi?id=629462
https://bugzilla.redhat.com/show_bug.cgi?id=657290

Revision history for this message
cluracan (josephsonjunction) wrote :

Ok, found a workaround.
Basically I uninstalled all the ghostscript packages from my system (libgs9, ghostscript, ghostscript-x and any other I found).

This was hard as apparently some of them weren't using the package manager. But I uninstalled all I could until the command "gs" in the shell stopped working.

Then I reinstalled the OLD versions from the 10.04 Ubuntu packages. Specifically:

libgs8_8.71.dfsg.2-0ubuntu7 from http://packages.ubuntu.com/maverick/libgs8

ghostscript_8.71.dfsg.2-0ubuntu7 from http://packages.ubuntu.com/maverick/ghostscript

ghostscript-x_8.71.dfsg.2-0ubuntu7 from http://packages.ubuntu.com/maverick/ghostscript-x

Again, this wasn't very easy since the automated installer (the new Ubuntu software center) automatically installed the latest version of parts of these packages (probably thinking I didn't really mean to install the old ones :/).

Instead install using
sudo dpkg -i package_file.deb

(where package_file.deb is replaced with the package file you downloaded from the above links). Do it in the package order I gave here because of dependencies.

To make sure it works, just run "gs" in the shell and check that the version is 8.XX (8.71 I think).

This solved the problem for me. Well, not "solved" but now xfig works with natty

Revision history for this message
Matthieu Marechal (mat3582) wrote :

This is a workaround, which does essentially the same (I hope), without having to revert to an older version of ghostscript:
Simply invoke xfig using:

xfig -gh 'gs -dDELAYSAFER -sPermitFileReading="[ (*) ]" -dSAFER'

Note: This allows the gs called from within xfig to read all files.
As far as I can tell this option is only used by xfig for importing,
so supplying it should not lead to large security issues.
Can anyone confirm this?

Changed in xfig (Ubuntu):
status: New → Confirmed
Revision history for this message
Alex (alex-pi-gamer) wrote :

Hello everybody!
The last suggestion works fine on my Ubuntu 11.04 but I have found another more wise way to fix the bug. I am not that advanced user of Linux systems and cannot do it myself. Moreover the procedure can be applied in such a way that it will fix the bug for any system. It would be nice if somebody can do this in such a way that other users of Xfig could just update the application from some repository or so. Our system administrator Kees Lemmens used the following to fix the problem for our Slackware systems:
=======================================================================
Q: Since my system uses Ghostscript 9.0 xfig refuses to import any eps files !

A: This is caused by more strict security settings in ghostscript 9.0
A workaround is to apply the patch xfig-3.2.5b-fix-eps-reading.patch
(use Google) on the source tree and then recompile xfig from scratch.
patch -p0 < xfig-3.2.5b-fix-eps-reading.patch
edit Imakefile
xmkmf
make
make install.all

Kees Lemmens, June 2011
========================================================================

Regards,

Alex

Revision history for this message
Alex (alex-pi-gamer) wrote :

see post #7

Changed in xfig (Ubuntu):
status: Confirmed → Opinion
status: Opinion → Incomplete
Revision history for this message
Alex (alex-pi-gamer) wrote :

Here is the patch

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "xfig-3.2.5b-fix-eps-reading.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Kemp (kemp-iualdii) wrote :

This is still an issue in Natty and Oneiric. Is there any reason the patch hasn't been applied given that it was fixed elsewhere over a year ago and is a very minor change?

Revision history for this message
Dipanjan (dray2) wrote :

This bug affected me (Oneiric), and I can confirm that the patch mentioned in post #7 (and attached in post #9) fixes the problem.

Changed in xfig (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Roland Rosenfeld (roland) wrote :

This should be solved since 3.2.5.c.

Revision history for this message
Romano Giannetti (romano-giannetti) wrote :

I can confirm it is fixed in 14.04.

Changed in xfig (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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