reassign -1 mk-configure
thanks

Hi. I looked into this, and the conclusions are:

- This is not an FTBFS for graphviz, but rather for mk-configure. The
  graphviz package builds just fine, but ...

- The "dot" executable it produces has a bug: graphs spanning multiple
  pages contain incorrect postscript

- This is an upstream bug in graphviz. I have a prototype patch that
  fixes it. We need a workaround for mk-configure, and I'll try to get
  something working in the near future. If somebody wants to beat me to
  it, please feel free.


Description of bug and patch:

Let's say you have my_prjs.dot, attached in an earlier post in this
report. You run

  dot -Tps my_prjs.dot > my_prjs.eps

As reported earlier, my_prjs.eps is bogus because gs barfs at it:

  $ ps2pdf my_prjs-sid.eps
  Error: /undefined in setupLatin1
  Operand stack:

  Execution stack:
     %interp_exit   .runexec2   --nostringval--   --nostringval--   
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--   
--nostringval--   false   1   %stopped_push   1999   1   3   %oparray_pop   
1998   1   3   %oparray_pop   1982   1   3   %oparray_pop   1868   1   3   
%oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   
--nostringval--   --nostringval--   2   %stopped_push   --nostringval--
  Dictionary stack:
     --dict:982/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--
  Current allocation mode is local
  Current file position is 15221
  GPL Ghostscript 9.20: Unrecoverable error, exit code 1


Looking at the my_projs.eps file, its structure is

1. A chunk written by psgen_begin_job() in
plugin/core/gvrender_core_ps.c:

  %!PS-Adobe-3.0
  %%Creator: graphviz version ...
  ...

2. A chunk that comes from plugin/core/ps.txt, written by
psgen_begin_graph() in plugin/core/gvrender_core_ps.c:

  %%Title: ...
  ...
  %%BeginProlog
  /DotDict 200 dict def
  DotDict begin

  /setupLatin1 { ... } bind def
  ...

  setupLatin1


Note that this defines the setupLatin1 function, and it then calls this
function

3. There is no psgen_end_graph()

4. A chunk that comes from psgen_end_job()

  %%Trailer
  %%Pages: 1
  %%BoundingBox: 36 36 975 418
  end
  restore
  %%EOF

Note that this undefineds the setupLatin1 function

5. At this point steps 2,3,4 repeat for each page, with some omissions.
The immediate next chunk is

  setupLatin1

This comes from psgen_begin_graph() again, but it doesn't re-define
setupLatin1

This is the source of the complaint: we're calling an undefined
function.



This is only an issue when touching .dot files that have more than one
graph. Two solutions are possible:

1. Don't clean up as much after each page, so that the setupLatin1
   function remains defined

2. Perform more initialization at the start of each page, to redefine
   setupLatin1 each time

A simple proof-of-concept fix to implement solution 2 is to modify
psgen_begin_graph() in plugin/core/gvrender_core_ps.c to change

      if (job->common->viewNum == 0) {

to

      if (true) {

This if() statement served to prevent redefining setupLatin1 (and a
whole lotta other stuff), and this fix redefines it each time.

Solution 1 is probably better, but it involves touching more code, and
I'd rather upstream did that. Laszlo: as the graphviz Debian maintainer,
can you please forward this upstream?

Thanks.

Reply via email to