[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
return value of octave from command line in case of memory error
From: |
Luca Citi |
Subject: |
return value of octave from command line in case of memory error |
Date: |
Wed, 4 Jan 2012 23:12:12 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Hello,
first of all thank you for developing octave which is a great tool.
My problem...
I have noticed that the return value of octave when running non-interactive is 0
even when octave aborts due to insufficient memory. See below. As the return
value is 1 if there is a different type of error (e.g., undefined function
name), I think it should return non-zero even when the reason for the error is
an unsuccessful allocation. To fix this issue it is sufficient to add "
error_state = 2;" around line 411 (inside the catch bad_alloc) and line 479 of
octave.cc (version 3.2.4) .
Thanks,
Luca
###
octave --eval "a=zeros(1e9);" ; echo $?
error: memory exhausted or requested size too large for range of Octave's index
type -- eval failed
0
octave --eval "a=ZZZzeros(2);" ; echo $?
error: `ZZZzeros' undefined near line 0 column 3
1
octave --eval "a=zeros(2);" ; echo $?
0
###
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- return value of octave from command line in case of memory error,
Luca Citi <=
- Prev by Date:
Stacked bar plot legend reversed
- Next by Date:
Re: Stacked bar plot legend reversed
- Previous by thread:
Stacked bar plot legend reversed
- Next by thread:
Re: set(h,'color',[1,0,0 ; 0,1,0 ; 0,0,0]) or set(h,'color',mat2cell(rainbow(3))) ??
- Index(es):