#49 QGLE terminates trying to create new file (lcms: Error #12288)

None
open
nobody
None
5
2013-08-04
2012-02-26
Anton Leontiev
No

When trying to create new file in QGLE (just open QGLE and create new file with default settings) it terminates with the following error:

----- Console output -----
QWidget::setWindowModified: The window title does not contain a '[*]' placeholder
Script:
size 12.0 12.0

GLE 4.2.4b[gle-niXcEH.gle]-C-R-[gle-PzK0M0][.eps]
lcms: Error #12288; Unknown output format
----------

GLE: 4.2.4b
Qt: 4.8.0
Cairo: 1.10.2
Linux: Linux xxx 3.2.7-1-ARCH #1 SMP PREEMPT Tue Feb 21 09:51:29 CET 2012 x86_64 Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz GenuineIntel GNU/Linux

Discussion

  • Jan Struyf
    Jan Struyf
    2012-02-26

    Dear Anton,

    The problem that causes QGLE to terminate is probably "lcms: Error #12288; Unknown output format". I cannot reproduce it and I believe that it is related to your GhostScript install.

    Does GLE work from the command line? For example, try running:

    gle -verbosity 10 -d png somefile.gle

    On my system, this produces:

    GLE 4.2.4b[test.gle]-C-R-[test][.eps]
    [Running: /usr/bin/gs -q -DNOPLATFONTS -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dBATCH -dNOPAUSE -r72 -g286x286 -sDEVICE=png16m -sOutputFile="/home/jan/gle/gle/test.png" -]

    If you get an error when running the GhostScript part, then this is most likely the problem.

    Can you try this and post the result?

    Note: The error "QWidget::setWindowModified: The window title does not contain a '[*]' placeholder", will be fixed in the next GLE release, but this is not the real problem. It is just a warning. If you select "Save As" on the new file dialog box instead of "OK", then you won't see this one.

    Best Regards,

    Jan

     
  • Anton Leontiev
    Anton Leontiev
    2012-02-26

    Dear Jan,
    Thanks for quick response!
    The GLE itself works well. For file containing just "size 12.0 12.0":

    ----- Console output -----
    xxx@yyy ~ $ gle -verbosity 10 -d png some.gle
    GLE 4.2.4b[some.gle]-C-R-[some][.eps]
    [Running: gs -q -DNOPLATFONTS -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dBATCH -dNOPAUSE -r72 -g343x343 -sDEVICE=png16m -sOutputFile="/home/xxx/some.png" -]

    [.png]
    ----------

     
  • Anton Leontiev
    Anton Leontiev
    2012-02-26

    Concerning LCMS:
    I have two versions installed on my computer: 1.19 and 2.3
    But it seems that GLE is using LCMS 1.19.

    ----- Console output -----
    xxx@yyy ~ $ ldd /usr/bin/qgle | grep lcms
    liblcms.so.1 => /usr/lib/liblcms.so.1 (0x00007f659443d000)
    xxx@yyy ~ $ ldd /usr/lib/libgle-graphics-4.2.4b.so | grep lcms
    liblcms.so.1 => /usr/lib/liblcms.so.1 (0x00007f2b3ddf1000)
    ----------

     
  • Roland Wirth
    Roland Wirth
    2012-08-06

    The problem seems to be that the gle libraries link to poppler (Version 0.18), which depends on liblcms.so.1. My ghostscript installation (Version 9.05) uses liblcms2. The gle binary only invokes the ghostscript binary, so there is no clashing between the two libs. QGLE, however, is linked to the gle libs and tries to load libgs via dlopen. I assume that the linker then uses the already loaded liblcms.so.1 to resolve the undefined symbols in libgs.
    Running

    LD_PRELOAD=/usr/lib64/liblcms.so.1 gle -verbosity 10 -d png somefile.png ,

    forcing the loader to load liblcms.so.1 prior to liblcms2 when invoking gs, yields exactly the same error as in the qgle output. So the assumption seems to be valid.

    The documentation to dlopen describes a flag that circumvents this problem: RTLD_DEEPBIND, which is available since glibc 2.3.4, causes the loader to first search the symbol table of the library to be loaded before resorting to the global symbol space. That way, libgs should be bound to the liblcms2 functions.

    Adding this flag to src/gui/qgslibloader.cpp:282 (GLE version 4.2.4b)

    - hmodule = dlopen(strdata.constData(), RTLD_NOW);
    + hmodule = dlopen(strdata.constData(), RTLD_NOW | RTLD_DEEPBIND);

    fixes the qgle crash on my machine.

     
  • Anton Leontiev
    Anton Leontiev
    2012-08-09

    roland_wirth, thank you for your investigation.
    Unfortunately, running on my machine

    LD_PRELOAD=/usr/lib64/liblcms.so.1 gle -verbosity 10 -d png somefile.png

    doesn't gives any error. Adding RTLD_DEEPBIND to the command you've indicated doesn't fix the problem. It seems that you had different bug.

     
  • Anton Leontiev
    Anton Leontiev
    2012-08-18

    I've localized a bit the bug.
    It appears neither if I compile GLE with --without-poppler nor if I check "Render with the Cairo graphics library" checkbox in settings dialogue box.
    Any ideas to check?

     
  • Jan Struyf
    Jan Struyf
    2012-08-19

    Dear Anton,

    After reading your and Roland's comments, this is for sure a clash between incompatible versions of liblcms used by GhostScript and Poppler.

    I don't have this issue on Fedora, so it is distribution dependent.

    Can't you simply always run with "Render with the Cairo graphics library" on if this solves the problem?

    I'll incorporate the RTLD_DEEPBIND patch in the GIT repository.

    Best Regards,

    Jan

     
  • Jan Struyf
    Jan Struyf
    2013-02-03

    • summary: QGLE terminates trying to create new file --> QGLE terminates trying to create new file (lcms: Error #12288)
    • milestone: -->
     
  • Anton Leontiev
    Anton Leontiev
    2013-08-04

    I can't reproduce this bug anymore with GLE 4.2.4c and LCMS 2.5. QGLE works with "Render with the Cairo graphics library" unchecked. So I think it can be closed.