Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 178499 - dev-scheme/guile doesn't like -ftree-vectorize, breaks lilypond
Summary: dev-scheme/guile doesn't like -ftree-vectorize, breaks lilypond
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Marijn Schouten (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-14 11:18 UTC by Santiago Gala
Modified: 2007-06-23 16:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lilypond file obtained with abc2ly (Fuga_7ee183.ly,18.76 KB, text/plain)
2007-05-14 15:14 UTC, Santiago Gala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Santiago Gala 2007-05-14 11:18:57 UTC
Process of the Bach Fugue in http://www.soe.ucsc.edu/cgi-bin/cgiwrap/nwhitehe/moin.cgi/BachFugue , 
abc format http://www.soe.ucsc.edu/~nwhitehe/wiki/abcps/Fuga_7ee183.abc , through abc2ly and later lilypond, produces:
$ lilypond Fuga_7ee183.ly 
GNU LilyPond 2.10.23
Processing `Fuga_7ee183.ly'
Analizando...
Interpreting music... [8][16][24][32][40][48][54]
Preprocessing graphical objects...
Interpreting music... 
Salida MIDI a `Fuga_7ee183.midi'...
Layout output to `Fuga_7ee183.ps'...
Converting to `Fuga_7ee183.pdf'...
`gs -q  -dSAFER  -dDEVICEWIDTHPOINTS=595.28 -dDEVICEHEIGHTPOINTS=841.89  -dCompatibilityLevel=1.4  -dNOPAUSE -dBATCH -r1200  -sDEVICE=pdfwrite -sOutputFile="Fuga_7ee183.pdf" -c .setpdfwrite -f "Fuga_7ee183.ps"' failed (256)
error: failed files: "Fuga_7ee183.ly"

the ps file is actually broken, containing 3 numbers as ...999999A. Correcting those to the right rounding, makes the gs command run, and both the .ps and pdf files display.


Reproducible: Always

Steps to Reproduce:
1. $ abc2ly Fuga_7ee183.abc
2. $ lilypond Fuga_7ee183.ly
3. look for error and broken postscript

Actual Results:  
...
Converting to `Fuga_7ee183.pdf'...
`gs -q  -dSAFER  -dDEVICEWIDTHPOINTS=595.28 -dDEVICEHEIGHTPOINTS=841.89  -dCompatibilityLevel=1.4  -dNOPAUSE -dBATCH -r1200  -sDEVICE=pdfwrite -sOutputFile="Fuga_7ee183.pdf" -c .setpdfwrite -f "Fuga_7ee183.ps"' failed (256)
error: failed files: "Fuga_7ee183.ly"

$ grep -aE "9{4,}A" Fuga_7ee183.ps 
%%DocumentMedia: a4 595.2799999999A 841.8899999999A 80 () ()
/staff-line-thickness 0.09999999999999A def



Expected Results:  
a working file, containing numbers in the ps file

64 bits might play a role here.

Workaround: a short sed script can recondition the ps script while the bug is dealt with.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-05-14 12:30:03 UTC
Which media-sound/lilypond is this about?
Comment 2 Santiago Gala 2007-05-14 12:54:43 UTC
oops, forgot to mention that it is media-sound/lilypond-2.10.23

testing as of today
Comment 3 Marijn Schouten (RETIRED) gentoo-dev 2007-05-14 13:23:46 UTC
Please resync in an hour or so, unmask 2.11.23 and try to reproduce with that. Also attach the .ly file that causes the error
Comment 4 Santiago Gala 2007-05-14 15:14:10 UTC
Created attachment 119237 [details]
lilypond file obtained with abc2ly

This, as I said, is obtained from the url I posted using abc2ly. I've tried other .abc files with the same results.
Comment 5 Santiago Gala 2007-05-14 17:03:52 UTC
2.11.23 gives slightly different results:

$ LANG=C lilypond Fuga_7ee183.ly 
GNU LilyPond 2.11.23
Processing `Fuga_7ee183.ly'
Parsing...
Interpreting music... [8][16][24][32][40][48]
Preprocessing graphical objects...
Interpreting music... 
MIDI output to `Fuga_7ee183.midi'...
Layout output to `Fuga_7ee183.ps'...
Converting to `Fuga_7ee183.pdf'...
`gs -q  -dSAFER  -dDEVICEWIDTHPOINTS=595.28 -dDEVICEHEIGHTPOINTS=841.89  -dCompatibilityLevel=1.4  -dNOPAUSE -dBATCH -r1200  -sDEVICE=pdfwrite -sOutputFile="Fuga_7ee183.pdf" -c .setpdfwrite -f "Fuga_7ee183.ps"' failed (256)
programming error: Parsed object should be dead: static scm_unused_struct* Prob::mark_smob(scm_unused_struct*)
continuing, cross fingers
programming error: Parsed object should be dead: static scm_unused_struct* Lily_lexer::mark_smob(scm_unused_struct*)
continuing, cross fingers
programming error: Parsed object should be dead: static scm_unused_struct* Context_def::mark_smob(scm_unused_struct*)
continuing, cross fingers
programming error: Parsed object should be dead: static scm_unused_struct* Grob::mark_smob(scm_unused_struct*)
continuing, cross fingers
error: failed files: "Fuga_7ee183.ly"

this time only one error in the .ps file:

$ grep -aE "9{4,}A" Fuga_7ee183.ps 
/staff-line-thickness 0.09999999999999A def

editing it to 0.1, the remaining conversion works
Comment 6 Marijn Schouten (RETIRED) gentoo-dev 2007-05-14 17:31:47 UTC
Hmm, I could not reproduce with 2.10.23 and app-text/ghostscript-gpl-8.54.

What ghostscript version have you been using?
Comment 7 Marijn Schouten (RETIRED) gentoo-dev 2007-05-14 17:33:53 UTC
I am also using amd64 btw so that cannot be an issue.

Please include emerge --info.
Comment 8 Santiago Gala 2007-05-14 17:37:03 UTC
$ equery list -p ghostscript-
[ Searching for package 'ghostscript-' in all categories among: ]
 * installed packages
[I--] [  ] app-text/ghostscript-gpl-8.54 (0)
 * Portage tree (/usr/portage)
[-P-] [  ] app-text/ghostscript-esp-7.07.1-r8 (0)
[-P-] [  ] app-text/ghostscript-esp-8.15.3 (0)
[-P-] [M~] app-text/ghostscript-esp-8.15.3-r1 (0)
[-P-] [M~] app-text/ghostscript-esp-8.15.4 (0)
[-P-] [ ~] app-text/ghostscript-gnu-8.55 (0)

Not sure what is the cause, but I don't think ghostscript is used to generate the ps, probably later, to turn it into pdf.
Comment 9 Santiago Gala 2007-05-14 17:52:04 UTC
$ emerge --info
Portage 2.1.2.2 (default-linux/amd64/2007.0/desktop, gcc-4.1.2, glibc-2.5-r2, 2.6.21-gentoo x86_64)
=================================================================
System uname: 2.6.21-gentoo x86_64 Intel(R) Core(TM)2 CPU         T7200  @ 2.00GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Mon, 14 May 2007 16:00:01 +0000
dev-java/java-config: 1.3.7, 2.0.32
dev-lang/python:     2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe -ftree-vectorize -ftree-vectorizer-verbose=1"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache1-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=nocona -O2 -pipe -ftree-vectorize -ftree-vectorizer-verbose=1"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="es_ES.UTF-8"
LINGUAS="es es_ES en"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/layman/voip"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acl acpi aiglx alsa amd64 apache2 arts avahi avi bash-completion berkdb bitmap-fonts bluetooth bonjour cairo cdr cli cracklib crypt cups curl dbus dlloader dri dvd dvdr dvdread eds emboss encode esd evdev evo fam firefox fortran galago gdbm gif gnome gpm gstreamer gtk gtk2 hal iconv icu iproute2 ipv6 isdnlog java jpeg kde kdehiddenvisibility kerberos lcms ldap libg++ logrotate lucene mad midi mikmod mmx mono mouse mp3 mpeg ncurses nls nptl nptlonly nsplugin obex ogg opengl oss pam pcre pdf pdflib perl png ppds pppd python qt3 qt3support qt4 quicktime readline reflection sdl session spell spl sse sse2 ssl svg tcpd theora threads tiff truetype truetype-fonts type1-fonts udev unicode v4l v4l2 vorbis xinerama xml xorg xrandr xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" DVB_CARDS="usb-wt220u" ELIBC="glibc" INPUT_DEVICES="synaptics mouse evdev keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="es es_ES en" USERLAND="GNU" VIDEO_CARDS="vesa i810 intel"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 10 Marijn Schouten (RETIRED) gentoo-dev 2007-05-14 17:55:29 UTC
could you please try to reproduce with CFLAGS="-O2 -pipe"?
Comment 11 Santiago Gala 2007-05-14 19:17:47 UTC
doing it. While it compiles, I grepped for the problematic number and found:

./out/share/lilypond/current/scm/framework-ps.scm:   (output-entry "staff-line-thickness" 'line-thickness)

So it is in guile, and output-entry is defined (in scm/framework.scm) as:

  (define (output-entry ps-key ly-key)
    (string-append
     "/" ps-key " "
     (value->string (ly:output-def-lookup layout ly-key)) " def\n"))

After this test (quite likely) fails, I'l re-emerge guile to see what happens.
Comment 12 Santiago Gala 2007-05-14 19:29:54 UTC
Same error with "-O2 -pipe" *in lilypond*; now, re-emerge of guile with those options made it work right. I'm testing for precise CFLAGS in guile that makes the problem appear.
Comment 13 Santiago Gala 2007-05-14 19:59:50 UTC
ok, isolated to a "pure" guile build/interaction/bug:

guile> (number->string 0.09999999999)
"0.09999999998999A"
guile> (number->string 0.099999999999)
"0.09999999999899A"
guile> (number->string 0.0999999999999)
"0.099999999999900"

building without -ftree-vectorize I get:

guile> (number->string 0.09999999999)
"0.09999999999"
guile> (number->string 0.099999999999)
"0.099999999999"
guile> (number->string 0.0999999999999)
"0.0999999999999"

Nice to know
Comment 14 Marijn Schouten (RETIRED) gentoo-dev 2007-05-15 08:30:01 UTC
Thanks for isolating the issue.
Comment 15 Marijn Schouten (RETIRED) gentoo-dev 2007-06-23 15:35:39 UTC
okay, maybe this flag should be filtered
Comment 16 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-06-23 15:41:23 UTC
And now filtering -ftree-vectorize :)