Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#1124 Gnuplot batch mode task stops when called from a backgrounde


Originally reported for 4.4.0 and seemed fixed for 4.4.2. However reproducible again for gnuplot 4.6.0.

Originally reported at Debian bug tracking system (BTS) as

From original submitter (Terry Bullett),

I use gnuplot in bash scripts which create gnuplot command files and
then call gnuplot to make the files. Version 4.4.0 will enter a state
of 'T' (stopped) when the parent bash script is running in the background.
Executution is normal when the parent script is in the foreground.
An update to 4.4.2 has resolved this problem, but this version is not in
the Debian squeeze package.

However, this seems to have been reintroduced somewhere later (Ron)

$ gnuplot sweep-plot.script &
[4] 17479
$ ps xau | grep gnuplot
ron 13484 0.0 0.2 318804 19300 pts/4 S 04:13 0:00 gnuplot
ron 14136 0.0 0.0 256540 6732 pts/4 S 04:16 0:00 gnuplot
ron 17479 0.0 0.0 77880 2112 pts/4 T 05:02 0:00 gnuplot sweep-plot.script
ron 17481 0.0 0.0 8028 844 pts/4 S+ 05:02 0:00 grep gnuplot

[4]+ Stopped gnuplot sweep-plot.script

So this is either still not fixed in 4.6.0-1, or has been reintroduced again.

I can reproduce this even with a minimal gnuplot file

$ cat
plot x


  • Ethan Merritt
    Ethan Merritt

    Your other bug report is specific to use of the BSD libedit library for input. Could it be that this one is also? Can you reproduce this when gnuplot is built to use either the GNU libreadline or its own built-in readline equivalent for input?

  • Ethan Merritt
    Ethan Merritt

    Following up on my previous suspicion...
    Yup, seems to be a bug in use of the rl_initialize emulation routine in BSD libedit.
    I don't know how to fix it.

    State when hung:

    (gdb) where
    #0 0xffffe424 in __kernel_vsyscall ()
    #1 0xb6a70387 in tcsetattr () from /lib/i686/
    #2 0xb769e009 in ?? () from /usr/lib/
    #3 0xb769e23c in tty_init () from /usr/lib/
    #4 0xb76946e7 in el_init () from /usr/lib/
    #5 0xb76a5f01 in rl_initialize () from /usr/lib/
    #6 0xb76a807d in using_history () from /usr/lib/
    #7 0x080ae386 in main (argc=2, argv=0xbfd6d154) at plot.c:336

  • Ethan Merritt
    Ethan Merritt

    Added a work-around: call history_init() rather than use_history() if the BSD editline is selected.

    But as with the other editline bug, my real suggestion is to use either gnu libreadline or gnuplot's builtin equivalent.

  • Ethan Merritt
    Ethan Merritt

    • status: open --> closed-accepted