LUA and RTT -> segfaults ?

Hi,
i'm new to lua and try to follow this example manual:

http://people.mech.kuleuven.be/~mklotzbucher/lua_docs/MANUAL.html

i builded ocl with the following (thourhgt autoproj):

5 env_add "LUA_PATH",
File.join(Autoproj.root_dir,"install","usr","share","lua","5.1","?.lua")
6 env_add "LUA_CPATH",
File.join(Autoproj.root_dir,"install","usr","share","lua","5.1","?.so")
7
8
9 cmake_package 'ocl' do |pkg|
10 pkg.define "BUILD_LUA_RTT", "ON"
11 pkg.define "BUILD_LUA_RTT_DYNAMIC_MODULES", "OFF"
12 pkg.define "BUILD_LUA_TESTCOMP", "ON"
13 end

i'm not sure about these paths:

export
RTT_COMPONENT_PATH=/home/mk/tmp/rtt-2.0/lib/orocos:home/mk/src/git/ocl/lua
export PATH=$PATH:/home/mk/src/git/ocl/lua

But i could run the rttlua application and try to follow the manual:

Real-time memory: 517904 bytes free of 524288 allocated.
0.002 [ ERROR ][DeploymentComponent::import] No such package or
directory found in search path: ocl. Search path is:
0.003 [ ERROR ][DeploymentComponent::import] :.
0.003 [ ERROR ][DeploymentComponent::import] ./ocl
0.003 [ ERROR ][DeploymentComponent::import] ./gnulinux/ocl
OROCOS RTTLua 1.0-beta5 / Lua 5.1.5 (gnulinux)
Use Ctrl-d to quit.
> TC = rtt.getTC()
> require("rttlib")
> print(TC)
/home/goldhoorn/dev-limes/install/bin/rttlua: line 20: 3325
Segmentation fault $cmd $*

I got an segfault here, what i do wong at this point?

Greetings,
Matthias

LUA and RTT -> segfaults ?

Hi Matthias,

On Wed, Mar 13, 2013 at 02:02:49PM +0100, Matthias Goldhoorn wrote:
> Hi,
> i'm new to lua and try to follow this example manual:
>
> http://people.mech.kuleuven.be/~mklotzbucher/lua_docs/MANUAL.html

This is outdated, thanks for reminding me to delete it. All
information is now here:

http://www.orocos.org/wiki/orocos/toolchain/LuaCookbook

> i builded ocl with the following (thourhgt autoproj):
>
> 5 env_add "LUA_PATH",
> File.join(Autoproj.root_dir,"install","usr","share","lua","5.1","?.lua")
> 6 env_add "LUA_CPATH",
> File.join(Autoproj.root_dir,"install","usr","share","lua","5.1","?.so")
> 7
> 8
> 9 cmake_package 'ocl' do |pkg|
> 10 pkg.define "BUILD_LUA_RTT", "ON"
> 11 pkg.define "BUILD_LUA_RTT_DYNAMIC_MODULES", "OFF"
> 12 pkg.define "BUILD_LUA_TESTCOMP", "ON"
> 13 end
>
> i'm not sure about these paths:
>
> export
> RTT_COMPONENT_PATH=/home/mk/tmp/rtt-2.0/lib/orocos:home/mk/src/git/ocl/lua
> export PATH=$PATH:/home/mk/src/git/ocl/lua
>
> But i could run the rttlua application and try to follow the manual:
>
> Real-time memory: 517904 bytes free of 524288 allocated.
> 0.002 [ ERROR ][DeploymentComponent::import] No such package or directory found
> in search path: ocl. Search path is:
> 0.003 [ ERROR ][DeploymentComponent::import] :.
> 0.003 [ ERROR ][DeploymentComponent::import] ./ocl
> 0.003 [ ERROR ][DeploymentComponent::import] ./gnulinux/ocl
> OROCOS RTTLua 1.0-beta5 / Lua 5.1.5 (gnulinux)
> Use Ctrl-d to quit.
> > TC = rtt.getTC()
> > require("rttlib")
> > print(TC)
> /home/goldhoorn/dev-limes/install/bin/rttlua: line 20: 3325 Segmentation
> fault $cmd $*
>
> I got an segfault here, what i do wong at this point?

The most common cause for this is that something (components, typekits
etc) have not been compiled correctly or that old versions are
imported.

Markus

LUA and RTT -> segfaults ?

2013/3/13 Matthias Goldhoorn <matthias [dot] goldhoorn [..] ...>

