Re: [Scilab-users] Scilab 6.0.1 crashes with printf command

2018-09-03 Thread Rafael Guerra
Stephane,

Thanks for the bugzilla reference, which I was surprised to see as I have 
searched there before posting, with search strings like %% but it produced no 
results...
This raises my next question: how to seach Bugzilla for "%%" string?

Regards,
Rafael

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab 6.0.1 crashes with printf command

2018-09-03 Thread Stéphane Mottelet

Le 03/09/2018 à 22:30, Rafael Guerra a écrit :


Dear Scilabers,

Any clues on why the following command totally crashes Scilab 6.0.1 on Win7:
--> printf("A = B ./(C+%%eps)   (to avoid division by 0)\n");

while in Scilab 5.5.2 escapes % and outputs properly:
  A = B ./(C+%eps)   (to avoid division by 0)

How to escape % in Scilab 6.0.1's printf?

PS:
one workaround is to: printf("A = B ./(C+%seps)   (to avoid division by 
0)\n","%")
but it looks weird...

Regards,
Rafael

___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users

Hello,

This is http://bugzilla.scilab.org/show_bug.cgi?id=15441, it has been 
fixed on branch-6.0 and master:


http://gitweb.scilab.org/?p=scilab.git;a=commit;h=dd4dd2c315bbb4989ed25f631d7e887b0ed70c44

S.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Please unsubscribe me from this mailing list.

2018-09-03 Thread Klaus Rohe
 

 

Dipl.-Phys. Klaus Rohe

Adolf-Kolping-Str. 10a

85625 Glonn

Email: klaus-r...@t-online.de

Telefon: +49 (0) 8093 5402

Mobil: +49 (0) 170 8133634 

 

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab 6.0.1 crashes with printf command

2018-09-03 Thread philippe
Le 03/09/2018 à 22:30, Rafael Guerra a écrit :
> Dear Scilabers,
> 
> Any clues on why the following command totally crashes Scilab 6.0.1 on Win7:
> --> printf("A = B ./(C+%%eps)   (to avoid division by 0)\n");


first note that printf is obsolete in scilab-6.0.0 and will be removed
in scilab-6.1.0. But I confirm this the same behavior  with mprintf and
scilab-6.0.1 in ubuntu 18.04.1. Additional console message below if this
can help.

Best regards,

Philippe

Une erreur fatale a été détectée par Scilab.
Veuillez vérifier les fonctions définies par l'utilisateur (ou celles
des modules externes), elles devraient apparaître dans le suivi de la pile.
Ou sinon, vous pouvez reporter un bug sur http://bugzilla.scilab.org/ avec :
  * un simple code qui reproduit le problème
  * le résultat de [a, b] = getdebuginfo()
  * l'information suivante :
[jenny-a-03:05851] Signal: Erreur de segmentation (11)
[jenny-a-03:05851] Signal code:  (128)
[jenny-a-03:05851] Failing at address: (nil)

Pile d'appel :
   1: 0x8f260b 
(/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
   2: 0x8e5318 < >
(/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so)
   3: 0x12890  < >
(/lib/x86_64-linux-gnu/libpthread.so.0)
   4: 0x387b9c , std::allocator > const&, wchar_t const*,
std::vector
>&, int*, int*)> (/usr/lib/scilab/libscilab-cli.so.6)
   5: 0x37c2cb  >&, int,
std::vector
>&)> (/usr/lib/scilab/libscilab-cli.so.6)
   6: 0x48be3a
 >&,
std::unordered_map, std::allocator >,
types::InternalType*, std::hash
(/usr/lib/scilab/libsciast.so.6)
   7: 0x1c23fd
::visitprivate(ast::CallExp const&)>
(/usr/lib/scilab/libsciast.so.6)
   8: 0x1be9ff
::visitprivate(ast::SeqExp const&)>
(/usr/lib/scilab/libsciast.so.6)
   9: 0x1a17c2 
(/usr/lib/scilab/libscilab-cli.so.6)
  10: 0x19a52a 
(/usr/lib/scilab/libscilab-cli.so.6)
  11: 0x19ac  (/usr/bin/scilab-bin)
  12: 0x21b97  <__libc_start_main>
(/lib/x86_64-linux-gnu/libc.so.6)
  13: 0x24ca   < >  (/usr/bin/scilab-bin)
