#1125 using stdin can make gnuplot crash


gnuplot 4.6.0.

Originally reported to Debian BTS as


From original bug report (Vincent Lefevre):

Using stdin (whether the command makes sense or not), which is the
common way to call gnuplot from a script, makes gnuplot crash. For

$ echo "foo" | gnuplot -
Segmentation fault (core dumped)

The same underlying problem seems to be behind following problem that appears in some systems

(#665832: gnuplot: Crashes with "Segmentation fault" on every command)

I am attaching a diff with what is currently used in Debian to work around this problem (Patch by Debian new gnuplot maintainer, Anton Gladky)



  • Ethan Merritt

    Ethan Merritt - 2012-05-06

    If the patch fixes this problem, then it clearly must have something to do with use of the BSD libedit for input. Probably we should deprecate this anyhow, since libedit can't handle UTF-8 and has other deficiencies as well. Either gnu libreadline or gnuplot's own readline equivalent are better choices at this point. Note that in version 4.6, several weaknesses of the builtin readline equivalent have been removed. I don't think there is a good case for choosing libedit any more.

  • Ethan Merritt

    Ethan Merritt - 2012-05-06
    • status: open --> pending-accepted
  • Agustin Martin Domingo

    • status: pending-accepted --> open-accepted
  • Agustin Martin Domingo

    Thanks a lot for the quick and efficient reply in all the things I mentioned,

    Unfortunately Debian cannot distribute gnuplot linked against GNU readline because this last is plain GPL (not LGPL).

    I did some tests with gnuplot 4.6 built with internal readline. It seems to work mostly well, thanks for the improvements. The only thing I still find missing are plain Home/End direct keys (not through ^A and ^E). I will let Debian gnuplot maintainer know about my tests.

  • Agustin Martin Domingo

    • status: open-accepted --> pending-accepted
  • Ethan Merritt

    Ethan Merritt - 2012-05-08

    The keypad Home/End should work (and do work when tested here).
    The non-keypad Home key also works as tested here.
    The non-keypad End key is mapped by X to Multi_key by default; at least on my system. It is used similarly to AltGrk for extended character set input. There are various X extensions or local configurations that could map it back to <End> if you prefer that, but it's entirely outside the scope of gnuplot.

  • Ethan Merritt

    Ethan Merritt - 2013-04-24
    • status: pending-accepted --> closed-works-for-me
    • Group: --> 5.0

Log in to post a comment.