> Hi,
> i'm new to lua and try to follow this example manual:
>
> http://people.mech.kuleuven.be/~mklotzbucher/lua_docs/MANUAL.html
>
> i builded ocl with the following (thourhgt autoproj):
>
> 5 env_add "LUA_PATH",
> File.join(Autoproj.root_dir,"install","usr","share","lua","5.1","?.lua")
> 6 env_add "LUA_CPATH",
> File.join(Autoproj.root_dir,"install","usr","share","lua","5.1","?.so")
>

Hi Matthias,

I am afraid env_add is very nice for classical path variables.
However, LUA_PATH as a specific format with semi-columns. I think that's
why the ocl library is not found.

> 7
> 8
> 9 cmake_package 'ocl' do |pkg|
> 10 pkg.define "BUILD_LUA_RTT", "ON"
> 11 pkg.define "BUILD_LUA_RTT_DYNAMIC_MODULES", "OFF"
> 12 pkg.define "BUILD_LUA_TESTCOMP", "ON"
> 13 end
>
>
> i'm not sure about these paths:
>
> export
> RTT_COMPONENT_PATH=/home/mk/tmp/rtt-2.0/lib/orocos:home/mk/src/git/ocl/lua
> export PATH=$PATH:/home/mk/src/git/ocl/lua
>
>
Could you try to manually define your LUA_PATH before lauching rttlua just
to check that it works fine?
According to your path, you should define something like

export LUA_PATH=";;;home/mk/src/git/ocl/lua/modules/?.lua"

Charles.

> But i could run the rttlua application and try to follow the manual:
>
> Real-time memory: 517904 bytes free of 524288 allocated.
> 0.002 [ ERROR ][DeploymentComponent::import] No such package or directory
> found in search path: ocl. Search path is:
> 0.003 [ ERROR ][DeploymentComponent::import] :.
> 0.003 [ ERROR ][DeploymentComponent::import] ./ocl
> 0.003 [ ERROR ][DeploymentComponent::import] ./gnulinux/ocl
> OROCOS RTTLua 1.0-beta5 / Lua 5.1.5 (gnulinux)
> Use Ctrl-d to quit.
> > TC = rtt.getTC()
> > require("rttlib")
> > print(TC)
> /home/goldhoorn/dev-limes/install/bin/rttlua: line 20: 3325 Segmentation
> fault $cmd $*
>
> I got an segfault here, what i do wong at this point?
>
> Greetings,
> Matthias
>
> --
> Dipl.-Inf. Matthias Goldhoorn
> Space and Underwater Robotic
>
> Universität Bremen
> FB 3 - Mathematik und Informatik
> AG Robotik
> Robert-Hooke-Straße 5
> 28359 Bremen, Germany
>
> Tel.: +49 421 178 45-4193
> Zentrale: +49 421 178 45-6550
> Fax: +49 421 178 45-4150
> E-Mail: matthias [dot] goldhoorn [..] ...
>
> Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>

LUA and RTT -> segfaults ?

On 13.03.2013 14:38, Charles Lesire-Cabaniols wrote:
>
>
>
> 2013/3/13 Matthias Goldhoorn <matthias [dot] goldhoorn [..] ...
> <mailto:matthias [dot] goldhoorn [..] ...>>
>
> Hi,
> i'm new to lua and try to follow this example manual:
>
> http://people.mech.kuleuven.be/~mklotzbucher/lua_docs/MANUAL.html
> <http://people.mech.kuleuven.be/%7Emklotzbucher/lua_docs/MANUAL.html>
>
> i builded ocl with the following (thourhgt autoproj):
>
> 5 env_add "LUA_PATH",
> File.join(Autoproj.root_dir,"install","usr","share","lua","5.1","?.lua")
>
> 6 env_add "LUA_CPATH",
> File.join(Autoproj.root_dir,"install","usr","share","lua","5.1","?.so")
>
>
>
> Hi Matthias,
>
> I am afraid env_add is very nice for classical path variables.
> However, LUA_PATH as a specific format with semi-columns. I think
> that's why the ocl library is not found.
The library was not fount found before, since i added the ENVs it
segfault, however i changed my env_add to these env_set:
5 env_set "LUA_PATH", ("\";;;" +
File.join(Autoproj.root_dir,'install','usr','share','lua','5.1','?.lua')
+ "\"")
6 env_set "LUA_CPATH", ("\";;;" +
File.join(Autoproj.root_dir,'install','usr','share','lua','5.1','?.so')
+ "\"")