Fin de la pile


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab 6.0.1 crashes with printf command

2018-09-03 Thread Heinz Nabielek
On 03.09.2018, at 22:30, Rafael Guerra  wrote:
> 
> printf("A = B ./(C+%%eps)   (to avoid division by 0)\n");

Same on Mac OS X Scilab 6.0.1
Heinz


"Scilb quit unexpectedly"
Process:   scilab-bin [985]
Path:  
/Applications/scilab-6.0.1.app/Contents/MacOS/bin/scilab-bin
Identifier:org.scilab.modules.jvm.Scilab
Version:   0
Code Type: X86-64 (Native)
Parent Process:??? [939]
Responsible:   scilab-bin [985]
User ID:   501

Date/Time: 2018-09-03 22:35:11.218 +0200
OS Version:Mac OS X 10.14 (18A377a)

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Scilab 6.0.1 crashes with printf command

2018-09-03 Thread Rafael Guerra
Dear Scilabers,

Any clues on why the following command totally crashes Scilab 6.0.1 on Win7:
--> printf("A = B ./(C+%%eps)   (to avoid division by 0)\n");

while in Scilab 5.5.2 escapes % and outputs properly:
 A = B ./(C+%eps)   (to avoid division by 0)

How to escape % in Scilab 6.0.1's printf?

PS:
one workaround is to: printf("A = B ./(C+%seps)   (to avoid division by 
0)\n","%")
but it looks weird...

Regards,
Rafael

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] diary lost in try/catch statement .

2018-09-03 Thread philippe
Le 03/09/2018 à 12:38, amonm...@laas.fr a écrit :
> Hello,
> 
> As a workaround, if you replace
>     1!=0  // syntax error
> with
>     str="1!=0";
>     evstr(str);
> it seems to work as you expected.

Yes the bug disappear with execstr ? In fact my example wasn't clear
enough, here is a better one showing my problem. I have a script nammed
bugged.sce

disp('let''s make an error')
ieee(0);1/0  // syntax error

//and I want to test it with and auxiliary script :

