Bug 34101

Summary: dot output is inconsistent across architectures
Product: Sisyphus Reporter: Dmitry V. Levin <ldv>
Component: graphvizAssignee: Michael Shigorin <mike>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: major    
Priority: P3 CC: aen, george, lav, mike
Version: unstable   
Hardware: all   
OS: Linux   
URL: https://bugzilla.redhat.com/show_bug.cgi?id=827927
Bug Depends on:    
Bug Blocks: 34231, 34100    

Description Dmitry V. Levin 2017-10-31 05:58:48 MSK
$ rpmquery -a 'fonts*'
fonts-type1-urw-1.0.7pre44-alt2.noarch

$ cat sample.dot
digraph {
node [fontname="Helvetica", shape=record];
123456;
123456123456;
}

$ uname -m && dot sample.dot -Tsvg -o sample.svg -Tpng -o sample.png && grep width sample.svg && file sample.png
x86_64
svg width="196pt" height="45pt"
sample.png: PNG image, 261 x 60, 8-bit/color RGBA, non-interlaced

$ uname -m && dot sample.dot -Tsvg -o sample.svg -Tpng -o sample.png && grep width sample.svg && file sample.png
i686
<svg width="194pt" height="45pt"
sample.png: PNG image, 259 x 60, 8-bit/color RGB, non-interlaced

This is reproducible with other providers of Helvetica, too.

Changing font affects the result but does not help much: output png files differ even in trivial cases with fontname="fixed":

$ cat sample.dot
digraph {
node [fontname="fixed", shape=record];
x;
}

$ uname -m && dot sample.dot -Tpng -osample.png && md5sum sample.png
x86_64
852b97d8f3bbc4c32d16346d28d78756  sample.png

$ uname -m && dot sample.dot -Tpng -osample.png && md5sum sample.png
i686
4774635c50485fb46365830cfaac642b  sample.png
Comment 1 Michael Shigorin 2017-11-02 22:54:17 MSK
А где патч? :)
Comment 2 Dmitry V. Levin 2017-11-27 22:31:39 MSK
(In reply to comment #0)
> Changing font affects the result but does not help much: output png files
> differ even in trivial cases with fontname="fixed":
> 
> $ cat sample.dot
> digraph {
> node [fontname="fixed", shape=record];
> x;
> }
> 
> $ uname -m && dot sample.dot -Tpng -osample.png && md5sum sample.png
> x86_64
> 852b97d8f3bbc4c32d16346d28d78756  sample.png
> 
> $ uname -m && dot sample.dot -Tpng -osample.png && md5sum sample.png
> i686
> 4774635c50485fb46365830cfaac642b  sample.png

If the only font package installed in the system is fonts-bitmap-misc, the difference in this trivial case disappears:

$ dot sample.dot -Tpng -osample.png && md5sum sample.png
fb323c3f6b7be80fb73865fbdfdc1489  sample.png

jftr,
$ strace -qqk -e/open -P/usr/share/fonts/bitmap/misc/9x18-ISO8859-1.pcf.gz \
dot sample.dot -Tpng -osample.png
open("/usr/share/fonts/bitmap/misc/9x18-ISO8859-1.pcf.gz", O_RDONLY) = 4
 > /lib64/libc-2.25.so(__open64+0x10) [0xde340]
 > /usr/lib64/libfreetype.so.6.14.0() [0x10aaf]
 > /usr/lib64/libfreetype.so.6.14.0(FT_New_Library+0x2cc) [0x15e7c]
 > /usr/lib64/libfreetype.so.6.14.0(FT_Done_Face+0x14e) [0x18eee]
 > /usr/lib64/libfreetype.so.6.14.0(FT_New_Face+0x2c) [0x1978c]
 > /usr/lib64/libcairo.so.2.11400.10(cairo_script_from_recording_surface+0x2b9) [0xc21c9]
 > /usr/lib64/libcairo.so.2.11400.10(cairo_script_from_recording_surface+0x3ca2) [0xc5bb2]
 > /usr/lib64/libcairo.so.2.11400.10(cairo_scaled_font_create+0x274) [0x66334]
 > /usr/lib64/libpangocairo-1.0.so.0.4000.14(pango_cairo_font_get_type+0xfd) [0x5b4d]
 > /usr/lib64/libpangocairo-1.0.so.0.4000.14(pango_cairo_error_underline_path+0x15d) [0x958d]
 > /usr/lib64/libpangoft2-1.0.so.0.4000.14(pango_fc_decoder_get_glyph+0x2f1) [0xcf91]
 > /usr/lib64/libpango-1.0.so.0.4000.14(pango_shape_full+0xb8) [0x2f678]
 > /usr/lib64/libpango-1.0.so.0.4000.14(pango_script_get_sample_language+0x7d7) [0x21a37]
 > /usr/lib64/libpango-1.0.so.0.4000.14(pango_layout_line_unref+0x522) [0x23122]
 > /usr/lib64/libpango-1.0.so.0.4000.14(pango_layout_line_get_extents+0x9e8) [0x25538]
 > /usr/lib64/libpango-1.0.so.0.4000.14(pango_layout_move_cursor_visually+0x6ba) [0x271ea]
 > /usr/lib64/graphviz/libgvplugin_pango.so.6.0.0(get_font_list+0x45a) [0x693a]
 > /usr/lib64/libgvc.so.6.0.0(textspan_size+0x49) [0x378d9]
 > /usr/lib64/libgvc.so.6.0.0(elapsed_sec+0x1cf) [0x4a5ff]
 > /usr/lib64/libgvc.so.6.0.0(make_simple_label+0xbc) [0x4afec]
 > /usr/lib64/libgvc.so.6.0.0(make_label+0xe8) [0x4b1b8]
 > /usr/lib64/libgvc.so.6.0.0(rank+0xc71) [0x4ef61]
 > /usr/lib64/libgvc.so.6.0.0(rank+0x1206) [0x4f4f6]
 > /usr/lib64/graphviz/libgvplugin_dot_layout.so.6.0.0(dot_init_node_edge+0x4d) [0xbb8d]
 > /usr/lib64/graphviz/libgvplugin_dot_layout.so.6.0.0(dot_init_node_edge+0x362) [0xbea2]
 > /usr/lib64/graphviz/libgvplugin_dot_layout.so.6.0.0(dot_layout+0x427) [0xc697]
 > /usr/lib64/libgvc.so.6.0.0(gvLayoutJobs+0xdb) [0x2324b]
 > /usr/bin/dot(_init+0x439) [0xf11]
 > /lib64/libc-2.25.so(__libc_start_main+0xf1) [0x20691]
 > /usr/bin/dot(_init+0x4e2) [0xfba]
Comment 3 Michael Shigorin 2018-06-11 00:13:50 MSK
Поскольку это будет одна из болячек для p9, поставлю-ка блокер.

2 lav: в сизиф отправлена сборка 2.40.1-alt2 без -ffast-math; спасибо.
2 ldv: проверь, как будет удобно, я уж засыпаю...
Comment 4 Dmitry V. Levin 2018-06-12 22:00:47 MSK
На тривиальных примерах, которые я здесь приводил, разницы больше нет.
Comment 5 Michael Shigorin 2018-06-12 22:37:06 MSK
Спасибо; тогда считаю вопрос закрытым.