which results in the (hopefully right result)
[08:44:01 goldhoorn dev-limes]$ printenv | grep LUA
LUA_PATH=;;;/home/goldhoorn/dev-limes/install/usr/share/lua/5.1/?.lua
LUA_CPATH=;;;/home/goldhoorn/dev-limes/install/usr/share/lua/5.1/?.so

But the error remains the same segmentation fault :-(

Here is the segfaulting backtrace::

(gdb) bt
#0 0x00007f0d90d461df in
RTT::internal::OperationCallerC::ret(boost::intrusive_ptr<RTT::base::DataSourceBase>)
() from /home/goldhoorn/dev-limes/install/lib/liborocos-rtt-gnulinux.so.2.6
#1 0x00000000004567a3 in Service_getOperation (L=0x1e9e130) at
/home/goldhoorn/dev-limes/tools/ocl/lua/rtt.cpp:1663
#2 0x0000000000459166 in TaskContext_getOperation (L=0x1e9e130) at
/home/goldhoorn/dev-limes/tools/ocl/lua/rtt.cpp:2298
#3 0x00007f0d902eea24 in luaD_precall (L=L@entry=0x1e9e130,
func=0x1ee1590, nresults=nresults@entry=1) at ldo.c:320
#4 0x00007f0d902f9358 in luaV_execute (L=L@entry=0x1e9e130,
nexeccalls=nexeccalls@entry=1) at lvm.c:591
#5 0x00007f0d902eee7d in luaD_call (L=L@entry=0x1e9e130,
func=0x1ee14b0, nResults=nResults@entry=1) at ldo.c:378
#6 0x00007f0d902eaaa6 in lua_call (L=L@entry=0x1e9e130,
nargs=nargs@entry=1, nresults=nresults@entry=1) at lapi.c:782
#7 0x00007f0d902fac14 in luaL_callmeta (L=L@entry=0x1e9e130,
obj=obj@entry=1, event=event@entry=0x7f0d90305247 "__tostring") at
lauxlib.c:224
#8 0x00007f0d902fc8a7 in luaB_tostring (L=0x1e9e130) at lbaselib.c:398
#9 0x00007f0d902eea24 in luaD_precall (L=L@entry=0x1e9e130,
func=func@entry=0x1ee1490, nresults=1) at ldo.c:320
#10 0x00007f0d902eee34 in luaD_call (L=L@entry=0x1e9e130,
func=0x1ee1490, nResults=nResults@entry=1) at ldo.c:377
#11 0x00007f0d902eaaa6 in lua_call (L=L@entry=0x1e9e130,
nargs=nargs@entry=1, nresults=nresults@entry=1) at lapi.c:782
#12 0x00007f0d902fc1a4 in luaB_print (L=0x1e9e130) at lbaselib.c:39
#13 0x00007f0d902eea24 in luaD_precall (L=L@entry=0x1e9e130,
func=0x1ee1460, nresults=nresults@entry=0) at ldo.c:320
#14 0x00007f0d902f9358 in luaV_execute (L=L@entry=0x1e9e130,
nexeccalls=nexeccalls@entry=1) at lvm.c:591
#15 0x00007f0d902eee7d in luaD_call (L=0x1e9e130, func=0x1ee1450,
nResults=<optimized out>) at ldo.c:378
#16 0x00007f0d902ee0ca in luaD_rawrunprotected (L=L@entry=0x1e9e130,
f=f@entry=0x7f0d902e9730 <f_call>, ud=ud@entry=0x7fffd6a95be0) at ldo.c:116
#17 0x00007f0d902ef02f in luaD_pcall (L=L@entry=0x1e9e130,
func=func@entry=0x7f0d902e9730 <f_call>, u=u@entry=0x7fffd6a95be0,
old_top=<optimized out>, ef=<optimized out>) at ldo.c:464
#18 0x00007f0d902eab41 in lua_pcall (L=0x1e9e130, nargs=0, nresults=-1,
errfunc=<optimized out>) at lapi.c:821
#19 0x000000000047403f in docall (L=0x1e9e130, narg=0, clear=0) at
/home/goldhoorn/dev-limes/tools/ocl/lua/lua-repl.c:112
#20 0x0000000000474676 in dotty (L=0x1e9e130) at
/home/goldhoorn/dev-limes/tools/ocl/lua/lua-repl.c:231
#21 0x0000000000474e5e in pmain (L=0x1e9e130) at
/home/goldhoorn/dev-limes/tools/ocl/lua/lua-repl.c:380
#22 0x00007f0d902eea24 in luaD_precall (L=L@entry=0x1e9e130,
func=func@entry=0x1e9e500, nresults=0) at ldo.c:320
#23 0x00007f0d902eee34 in luaD_call (L=0x1e9e130, func=0x1e9e500,
nResults=<optimized out>) at ldo.c:377
#24 0x00007f0d902ee0ca in luaD_rawrunprotected (L=L@entry=0x1e9e130,
f=f@entry=0x7f0d902e96a0 <f_Ccall>, ud=ud@entry=0x7fffd6a95ea0) at ldo.c:116
#25 0x00007f0d902ef02f in luaD_pcall (L=0x1e9e130,
func=func@entry=0x7f0d902e96a0 <f_Ccall>, u=u@entry=0x7fffd6a95ea0,
old_top=<optimized out>, ef=ef@entry=0) at ldo.c:464
#26 0x00007f0d902eabb7 in lua_cpcall (L=<optimized out>, func=<optimized
out>, ud=<optimized out>) at lapi.c:856
#27 0x0000000000474eae in main_args (L=0x1e9e130, argc=1,
argv=0x7fffd6a96368) at
/home/goldhoorn/dev-limes/tools/ocl/lua/lua-repl.c:411
#28 0x0000000000462fee in OCL::LuaComponent::lua_repl
(this=0x7fffd6a96000, argc=1, argv=0x7fffd6a96368) at
/home/goldhoorn/dev-limes/tools/ocl/lua/LuaComponent.cpp:218
#29 0x00000000004615fd in ORO_main_impl (argc=1, argv=0x7fffd6a96368) at
/home/goldhoorn/dev-limes/tools/ocl/lua/LuaComponent.cpp:359
---Type <return> to continue, or q <return> to quit---
#30 0x000000000046117a in main (argc=1, argv=0x7fffd6a96368) at
/home/goldhoorn/dev-limes/tools/ocl/lua/LuaComponent.cpp:272