unix("rm file.txt")// linux only
diary(0)
try diary('file.txt','new');
exec('bugged.sce',3);
diary('file.txt','close');
catch
disp('added to diary')
[str,n,line,func]=lasterror();
printf(" error %d line %d in %s\n error message :\n
%s\n",n,line,func,str)
end
diary('file.txt','close');

//then I get the expected file.txt


--> disp('let''s make an error')

 let's make an error

--> ieee(0);1/0;// syntax error

 added to diary
 error 999 line 0 in exec
 error message :
 Division par zéro...

//now replace bugged.sce with

disp('let''s make an error')
1!=0  // syntax error

//then I get a wrong file file.txt


 added to diary
 error 999 line 4 in
 error message :
 1!=0;// syntax error

because the diary before the error is lost ! The problem occurs only
with "syntax error" :

'l'apostrophe'
1=2
1!=0


not with old errors like :

ieee(0);1/0
rand(2,2)*rand(3,3);
> 
> Anyway, I think the try/catch structure can catch errors occurring at
> runtime (like division by zero, etc ...), but not syntax errors.
> You are supposed to write syntactically correct Scilab!

my goal is to retrieve errors automatically from scripts with bugs (for
example for automatic testing of scripts I didn't wrote myself ) using
lasterror()  in the catch statement.

Best Regards,

Philippe

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] diary lost in try/catch statement .

2018-09-03 Thread amonmayr

Hello,

As a workaround, if you replace
    1!=0  // syntax error
with
    str="1!=0";
    evstr(str);
it seems to work as you expected.

Anyway, I think the try/catch structure can catch errors occurring at 
runtime (like division by zero, etc ...), but not syntax errors.

You are supposed to write syntactically correct Scilab!

Antoine


Le 03/09/2018 à 11:48, philippe a écrit :

Hi,

In scilab-5 I used to save console output of script file execution in a
text file with "diary", this seems to fail in scilab-6, for new errors
types recently added (Syntax error, Unexpected token ).  Perhaps I
misunderstood something in try/catch statement , let's consider the file
bug_syntax_error.sce containing :

diary(0)
diary('file.txt','new');
try disp('let''s make an error')
 1!=0  // syntax error
catch
 disp('added to diary')
end
diary('file.txt','close')


execute this script with CTRL+SHIFT+E  or "exec" will not create file.txt


--> exec('bug_syntax_error.sce', -1)
à la ligne 4 du fichier exécuté bug_syntax_error.sce

 1!=0  // syntax error
  ^^
Erreur : Unexpected token '!'

--> mgetl file.txt

mgetl : Impossible d'ouvrir le fichier file.txt.

execute this script from scinotes with CTRL+E will give :


--> diary(0)

--> diary('file.txt','new');

--> try disp('let''s make an error')
   > 1!=0  // syntax error
   > catch
   > disp('added to diary')
   > end
 1!=0  // syntax error
  ^^
Erreur : Unexpected token '!'

--> diary('file.txt','close')

--> mgetl file.txt
  ans  =

!  !
!  !
!--> try disp('let''s make an error')  !
!  !
!  > 1!=0  // syntax error !
!  !
!  > catch !
!  !
!  > disp('added to diary')!
!  !
!  > end   !
!  !
!1!=0  // syntax error !
!  !
! ^^   !
!  !
!Erreur : Unexpected token '!' !
!  !
!  !
!  !
!--> diary('file.txt','close') !


I also remark that those new errors (like bad comparisons 1=2  or bad
string delimiters mixing ' and " ) have no localization. This doesn't
happend with "old" errors (which have localization), replacing "1!=0"
with "ieee(0),1/0" I get :

--> exec('bug_syntax_error.sce', -1)

  let's make an error

  added to diary

--> mgetl file.txt
  ans  =

!  !
!  !
! let's make an error  !
!  !
!  !
!  !
! added to diary   !


Best regards,

Philippe

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



--
+++

 Antoine Monmayrant LAAS - CNRS
 7 avenue du Colonel Roche
 BP 54200
 31031 TOULOUSE Cedex 4
 FRANCE

 Tel:+33 5 61 33 64 59
 
 email : antoine.monmayr...@laas.fr

 permanent email : antoine.monmayr...@polytechnique.org

+++

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] diary lost in try/catch statement .

2018-09-03 Thread philippe
Hi,

In scilab-5 I used to save console output of script file execution in a
text file with "diary", this seems to fail in scilab-6, for new errors
types recently added (Syntax error, Unexpected token ).  Perhaps I
misunderstood something in try/catch statement , let's consider the file
bug_syntax_error.sce containing :

diary(0)
diary('file.txt','new');
try disp('let''s make an error')
1!=0  // syntax error
catch
disp('added to diary')
end
diary('file.txt','close')


execute this script with CTRL+SHIFT+E  or "exec" will not create file.txt


--> exec('bug_syntax_error.sce', -1)
à la ligne 4 du fichier exécuté bug_syntax_error.sce

1!=0  // syntax error
 ^^
Erreur : Unexpected token '!'

--> mgetl file.txt

mgetl : Impossible d'ouvrir le fichier file.txt.

execute this script from scinotes with CTRL+E will give :


--> diary(0)

--> diary('file.txt','new');

--> try disp('let''s make an error')
  > 1!=0  // syntax error
  > catch
  > disp('added to diary')
  > end
1!=0  // syntax error
 ^^
Erreur : Unexpected token '!'

--> diary('file.txt','close')

--> mgetl file.txt
 ans  =

!  !
!  !
!--> try disp('let''s make an error')  !
!  !
!  > 1!=0  // syntax error !
!  !
!  > catch !
!  !
!  > disp('added to diary')!
!  !
!  > end   !
!  !
!1!=0  // syntax error !
!  !
! ^^   !
!  !
!Erreur : Unexpected token '!' !
!  !
!  !
!  !
!--> diary('file.txt','close') !


I also remark that those new errors (like bad comparisons 1=2  or bad
string delimiters mixing ' and " ) have no localization. This doesn't
happend with "old" errors (which have localization), replacing "1!=0"
with "ieee(0),1/0" I get :

--> exec('bug_syntax_error.sce', -1)

 let's make an error

 added to diary

--> mgetl file.txt
 ans  =

!  !
!  !
! let's make an error  !
!  !
!  !
!  !
! added to diary   !


Best regards,

Philippe

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users