Re: questions about rtai-lab and qrtailab

Paolo Mantegazza <[email protected]> Tue, 17 Oct 2017 16:37:15 +0200
Newsgroups gmane.linux.real-time.rtai
Message-ID <[email protected]>
On 10/17/2017 09:04 AM, Tom wrote:
> All the same. I tried both ways.
>
> So why don't we just add a null pointer guard ?  It is a good 
> programming practice.
>

As I said it is not just a matter of that fix, but to understand what's 
going on.
I've just had a check carried out by people using it and the problem 
does not  show up.
However, it is a fact that they tested with a Matlab (Symulink-RTW) 
generated code.
Thus it is likely that it went unnoticed here as it could just happen 
because RT_RPC is called only within scicoslab.

In any case a fix is needed.  Though it will not be the way you suggested.
RTAI already checks a null pointer in rt_receive and there is no need of 
using the ret variable, but an unsigned long reply should be enough.
Tomorrow I hope to find the time to fix it my way and have a further 
formal  check.
Then I'll send you a new tarball  for a final check.
Anticipated thanks and ... stay tuned.

Paolo.

>
> tom@shanghai
>
> At 2017-10-17 14:54:02, "Paolo Mantegazza" 
> <[email protected]> wrote:
>
>     As a further clue, are you setting it as local host, i.e. 
>     127.0.0.1, ore as 0? In the case you are using 127.0.0.1 can you
>     try and see what happens by using 0?
>
>     Paolo
>
>     On 10/17/2017 02:58 AM, Tom wrote:
>>     I am using it locally.
>>
>>     host  i5-6200  64bit cpu
>>     virtualbox 5.1.14
>>     ubuntu14.04
>>     gcc 4.8.4
>>
>>     it will core-dump here
>>
>>     int QRtaiLabCore::connectToTarget()
>>     {
>>     char buf[128];
>>     sprintf(buf, "Trying to connect to %s",
>>     targetthread->getPreferences().Target_IP);
>>     statusBarMessage(tr(buf));
>>     *qrl::RT_RPC(targetthread->getTask(),
>>     TargetThread::CONNECT_TO_TARGET, 0);*
>>
>>
>>     tom@shanghai
>>
>>
>>     在 2017-10-16 18:23:17,"Paolo Mantegazza"
>>     <[email protected]> 写道:
>>
>>         On 10/16/2017 11:17 AM, Tom wrote:
>>>         From
>>>
>>>         https://www.rtai.org/userfiles/downloads/RTAILAB/qrtailab-0.1.12.tar.bz2
>>>
>>         Qrtailab has been used because of the EFLTK troubles in
>>         setting RTAILab on 64 bits machines. A few fixes have made it
>>         work reliably for our application at hand, but we are not yet
>>         at ease with its internals.
>>
>>         Then is something that should be cared of. I see that RT_RPC
>>         is systematically called  with a null pointer, nonetheless no
>>         crash happens in the use I'm seeing at work here around.
>>
>>         How are you using it (locally vs distributed).Do you witness
>>         any crash without the fix you are pointing at?
>>
>>         Paolo
>>
>>>
>>>
>>>
>>>         At 2017-10-16 17:00:49, "Paolo Mantegazza"
>>>         <[email protected]> wrote:
>>>
>>>             I'll pass the question to the scicoslab interface expert.
>>>             On my side I would like to know where did you take
>>>             qrtailab from?
>>>             Paolo
>>>
>>>             On 10/16/2017 10:02 AM, Tom wrote:
>>>>             Hi, all
>>>>
>>>>             I am new to rtai and trying to use rtai-lab with
>>>>             scicoslab.
>>>>             Config:
>>>>             linux 3.18.20
>>>>             rtai 5.0.1
>>>>             scicoslab 4.4.1
>>>>             qrtailab-0.1.12
>>>>
>>>>             I think function `set_double' in rtmain44.c goes wrong
>>>>             when running on x86_64 arch.
>>>>               unsigned long l = ((unsigned long *)from)[0];
>>>>               unsigned long h = ((unsigned long *)from)[1];
>>>>             because unsigned long would take 8 bytes.
>>>>
>>>>             And I think there should be a null pointer guard before
>>>>             assignment in qrtailab/src/qrtailab.h  line 115 
>>>>             function RT_RPC
>>>>             *reply = (unsigned int)ret;
>>>>             to
>>>>             if (reply)
>>>>                     {
>>>>                           *reply = (unsigned int)ret;
>>>>                     }
>>>>
>>>>             regards.
>>>>
>>>>             tom@shanghai
>>>>
>>>>
>>>>             【网易自营】好吃到爆!鲜香弹滑加热即食,经典13香/麻辣小龙虾仅75元3斤>>
>>>>             <http://you.163.com/item/detail?id=1183001&from=web_gg_mail_jiaobiao_7>
>>>>
>>>>
>>>>
>>>>             _______________________________________________
>>>>             Rtai mailing list
>>>>             [email protected]
>>>>             https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
>>>
>>>
>>>
>>>
>>>         【网易自营】好吃到爆!鲜香弹滑加热即食,经典13香/麻辣小龙虾仅75元3斤>>
>>>         <http://you.163.com/item/detail?id=1183001&from=web_gg_mail_jiaobiao_7>
>>>
>>
>>
>>
>>
>>     【网易自营】好吃到爆!鲜香弹滑加热即食,经典13香/麻辣小龙虾仅75元3斤>>
>>     <http://you.163.com/item/detail?id=1183001&from=web_gg_mail_jiaobiao_7>
>>
>
>
>
>
> 【网易自营】好吃到爆!鲜香弹滑加热即食,经典13香/麻辣小龙虾仅75元3斤>> 
> <http://you.163.com/item/detail?id=1183001&from=web_gg_mail_jiaobiao_7>

_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai