bugGNU Octave - Bugs: bug #35318, Unclear precedence between --eval,...

 
 

bug #35318: Unclear precedence between --eval, script file, and stdin

Submitted by:  Muhali <muhali>
Submitted on:  Mon 16 Jan 2012 07:40:16 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 04 Jan 2015 03:19:51 AM UTC, comment #12:

Well, one thing that would be easy would be to add the .NOTPARALLEL directive to Makefile.am in doc/interpreter. This forces the directory in question to be built with the equivalent of 'make -j1'.

Rik <rik5>
Project Administrator
Sat 03 Jan 2015 05:53:05 PM UTC, comment #11:

Andreas' analysis is certainly correct. I put in some printf statements to stderr and in a group of make subprocesses spawned at the same time only one of the instances has isatty true. This could be because isatty is not re-entrant, or it could be that stdin isn't getting dup'ed to the child processes, or there is a race condition.

In any case, I don't think many people try to invoke octave with both a redirect and an --eval or script file. I don't want to spend more time on this bug than it is worth so I simply took out the tests in this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/65f4d9e1206c).

Rik <rik5>
Project Administrator
Sat 03 Jan 2015 03:58:14 PM UTC, comment #10:

It's described here: https://www.gnu.org/software/make/manual/html_node/Parallel-Input.html#Parallel-Input

We should somehow check for the "broken pipe" condition.

Andreas Weber <andy1978>
Project Member
Sat 03 Jan 2015 03:25:55 PM UTC, comment #9:

@Andy: Yes I was parallel building using "make -j4", and I can confirm using "make" lets the doc build as expected.

I also can confirm that running your "Makefile_check" with two jobs triggers the error in the second job:

Pantxo Diribarne <pantxo>
Project Member
Sat 03 Jan 2015 02:18:09 PM UTC, comment #8:

I made some checks

when run from "make -j3" with multiple independent targets returns one false, two true.

Run attached Makefile with "make -j2 -f Makefile_check" to trigger the bug.

(file #32752)

Andreas Weber <andy1978>
Project Member
Sat 03 Jan 2015 01:51:08 PM UTC, comment #7:

@Pantxo: You were parallel building with "make -j4" or something, right?

I can see this too but only with parallel build. Is it possible that

+verbatim
bool stdin_is_tty = gnulib::isatty (fileno (stdin));
-verbatim-

returns false if called from make during a parallel build?

Andreas Weber <andy1978>
Project Member
Sat 03 Jan 2015 11:38:23 AM UTC, comment #6:

Hi,

I can't build the doc anymore:

@Rik: I suppose this is due to your last changeset. Do you have an idea how should the command line call to "run-octave" be tweaked in order to have it work again?

Pantxo Diribarne <pantxo>
Project Member
Sat 03 Jan 2015 02:19:25 AM UTC, comment #5:

I made the 3 options of --eval CODE, script file, and '< script' mutually exclusive in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/18377fc879d0). Closing report.

Rik <rik5>
Project Administrator
Sat 20 Apr 2013 08:29:44 PM UTC, comment #4:

Changing status and retitling for clarity.

Mike Miller <mtmiller>
Project Administrator
Wed 11 Apr 2012 06:29:22 PM UTC, comment #3:

Okay. I see the issue now. I think it would be clearer if --eval and supplying a file or raw code on stdin were mutually exclusive options. I'll take a look at that.

Rik <rik5>
Project Administrator
Wed 11 Apr 2012 05:15:17 PM UTC, comment #2:

no change (using current tip of April 11).

Note that this is not about staying in octave or not, but about whether 'disp(e)' is executed.

Muhali <muhali>
Wed 11 Apr 2012 06:46:07 AM UTC, comment #1:

This works for me. I tested both versions in both Bourne sh and in tcsh and they exit without staying in Octave. This is for a recent tip (4/10/12).

Could you reverify that this behavior still exists for you? Also, to make sure it is nothing in your .octaverc try adding '-f' to the command line so it reads

Rik <rik5>
Project Administrator
Mon 16 Jan 2012 07:40:16 PM UTC, original submission:

The help on command line options has

`--eval CODE'
Evaluate CODE and exit when done unless `--persist' is also
specified.

but octave does not exit when invoked with a script file, such as

It does exit when the script is invoked from stdin:

I suggest a phrase like 'and exit if FILE is empty' as help text.

Muhali <muhali>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #32752:  Makefile_check added by andy1978 (372B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by muhali (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 03 Jan 2015 02:18:09 PM UTCandy1978Attached File-=>Added Makefile_check, #32752
    Sat 03 Jan 2015 02:19:25 AM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Sat 20 Apr 2013 08:29:44 PM UTCmtmillerStatusWorks For Me=>Confirmed
      Summaryexit octave after --eval CODE ?=>Unclear precedence between --eval, script file, and stdin
    Wed 11 Apr 2012 06:46:07 AM UTCrik5StatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1