> 7
> 8
> 9 cmake_package 'ocl' do ||pkg||
> 10 pkg.define "BUILD_LUA_RTT", "ON"
> 11 pkg.define "BUILD_LUA_RTT_DYNAMIC_MODULES", "OFF"
> 12 pkg.define "BUILD_LUA_TESTCOMP", "ON"
> 13 end
>
>
> i'm not sure about these paths:
>
> export
> RTT_COMPONENT_PATH=/home/mk/tmp/rtt-2.0/lib/orocos:home/mk/src/git/ocl/lua
> export PATH=$PATH:/home/mk/src/git/ocl/lua
>
>
> Could you try to manually define your LUA_PATH before lauching rttlua
> just to check that it works fine?
> According to your path, you should define something like
>
> export LUA_PATH=";;;home/mk/src/git/ocl/lua/modules/?.lua"
>
> Charles.
>
> But i could run the rttlua application and try to follow the manual:
>
> Real-time memory: 517904 bytes free of 524288 allocated.
> 0.002 [ ERROR ][DeploymentComponent::import] No such package or
> directory found in search path: ocl. Search path is:
> 0.003 [ ERROR ][DeploymentComponent::import] :.
> 0.003 [ ERROR ][DeploymentComponent::import] ./ocl
> 0.003 [ ERROR ][DeploymentComponent::import] ./gnulinux/ocl
> OROCOS RTTLua 1.0-beta5 / Lua 5.1.5 (gnulinux)
> Use Ctrl-d to quit.
> > TC = rtt.getTC()
> > require("rttlib")
> > print(TC)
> /home/goldhoorn/dev-limes/install/bin/rttlua: line 20: 3325
> Segmentation fault $cmd $*
>
> I got an segfault here, what i do wong at this point?
>
> Greetings,
> Matthias
>
> --
> Dipl.-Inf. Matthias Goldhoorn
> Space and Underwater Robotic
>
> Universität Bremen
> FB 3 - Mathematik und Informatik
> AG Robotik
> Robert-Hooke-Straße 5
> 28359 Bremen, Germany
>
> Tel.:+49 421 178 45-4193 <tel:%2B49%20421%20178%2045-4193>
> Zentrale:+49 421 178 45-6550 <tel:%2B49%20421%20178%2045-6550>
> Fax:+49 421 178 45-4150 <tel:%2B49%20421%20178%2045-4150>
> E-Mail:matthias [dot] goldhoorn [..] ... <mailto:matthias [dot] goldhoorn [..] ...>
>
> Weitere Informationen:http://www.informatik.uni-bremen.de/robotik
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> <mailto:Orocos-Users [..] ...>
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>