Menu

#2456 Strange output with set key title using epslatex terminal

None
open-upstream-bug
nobody
None
2022-08-15
2021-09-02
Anonymous
No

Having an issue when adding a title to a key in the epslatex terminal.

With "set key", everything works. When I add "set key title 'xxx'", then I get an error when attempting to compile the .tex file of "Dimension too large". This appears to be because the key title's y position is being set to funny values like 1073746140 or -2147479442 (see lines 168 and 170 in the attached .tex that has key title enabled).

Provided a MWE demonstrating the funny output.

This is gnuplot 5.4.2 on Windows 10

Thanks in advance!

2 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2021-09-02

    I can't reproduce this in any of versions 5.2.6 5.4.0 5.4.1 5.4.2 5.5

    So I don't think the epslatex terminal is inherently buggy. I'm running on linux, but I have also tried running your test script using the Windows 5.4.1 binary in the wine emulator. No problems there either.

    Can anyone on a real Windows 10 system confirm this bug?

     
  • Gabriel Dupras

    Gabriel Dupras - 2021-09-02

    I can confirm that this is happening on Windows 10 with gnuplot 5.4.2. Here's a diff of test_key-title_fig.tex:

    --- no-key-title/test_key-title_fig.tex 2021-09-02 10:14:07.804128700 -0400
    +++ key-title/test_key-title_fig.tex    2021-09-02 10:14:52.742447300 -0400
    @@ -165,8 +165,9 @@
           \csname LTb\endcsname%%
           \put(209,2541){\rotatebox{-270}{\makebox(0,0){\strut{}test}}}%
           \put(3940,154){\makebox(0,0){\strut{}test}}%
    +      \put(5979,1073746140){\makebox(0,0){\strut{}test}}%
           \csname LTb\endcsname%%
    -      \put(5816,4206){\makebox(0,0)[r]{\strut{}test}}%
    +      \put(5816,-2147479442){\makebox(0,0)[r]{\strut{}test}}%
           \csname LTb\endcsname%%
           \put(3940,4709){\makebox(0,0){\strut{}test}}%
         }%
    
     
    • Ethan Merritt

      Ethan Merritt - 2021-09-02

      Note that -2147479442 is hex 8000106e, 4206 is hex 106e

      So it looks like something has flipped a bit in this one number.
      1073746140 is hex 400010dc, so that also looks suspiciously like a bit-flip.

      Corrupt executable? Compiler error?

       
  • Bastian Märkisch

    Verifyed with gnuplot 5.4.2 on Windows 10. I get correct output using GUI wgnuplot, but not with console mode gnuplot. Interestingly, the error goes away if I try to debug optimize with "-Og" instead of "-O2". So this may indeed be compiler related. But, the compiler options for these two gnuplot variants only differ in "-mwindows" vs. "-DWGP_CONSOLE -mconsole". So nothing related to optimisation.
    gcc version is 10.3.0 (Rev5).

     
    • Bastian Märkisch

      Using #pragma GCC optimize ("O0") to disable optimizations for draw_key() in boundary.c solves the issue. Already "O1" shows the problem.

       
  • Ethan Merritt

    Ethan Merritt - 2022-08-15
    • status: open --> open-upstream-bug
    • Group: -->
    • Priority: -->
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.