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.

Close

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

closed-accepted
nobody
None
5
2012-05-07
2012-05-06
No

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

http://bugs.debian.org/598547

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 minimal.gp
plot x

Discussion

  • Ethan Merritt
    Ethan Merritt
    2012-05-06

    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
    2012-05-06

    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.
    Suggestions?

    State when hung:

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

     
  • Ethan Merritt
    Ethan Merritt
    2012-05-07

    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
    2012-05-07

    • status: open --> closed-accepted