[Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ?

classic Classic list List threaded Threaded
7 messages Options
Antoine Monmayrant Antoine Monmayrant
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ?

Hello,


I think I found a bug in the current 6.0 branch:

a=uint8(rand(2,2)*255);
b=rand(2,2);
//let's be sure not to divide by 0
while or(b==0)
     b=rand(2,2);
end
//adios amigo: Segmentation fault (core dumped)
a./b

Dividing a uint8 matrix by a double matrix is always causing a segfault
on my machine.
Can you reproduce this bug on your machine?
Does anyone know whether it's a known bug or not?

I have found : https://bugzilla.scilab.org/show_bug.cgi?id=15716 but it
is not exactly the same (I don't do any division by zero, just
element-wise division.


Cheers,


Antoine

--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

  Tel:+33 5 61 33 64 59
 
  email : [hidden email]
  permanent email : [hidden email]

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ?

Le 10/09/2018 à 14:35, [hidden email] a écrit :

> Hello,
>
>
> I think I found a bug in the current 6.0 branch:
>
> a=uint8(rand(2,2)*255);
> b=rand(2,2);
> //let's be sure not to divide by 0
> while or(b==0)
>     b=rand(2,2);
> end
> //adios amigo: Segmentation fault (core dumped)
> a./b
>
> Dividing a uint8 matrix by a double matrix is always causing a
> segfault on my machine.
> Can you reproduce this bug on your machine?
> Does anyone know whether it's a known bug or not?
>
> I have found :
> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15716 
> but it is not exactly the same (I don't do any division by zero, just
> element-wise division.
>
>
> Cheers,
>
>
> Antoine
>
Hello Antoine,

Surely, this is a bug, but what type do you expect for the (eventual)
result ?

S.

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
amonmayr amonmayr
Reply | Threaded
Open this post in threaded view
|

Re: Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ?

Le 10/09/2018 à 14:50, Stéphane Mottelet a écrit :

> Le 10/09/2018 à 14:35, [hidden email] a écrit :
>> Hello,
>>
>>
>> I think I found a bug in the current 6.0 branch:
>>
>> a=uint8(rand(2,2)*255);
>> b=rand(2,2);
>> //let's be sure not to divide by 0
>> while or(b==0)
>>     b=rand(2,2);
>> end
>> //adios amigo: Segmentation fault (core dumped)
>> a./b
>>
>> Dividing a uint8 matrix by a double matrix is always causing a
>> segfault on my machine.
>> Can you reproduce this bug on your machine?
>> Does anyone know whether it's a known bug or not?
>>
>> I have found :
>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15716 
>> but it is not exactly the same (I don't do any division by zero, just
>> element-wise division.
>>
>>
>> Cheers,
>>
>>
>> Antoine
>>
> Hello Antoine,
>
> Surely, this is a bug, but what type do you expect for the (eventual)
> result ?
I don't expect anything from this division, I don't think it makes much
sense. :-)
I just don't expect scilab to die when someone writes something like that!
In fact, I discovered this bug while I was progressively changing the
type of my variables from uint8 to double.
As a side note, when dividing a uint8() by a double() matlab returns a
uint8(), which is not really intuitive to me.

Cheers,

Antoine
>
> S.
>

--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

  Tel:+33 5 61 33 64 59
 
  email : [hidden email]
  permanent email : [hidden email]

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
amonmayr amonmayr
Reply | Threaded
Open this post in threaded view
|

Re: Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ?

In reply to this post by mottelet
Le 10/09/2018 à 14:50, Stéphane Mottelet a écrit :

> Le 10/09/2018 à 14:35, [hidden email] a écrit :
>> Hello,
>>
>>
>> I think I found a bug in the current 6.0 branch:
>>
>> a=uint8(rand(2,2)*255);
>> b=rand(2,2);
>> //let's be sure not to divide by 0
>> while or(b==0)
>>     b=rand(2,2);
>> end
>> //adios amigo: Segmentation fault (core dumped)
>> a./b
>>
>> Dividing a uint8 matrix by a double matrix is always causing a
>> segfault on my machine.
>> Can you reproduce this bug on your machine?
>> Does anyone know whether it's a known bug or not?
>>
>> I have found :
>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15716 
>> but it is not exactly the same (I don't do any division by zero, just
>> element-wise division.
>>
>>
>> Cheers,
>>
>>
>> Antoine
>>
> Hello Antoine,
>
> Surely, this is a bug, but what type do you expect for the (eventual)
> result ?
I reported a bug: https://bugzilla.scilab.org/show_bug.cgi?id=15759
Can some or you try my test script for your OS/scilab version?
Weirdly enough, under scilab 5.5.2, there is no segfault, but scilab
complains about a division by zero (whereas there is no division by zero).

Antoine
>
> S.
>

--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

  Tel:+33 5 61 33 64 59
 
  email : [hidden email]
  permanent email : [hidden email]

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
amonmayr amonmayr
Reply | Threaded
Open this post in threaded view
|

Re: Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ?

Le 10/09/2018 à 15:28, [hidden email] a écrit :

> Le 10/09/2018 à 14:50, Stéphane Mottelet a écrit :
>> Le 10/09/2018 à 14:35, [hidden email] a écrit :
>>> Hello,
>>>
>>>
>>> I think I found a bug in the current 6.0 branch:
>>>
>>> a=uint8(rand(2,2)*255);
>>> b=rand(2,2);
>>> //let's be sure not to divide by 0
>>> while or(b==0)
>>>     b=rand(2,2);
>>> end
>>> //adios amigo: Segmentation fault (core dumped)
>>> a./b
>>>
>>> Dividing a uint8 matrix by a double matrix is always causing a
>>> segfault on my machine.
>>> Can you reproduce this bug on your machine?
>>> Does anyone know whether it's a known bug or not?
>>>
>>> I have found :
>>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15716 
>>> but it is not exactly the same (I don't do any division by zero,
>>> just element-wise division.
>>>
>>>
>>> Cheers,
>>>
>>>
>>> Antoine
>>>
>> Hello Antoine,
>>
>> Surely, this is a bug, but what type do you expect for the (eventual)
>> result ?
> I reported a bug: https://bugzilla.scilab.org/show_bug.cgi?id=15759
> Can some or you try my test script for your OS/scilab version?
> Weirdly enough, under scilab 5.5.2, there is no segfault, but scilab
> complains about a division by zero (whereas there is no division by
> zero).
Also, division (not element-wise division) gives a funny result, both
for 5.5.2 and the current master:

a=uint8(rand(2,2)*255);
b=rand(2,2);
//let's be sure not to divide by 0
while or(b==0)
     b=rand(2,2);
end
//just a division :
// master and scilab-6.0 : Operator / : Error -1 not yet managed.
// 5.5.2 : !--error 26
//            Too complex recursion! (recursion tables are full)
//            at line       9 of function %i_r_i called by :   ...
a/b


>
> Antoine
>>
>> S.
>>
>

--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

  Tel:+33 5 61 33 64 59
 
  email : [hidden email]
  permanent email : [hidden email]

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ?

In reply to this post by amonmayr
Antoine,

As requested, your script seems to produce the same results in Win 7 64-bit  Scilab 5.5.2 and 6.0.1, as you reported for Linux_x64.

Regards,
Rafael
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Philippe Roux Philippe Roux
Reply | Threaded
Open this post in threaded view
|

Re: Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ?

In reply to this post by Antoine Monmayrant
Le 10/09/2018 à 14:35, [hidden email] a
écrit :
> a=uint8(rand(2,2)*255);
> b=rand(2,2);
> //let's be sure not to divide by 0
> while or(b==0)
>     b=rand(2,2);
> end
> //adios amigo: Segmentation fault (core dumped)
> a./b


I confirm scilab crash while executing this code in scilab-6.0.1  and
ubuntu 18.04, in the console I have message about  floating point
exception and divide-by-zero*.

Best regards

Philippe

* from console :

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:10145] Signal: Exception en point flottant (8)
[jenny-a-03:10145] Signal code: Integer divide-by-zero (1)
[jenny-a-03:10145] Failing at address: 0x7f7f744a0293

Pile d'appel :
   1: 0x8f260b <JVM_handle_linux_signal>
(/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: 0x357293 <types::InternalType* dotdiv_M_M<types::Int<unsigned
char>, types::Double, types::Int<unsigned char> >(types::Int<unsigned
char>*, types::Double*)> (/usr/lib/scilab/libsciast.so.6)
   5: 0x3349f6 <GenericDotRDivide(types::InternalType*,
types::InternalType*)> (/usr/lib/scilab/libsciast.so.6)
   6: 0x191dfb
<ast::RunVisitorT<ast::ExecVisitor>::visitprivate(ast::OpExp const&)>
(/usr/lib/scilab/libsciast.so.6)
   7: 0x1be9ff
<ast::RunVisitorT<ast::ExecVisitor>::visitprivate(ast::SeqExp const&)>
(/usr/lib/scilab/libsciast.so.6)
   8: 0x1a17c2 <StaticRunner::launch()>
(/usr/lib/scilab/libscilab-cli.so.6)
   9: 0x19a52a <RunScilabEngine>
(/usr/lib/scilab/libscilab-cli.so.6)
  10: 0x19ac   <main>                           (/usr/bin/scilab-bin)
  11: 0x21b97  <__libc_start_main>
(/lib/x86_64-linux-gnu/libc.so.6)
  12: 0x24ca   < >                              (/usr/bin/scilab-bin)
Fin de la pile



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users