ROS2/pendulum demo (and rttest/example_loop) get killed if 8GB free RAM is not satisfied.
Hi !
I am using Ubuntu 16.04 with a real-time patched kernel (4.14.93-rt53). I have tested my system with cyclic tests and am happy about the realtime performance.
I have built and installed Ros2 (Crystal Clemmys) according to this manual: https://index.ros.org/doc/ros2/Instal... . The talker and listener examples work fine.
When I try to run the pendulum demo ( https://index.ros.org/doc/ros2/Tutori... ) I get an unexpected output:
$ RMW_IMPLEMENTATION=rmw_connext_cpp pendulum_demo
RTI Data Distribution Service Non-commercial license is for academic, research, evaluation and personal use only. USE FOR COMMERCIAL PURPOSES IS PROHIBITED. See RTI_LICENSE.TXT for terms. Download free tools at rti.com/ncl. License issued to Non-Commercial User license@rti.com For non-production use only.
Expires on 00-jan-00 See www.rti.com for more information.
RTI Data Distribution Service Non-commercial license is for academic, research, evaluation and personal use only. USE FOR COMMERCIAL PURPOSES IS PROHIBITED. See RTI_LICENSE.TXT for terms. Download free tools at rti.com/ncl. License issued to Non-Commercial User license@rti.com For non-production use only.
Expires on 00-jan-00 See www.rti.com for more information.
Couldn't set scheduling priority and policy: Operation not permitted
Killed
I could get rid of the line:
Couldn't set scheduling priority and policy: Operation not permitted
I have tried to give the rights according to this: https://index.ros.org/doc/ros2/Tutori...
I can also see (after logon/logoff) that the rights are updated accordingly:
$ ulimit -r
98
Now the output is without this line, but still gets killed:
$ RMW_IMPLEMENTATION=rmw_connext_cpp pendulum_demo
RTI Data Distribution Service Non-commercial license is for academic, research, evaluation and personal use only. USE FOR COMMERCIAL PURPOSES IS PROHIBITED. See RTI_LICENSE.TXT for terms. Download free tools at rti.com/ncl. License issued to Non-Commercial User license@rti.com For non-production use only.
Expires on 00-jan-00 See www.rti.com for more information.
RTI Data Distribution Service Non-commercial license is for academic, research, evaluation and personal use only. USE FOR COMMERCIAL PURPOSES IS PROHIBITED. See RTI_LICENSE.TXT for terms. Download free tools at rti.com/ncl. License issued to Non-Commercial User license@rti.com For non-production use only.
Expires on 00-jan-00 See www.rti.com for more information.
Killed
I have found a very similar (unanswered) question and initially posted mine (by mistake) as an answer here: https://answers.ros.org/question/3030...
I would be happy to receive any Input. Since I am inexperienced with Ros, it might very well be some rookie mistake. Thank you! Nicolas
Update: Testing with rttest and debugging with gdb
According gvdhoorn's suggestion I have tested example_loop
from ros2/realtime_support/rttest. Unfortunately this program gets Killed as well.
To debug the example_loop
with gdb
I have rebuild and started with
$ cmake ../ -DCMAKE_BUILD_TYPE=Debug
$ make
$ gdb ./example_loop
(gdb) r
and received the following output:
Starting program: /home/<myUserName>/realtime_support/rttest/examples/build/example_loop
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program ...
Can you test whether
example_loop
from ros2/realtime_support/rttest does work? If that also gets killed, then something is wrong.You might want to see whether
gdb
can help clear up the mystery in that case.Btw: your question title still mentions the privilege issue, but in your latest output I don't see it any more.
Hi gvdhoorn, Thank you for your support! I have updated the title and tested the example_loop. Unfortunately, the example loop gets killed as well:
Sorry for taking so long to test your suggestion.
First thing I'd try is run it in
gdb
.I am trying to do that now (never used gdb before). I have rebuilt example_loop to add debug info: $ cmake ../ -DCMAKE_BUILD_TYPE=Debug $ make Started the debugging by $ gdb ./example_loop It prints infor about gbd, then reads the symbols, and stays with (gdb). I dont see any CPU usage.
Once
gdb
has started, you typer
(short forrun
) and press enter.It will probably start outputting all sorts of info. After it gets killed, copy-paste all that into your question (use the
edit
button/link).If possible, also type
bt
and press enter, after it's killed.re: your edit: it could be that your user doesn't have the permission to request the large stacks that
realtime_support
is trying to use. What is the output ofulimit -a
?Note: I'm not sure here, just guessing at this point, as your program just getting killed isn't very informative.
Also: have you tried running the same program on a different machine? How did you create the kernel?