On Feb 14, 2012, at 09:55 , focke [dot] 85 [..] ... wrote:
> Hi all
>
> I've been having several segmentation fault errors. Some of them appear just
> some times (I re-run the program and they are not there any more). Most of
> these errors are appearing when reading the properties configuration files
> (.cpf), from the C++ component code as well as from the XML file (read by the
> deployer). What can be causing this?
>
> The versions I'm using are:
>
> - Xenomai 2.6.0 (linux kernel 2.6.38.8)
>
> - RTNET 0.9.12
>
> - ROS Diamondback
>
> - Orocos: orocos_toolchain_ros (ros-diamondback) + patch for Xenomai 2.6.0
> (http://bugs.orocos.org/show_bug.cgi?id=913)
>
>
> Regards,
>
>
> Santiago
Where does gdb think the error is?
Multiple segmentation fault errors
Hi Santiago,
On Tue, Feb 14, 2012 at 3:55 PM, <focke [dot] 85 [..] ...> wrote:
> Hi all
>
> I've been having several segmentation fault errors. Some of them appear just
> some times (I re-run the program and they are not there any more). Most of
> these errors are appearing when reading the properties configuration files
> (.cpf), from the C++ component code as well as from the XML file (read by the
> deployer). What can be causing this?
>
> The versions I'm using are:
>
> - Xenomai 2.6.0 (linux kernel 2.6.38.8)
>
> - RTNET 0.9.12
>
> - ROS Diamondback
>
> - Orocos: orocos_toolchain_ros (ros-diamondback) + patch for Xenomai 2.6.0
> (http://bugs.orocos.org/show_bug.cgi?id=913)
*The* typical cause for random segfaults under Xenomai is the stack
size being too small. It could very well be that in
orocos_toolchain_ros, the standard stack size for Orocos threads under
Xenomai is way to small. Raising it to 256000 bytes might solve your
problem. For example, the latest code in
rtt/os/xenomai/fosi_internal.cpp: rtos_task_create() contains the
lines:
Which is for every thread created in addition to the main() thread.
However, I couldn't figure out how the stack size of the main() thread
is set in Xenomai... which might be the thread reading your
properties.
Peter
Multiple segmentation fault errors
On 02/23/2012 10:18 AM, Peter Soetens wrote:
> Oh. But that actually looks like a decent build system that could be
> interfaced easily by others (e.g. autoproj). Do you know of the
> timeplan on its deployment ?
>
>
> It is being used in Fuerte for testing on a set of selected packages,
> but the API is said to be still unstable. Migration to catkin will only
> happen after Fuerte. I think they want to release it as an independent
> tool as well (debian package or similar).
Ah :(
Unfortunate, I was hoping that I could spare the pain of interfacing the
current rosmake system in autoproj. Hopefully it will be widespread
around september, after my baby leave :-P
Sylvain
Multiple segmentation fault errors
Hi Peter, thanks for the reply
2012/2/15 Peter Soetens <peter [..] ...>
> Hi Santiago,
>
> On Tue, Feb 14, 2012 at 3:55 PM, <focke [dot] 85 [..] ...> wrote:
> > Hi all
> >
> > I've been having several segmentation fault errors. Some of them appear
> just
> > some times (I re-run the program and they are not there any more). Most
> of
> > these errors are appearing when reading the properties configuration
> files
> > (.cpf), from the C++ component code as well as from the XML file (read
> by the
> > deployer). What can be causing this?
> >
> > The versions I'm using are:
> >
> > - Xenomai 2.6.0 (linux kernel 2.6.38.8)
> >
> > - RTNET 0.9.12
> >
> > - ROS Diamondback
> >
> > - Orocos: orocos_toolchain_ros (ros-diamondback) + patch for Xenomai
> 2.6.0
> > (http://bugs.orocos.org/show_bug.cgi?id=913)
>
> *The* typical cause for random segfaults under Xenomai is the stack
> size being too small. It could very well be that in
> orocos_toolchain_ros, the standard stack size for Orocos threads under
> Xenomai is way to small. Raising it to 256000 bytes might solve your
> problem. For example, the latest code in
> rtt/os/xenomai/fosi_internal.cpp: rtos_task_create() contains the
> lines:
>
>
>
>
I'm using the orocos_toolchain_ros (ROS: diamondback), therefore I don't
have those code lines in rtt/os/xenomai/fosi_internal.cpp:
rtos_task_create(). Nevertheless I added them (just before rv =
rt_task_spawn(..)), and recompiled the toolchain, but the segmentation
fault error remains. Is there any other option or cause?
Also, I'm not completely sure, but I think I also had some segmentation
fault errors while reading/writing configuration files (using the
marshaling service inside my components - C++) when I wasn't using Xenomai.
Again, with some components worked and with other ones I had the error.
> Which is for every thread created in addition to the main() thread.
> However, I couldn't figure out how the stack size of the main() thread
> is set in Xenomai... which might be the thread reading your
> properties.
>
> Peter
>
Regards,
Multiple segmentation fault errors
On Thu, Feb 16, 2012 at 4:13 PM, Santiago Focke <focke [dot] 85 [..] ...> wrote:
> Hi Peter, thanks for the reply
>
>
...
>
> I'm using the orocos_toolchain_ros (ROS: diamondback), therefore I don't
> have those code lines in rtt/os/xenomai/fosi_internal.cpp:
> rtos_task_create(). Nevertheless I added them (just before rv =
> rt_task_spawn(..)), and recompiled the toolchain, but the segmentation fault
> error remains. Is there any other option or cause?
>
> Also, I'm not completely sure, but I think I also had some segmentation
> fault errors while reading/writing configuration files (using the marshaling
> service inside my components - C++) when I wasn't using Xenomai. Again, with
> some components worked and with other ones I had the error.
Well, segfaults are just unacceptable in Orocos code, so we take high
priority in testing all possible use cases and fix any. If you find a
segfault in 'gnulinux' code, run it through with valgrind ( valgrind
deployer-gnulinux -s ... ) and post the results on the list. The last
years, most segfaults were in user code though.
You can't test Xenomai code with valgrind, and only sometimes with
gdb. So what we try to do is to reproduce in gnulinux and then fix it.
Running your gnulinux application with valgrind from time to time is a
good idea as well, just to catch errors early on (before they cause a
crash).
Peter
Multiple segmentation fault errors
Hi Peter
2012/2/16 Peter Soetens <peter [..] ...>
> On Thu, Feb 16, 2012 at 4:13 PM, Santiago Focke <focke [dot] 85 [..] ...>
> wrote:
> > Hi Peter, thanks for the reply
> >
> >
> ...
> >
> > I'm using the orocos_toolchain_ros (ROS: diamondback), therefore I don't
> > have those code lines in rtt/os/xenomai/fosi_internal.cpp:
> > rtos_task_create(). Nevertheless I added them (just before rv =
> > rt_task_spawn(..)), and recompiled the toolchain, but the segmentation
> fault
> > error remains. Is there any other option or cause?
> >
> > Also, I'm not completely sure, but I think I also had some segmentation
> > fault errors while reading/writing configuration files (using the
> marshaling
> > service inside my components - C++) when I wasn't using Xenomai. Again,
> with
> > some components worked and with other ones I had the error.
>
> Well, segfaults are just unacceptable in Orocos code, so we take high
> priority in testing all possible use cases and fix any. If you find a
> segfault in 'gnulinux' code, run it through with valgrind ( valgrind
> deployer-gnulinux -s ... ) and post the results on the list. The last
> years, most segfaults were in user code though.
>
I passed my code to a gnulinux environment, using ros-electric, and now I
cannot even import my component without a segfault (this was not happening
before). I run the deployer with valgrind and receive a lot of errrors.
Most of them were 'Invalid read of size 4' and 'Conditional jump or move
depends on uninitialised value(s)'. I guess these must be treated as
warnings and wouldn't cause problem in the programs. I will omit these
errors in the post. Just before crashing, I got the following error:
The component I'm trying to import component depends on 'soem_core',
'soem_master' and 'soem_esd_drivers' (following the same idea of the
soem-beckhoff_drivers). To use it with ros-electric I changed the
'rtt_ros_integration' and 'rtt_ros_integration_std_msgs' packages to
'rtt_rosnode'. If I import my 'soem_esd_drivers' it does it without
problems. I don't know These orocos_ros-version change is affecting in
someway with these new segfault error.
manifest.xml
in CMakeLists.txt of 'soem_esd_drivers'
ros_generate_rtt_typekit(soem_esd_drivers)
orocos_plugin(soem_can-ethercat src/soem_esd_drivers.cpp
src/soem_can-ethercat.cpp)
target_link_libraries(soem_can-ethercat rt)
I also tried to import a clean component (just changing the manifest of a
just created orocos-component to add the soem packages) and the problem
continues.
>
> You can't test Xenomai code with valgrind, and only sometimes with
> gdb. So what we try to do is to reproduce in gnulinux and then fix it.
>
> Running your gnulinux application with valgrind from time to time is a
> good idea as well, just to catch errors early on (before they cause a
> crash).
>
> Peter
>
Regards,
Multiple segmentation fault errors
Hi Santiago,
On Mon, Feb 20, 2012 at 4:56 PM, Santiago Focke <focke [dot] 85 [..] ...> wrote:
> Hi Peter
>
> 2012/2/16 Peter Soetens <peter [..] ...>
>>
>> On Thu, Feb 16, 2012 at 4:13 PM, Santiago Focke <focke [dot] 85 [..] ...>
>> wrote:
>> > Hi Peter, thanks for the reply
>> >
>> >
>> ...
>> >
>> > I'm using the orocos_toolchain_ros (ROS: diamondback), therefore I don't
>> > have those code lines in rtt/os/xenomai/fosi_internal.cpp:
>> > rtos_task_create(). Nevertheless I added them (just before rv =
>> > rt_task_spawn(..)), and recompiled the toolchain, but the segmentation
>> > fault
>> > error remains. Is there any other option or cause?
>> >
>> > Also, I'm not completely sure, but I think I also had some segmentation
>> > fault errors while reading/writing configuration files (using the
>> > marshaling
>> > service inside my components - C++) when I wasn't using Xenomai. Again,
>> > with
>> > some components worked and with other ones I had the error.
>>
>> Well, segfaults are just unacceptable in Orocos code, so we take high
>> priority in testing all possible use cases and fix any. If you find a
>> segfault in 'gnulinux' code, run it through with valgrind ( valgrind
>> deployer-gnulinux -s ... ) and post the results on the list. The last
>> years, most segfaults were in user code though.
>
>
> I passed my code to a gnulinux environment, using ros-electric, and now I
> cannot even import my component without a segfault (this was not happening
> before). I run the deployer with valgrind and receive a lot of errrors. Most
> of them were 'Invalid read of size 4' and 'Conditional jump or move depends
> on uninitialised value(s)'. I guess these must be treated as warnings and
> wouldn't cause problem in the programs.
Not at all. All these errors are grave errors and may cause crashes
and undefined behavior by definition. You must fix all of these, even
in case you don't have a segfault.
> I will omit these errors in the post. Just before crashing, I got the following error:
>
>
>
> The component I'm trying to import component depends on 'soem_core',
> 'soem_master' and 'soem_esd_drivers' (following the same idea of the
> soem-beckhoff_drivers). To use it with ros-electric I changed the
> 'rtt_ros_integration' and 'rtt_ros_integration_std_msgs' packages to
> 'rtt_rosnode'. If I import my 'soem_esd_drivers' it does it without
> problems. I don't know These orocos_ros-version change is affecting in
> someway with these new segfault error.
Ok. I think we found the error. The most likely reason for this case
not working is that the 'typegen' generated typekits don't handle well
different OROCOS_TARGET targets in the same source tree.
What you can do best is to erase all generated files, lib and build
directories in your typekit packages and then rebuild. Most likely, a
next import will no longer cause a crash.
The valgrind error also points out that one typekit is replacing
another. This shouldn't be a problem, but it possibly happened because
there's still 'old' code in your typegen libraries.
Some serious bugfixing is necessary on this front anyway, but I'm
lacking the time to do this right.
Peter
Multiple segmentation fault errors
Hi Peter
2012/2/21 Peter Soetens <peter [..] ...>
> Hi Santiago,
>
> On Mon, Feb 20, 2012 at 4:56 PM, Santiago Focke <focke [dot] 85 [..] ...>
> wrote:
> > Hi Peter
> >
> > 2012/2/16 Peter Soetens <peter [..] ...>
> >>
> >> On Thu, Feb 16, 2012 at 4:13 PM, Santiago Focke <focke [dot] 85 [..] ...>
> >> wrote:
> >> > Hi Peter, thanks for the reply
> >> >
> >> >
> >> ...
> >> >
> >> > I'm using the orocos_toolchain_ros (ROS: diamondback), therefore I
> don't
> >> > have those code lines in rtt/os/xenomai/fosi_internal.cpp:
> >> > rtos_task_create(). Nevertheless I added them (just before rv =
> >> > rt_task_spawn(..)), and recompiled the toolchain, but the segmentation
> >> > fault
> >> > error remains. Is there any other option or cause?
> >> >
> >> > Also, I'm not completely sure, but I think I also had some
> segmentation
> >> > fault errors while reading/writing configuration files (using the
> >> > marshaling
> >> > service inside my components - C++) when I wasn't using Xenomai.
> Again,
> >> > with
> >> > some components worked and with other ones I had the error.
> >>
> >> Well, segfaults are just unacceptable in Orocos code, so we take high
> >> priority in testing all possible use cases and fix any. If you find a
> >> segfault in 'gnulinux' code, run it through with valgrind ( valgrind
> >> deployer-gnulinux -s ... ) and post the results on the list. The last
> >> years, most segfaults were in user code though.
> >
> >
> > I passed my code to a gnulinux environment, using ros-electric, and now I
> > cannot even import my component without a segfault (this was not
> happening
> > before). I run the deployer with valgrind and receive a lot of errrors.
> Most
> > of them were 'Invalid read of size 4' and 'Conditional jump or move
> depends
> > on uninitialised value(s)'. I guess these must be treated as warnings and
> > wouldn't cause problem in the programs.
>
> Not at all. All these errors are grave errors and may cause crashes
> and undefined behavior by definition. You must fix all of these, even
> in case you don't have a segfault.
>
The thing is that I receive the 'Invalid read of size 4' errors just by
running 'valgrind ./deployer-gnulinux' (in the diamondback stack, as well
as in the electric stack), without importing any of my compoents. after I
quit, i receive algo an 'Invalid free() / delete / delete[] / realloc()'
error.
>
> > I will omit these errors in the post. Just before crashing, I got the
> following error:
> >
> >
> >
> > The component I'm trying to import component depends on 'soem_core',
> > 'soem_master' and 'soem_esd_drivers' (following the same idea of the
> > soem-beckhoff_drivers). To use it with ros-electric I changed the
> > 'rtt_ros_integration' and 'rtt_ros_integration_std_msgs' packages to
> > 'rtt_rosnode'. If I import my 'soem_esd_drivers' it does it without
> > problems. I don't know These orocos_ros-version change is affecting in
> > someway with these new segfault error.
>
> Ok. I think we found the error. The most likely reason for this case
> not working is that the 'typegen' generated typekits don't handle well
> different OROCOS_TARGET targets in the same source tree.
>
> What you can do best is to erase all generated files, lib and build
> directories in your typekit packages and then rebuild. Most likely, a
> next import will no longer cause a crash.
>
> The valgrind error also points out that one typekit is replacing
> another. This shouldn't be a problem, but it possibly happened because
> there's still 'old' code in your typegen libraries.
>
> Some serious bugfixing is necessary on this front anyway, but I'm
> lacking the time to do this right.
>
> Peter
>
I tried to find the solution by creating a new component (orocreate-pkg)
and just adding a dependency to 'rtt_rosnode' in the manifest, but, even
though it was a new component, when I imported it in the deployer, I kept
receiving segfault. I decided then to re-migrate to ros-diamondback
(changing again the dependencies to rtt_ros_integration) and that segfault
disappeared, but the ones during the property-file reading are still there.
The valgrind output when I try to load the properties from the file is:
Also, when i take the property loading of the faulty component, I get
segfault when quiting the deployer:
Anyway I'll check later again with ros-electric by deleting the libraries
you say to see if that eliminates the first segfault error.
Thanks again.
Regards,
Multiple segmentation fault errors
Hi Santiago,
This amount of errors can only be caused by loading
incompatible-version libraries. They change existing functions and
corrupt the data. I think we should add a version check to each loaded
library such that these things can be detected early on.
Be sure to erase all your lib/ directories, also in soem, (in addition
to cleaning up typegen packages) and to try again...
Peter
On Tue, Feb 21, 2012 at 4:48 PM, Santiago Focke <focke [dot] 85 [..] ...> wrote:
> Hi Peter
>
> 2012/2/21 Peter Soetens <peter [..] ...>
>>
>> Hi Santiago,
>>
>> On Mon, Feb 20, 2012 at 4:56 PM, Santiago Focke <focke [dot] 85 [..] ...>
>> wrote:
>> > Hi Peter
>> >
>> > 2012/2/16 Peter Soetens <peter [..] ...>
>> >>
>> >> On Thu, Feb 16, 2012 at 4:13 PM, Santiago Focke <focke [dot] 85 [..] ...>
>> >> wrote:
>> >> > Hi Peter, thanks for the reply
>> >> >
>> >> >
>> >> ...
>> >> >
>> >> > I'm using the orocos_toolchain_ros (ROS: diamondback), therefore I
>> >> > don't
>> >> > have those code lines in rtt/os/xenomai/fosi_internal.cpp:
>> >> > rtos_task_create(). Nevertheless I added them (just before rv =
>> >> > rt_task_spawn(..)), and recompiled the toolchain, but the
>> >> > segmentation
>> >> > fault
>> >> > error remains. Is there any other option or cause?
>> >> >
>> >> > Also, I'm not completely sure, but I think I also had some
>> >> > segmentation
>> >> > fault errors while reading/writing configuration files (using the
>> >> > marshaling
>> >> > service inside my components - C++) when I wasn't using Xenomai.
>> >> > Again,
>> >> > with
>> >> > some components worked and with other ones I had the error.
>> >>
>> >> Well, segfaults are just unacceptable in Orocos code, so we take high
>> >> priority in testing all possible use cases and fix any. If you find a
>> >> segfault in 'gnulinux' code, run it through with valgrind ( valgrind
>> >> deployer-gnulinux -s ... ) and post the results on the list. The last
>> >> years, most segfaults were in user code though.
>> >
>> >
>> > I passed my code to a gnulinux environment, using ros-electric, and now
>> > I
>> > cannot even import my component without a segfault (this was not
>> > happening
>> > before). I run the deployer with valgrind and receive a lot of errrors.
>> > Most
>> > of them were 'Invalid read of size 4' and 'Conditional jump or move
>> > depends
>> > on uninitialised value(s)'. I guess these must be treated as warnings
>> > and
>> > wouldn't cause problem in the programs.
>>
>> Not at all. All these errors are grave errors and may cause crashes
>> and undefined behavior by definition. You must fix all of these, even
>> in case you don't have a segfault.
>
>
> The thing is that I receive the 'Invalid read of size 4' errors just by
> running 'valgrind ./deployer-gnulinux' (in the diamondback stack, as well as
> in the electric stack), without importing any of my compoents. after I quit,
> i receive algo an 'Invalid free() / delete / delete[] / realloc()' error.
>
>
>
>>
>>
>> > I will omit these errors in the post. Just before crashing, I got the
>> > following error:
>> >
>> >
>> >
>> > The component I'm trying to import component depends on 'soem_core',
>> > 'soem_master' and 'soem_esd_drivers' (following the same idea of the
>> > soem-beckhoff_drivers). To use it with ros-electric I changed the
>> > 'rtt_ros_integration' and 'rtt_ros_integration_std_msgs' packages to
>> > 'rtt_rosnode'. If I import my 'soem_esd_drivers' it does it without
>> > problems. I don't know These orocos_ros-version change is affecting in
>> > someway with these new segfault error.
>>
>> Ok. I think we found the error. The most likely reason for this case
>> not working is that the 'typegen' generated typekits don't handle well
>> different OROCOS_TARGET targets in the same source tree.
>>
>> What you can do best is to erase all generated files, lib and build
>> directories in your typekit packages and then rebuild. Most likely, a
>> next import will no longer cause a crash.
>>
>> The valgrind error also points out that one typekit is replacing
>> another. This shouldn't be a problem, but it possibly happened because
>> there's still 'old' code in your typegen libraries.
>>
>> Some serious bugfixing is necessary on this front anyway, but I'm
>> lacking the time to do this right.
>>
>> Peter
>
>
> I tried to find the solution by creating a new component (orocreate-pkg) and
> just adding a dependency to 'rtt_rosnode' in the manifest, but, even though
> it was a new component, when I imported it in the deployer, I kept receiving
> segfault. I decided then to re-migrate to ros-diamondback (changing again
> the dependencies to rtt_ros_integration) and that segfault disappeared, but
> the ones during the property-file reading are still there.
>
> The valgrind output when I try to load the properties from the file is:
>
>
>
> Also, when i take the property loading of the faulty component, I get
> segfault when quiting the deployer:
>
>
>
>
> Anyway I'll check later again with ros-electric by deleting the libraries
> you say to see if that eliminates the first segfault error.
>
> Thanks again.
>
> Regards,
>
>
> --
> Ing. Santiago Focke
Multiple segmentation fault errors
On 02/21/2012 03:33 PM, Peter Soetens wrote:
> Ok. I think we found the error. The most likely reason for this case
> not working is that the 'typegen' generated typekits don't handle well
> different OROCOS_TARGET targets in the same source tree.
What's wrong / would need to be fixed ?
There has been no notification of any sort (that I can remember !) on
that front on the ML. typegen generates typekits following the
<project_name>-typekit-<target> pattern. I thought that was enough.
Grepping in the typegen-generated code shows that OROCOS_TARGET is only
being used to name the shared libraries, and nothing else ...
Multiple segmentation fault errors
On Tue, Feb 21, 2012 at 4:01 PM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...> wrote:
> On 02/21/2012 03:33 PM, Peter Soetens wrote:
>>
>> Ok. I think we found the error. The most likely reason for this case
>> not working is that the 'typegen' generated typekits don't handle well
>> different OROCOS_TARGET targets in the same source tree.
>
> What's wrong / would need to be fixed ?
>
> There has been no notification of any sort (that I can remember !) on that
> front on the ML. typegen generates typekits following the
> <project_name>-typekit-<target> pattern. I thought that was enough.
>
> Grepping in the typegen-generated code shows that OROCOS_TARGET is only
> being used to name the shared libraries, and nothing else ...
When we tested the OROCOS_TARGET env variable switching, we didn't test typegen.
The problem is that cmake caches found includes or libraries and that
typegen typekits end up linking with the wrong target, once compiled
with a previous target setting. The solution is to use cached
variables that contain in their name _${OROCOS_TARGET} such that cmake
re-finds all libraries and include directories again if the
OROCOS_TARGET variable changes.
We introduced this workflow, so it was our job to test typegen. The
changes should be quite minimal though in the template cmake code...
Peter
Multiple segmentation fault errors
On 02/21/2012 04:14 PM, Peter Soetens wrote:
> The problem is that cmake caches found includes or libraries and that
> typegen typekits end up linking with the wrong target, once compiled
> with a previous target setting. The solution is to use cached
> variables that contain in their name _${OROCOS_TARGET} such that cmake
> re-finds all libraries and include directories again if the
> OROCOS_TARGET variable changes.
That I don't understand. Why not require to have two different build
directories (one per target) ? It would make more sense in the end, as
you would not have to recompile a complete package each time you switch
targets (and fit the general cmake workflow better)
Multiple segmentation fault errors
On Wed, Feb 22, 2012 at 2:17 PM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...> wrote:
> On 02/21/2012 04:14 PM, Peter Soetens wrote:
>>
>> The problem is that cmake caches found includes or libraries and that
>> typegen typekits end up linking with the wrong target, once compiled
>> with a previous target setting. The solution is to use cached
>> variables that contain in their name _${OROCOS_TARGET} such that cmake
>> re-finds all libraries and include directories again if the
>> OROCOS_TARGET variable changes.
>
> That I don't understand. Why not require to have two different build
> directories (one per target) ? It would make more sense in the end, as you
> would not have to recompile a complete package each time you switch targets
> (and fit the general cmake workflow better)
Since we include the OROCOS_TARGET name in the cmake target name, the
.o files are kept in a separate directory and not overwritten.
Peter
Multiple segmentation fault errors
On 02/22/2012 03:43 PM, Peter Soetens wrote:
> On Wed, Feb 22, 2012 at 2:17 PM, Sylvain Joyeux<sylvain [dot] joyeux [..] ...> wrote:
>> On 02/21/2012 04:14 PM, Peter Soetens wrote:
>>>
>>> The problem is that cmake caches found includes or libraries and that
>>> typegen typekits end up linking with the wrong target, once compiled
>>> with a previous target setting. The solution is to use cached
>>> variables that contain in their name _${OROCOS_TARGET} such that cmake
>>> re-finds all libraries and include directories again if the
>>> OROCOS_TARGET variable changes.
>>
>> That I don't understand. Why not require to have two different build
>> directories (one per target) ? It would make more sense in the end, as you
>> would not have to recompile a complete package each time you switch targets
>> (and fit the general cmake workflow better)
>
> Since we include the OROCOS_TARGET name in the cmake target name, the
> .o files are kept in a separate directory and not overwritten.
Ahh ... Right.
However, that's not really explaining why you don't use separate build
directories ... It is still the "general" workflow (cmake and autotools)
when you want builds with different configurations.
Sylvain
Multiple segmentation fault errors
On Wed, Feb 22, 2012 at 3:46 PM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...> wrote:
> On 02/22/2012 03:43 PM, Peter Soetens wrote:
>>
>> On Wed, Feb 22, 2012 at 2:17 PM, Sylvain Joyeux<sylvain [dot] joyeux [..] ...>
>> wrote:
>>>
>>> On 02/21/2012 04:14 PM, Peter Soetens wrote:
>>>>
>>>>
>>>> The problem is that cmake caches found includes or libraries and that
>>>> typegen typekits end up linking with the wrong target, once compiled
>>>> with a previous target setting. The solution is to use cached
>>>> variables that contain in their name _${OROCOS_TARGET} such that cmake
>>>> re-finds all libraries and include directories again if the
>>>> OROCOS_TARGET variable changes.
>>>
>>>
>>> That I don't understand. Why not require to have two different build
>>> directories (one per target) ? It would make more sense in the end, as
>>> you
>>> would not have to recompile a complete package each time you switch
>>> targets
>>> (and fit the general cmake workflow better)
>>
>>
>> Since we include the OROCOS_TARGET name in the cmake target name, the
>> .o files are kept in a separate directory and not overwritten.
>
> Ahh ... Right.
>
> However, that's not really explaining why you don't use separate build
> directories ... It is still the "general" workflow (cmake and autotools)
> when you want builds with different configurations.
Because OROCOS_TARGET is read by the cmake files, and not by any other
file or tool. So you need to get into a build directory first before
you know which target the user wants to build for. This is for builds
without autoproj.
Peter
Multiple segmentation fault errors
On 02/22/2012 03:51 PM, Peter Soetens wrote:
>> Ahh ... Right.
>>
>> However, that's not really explaining why you don't use separate build
>> directories ... It is still the "general" workflow (cmake and autotools)
>> when you want builds with different configurations.
>
> Because OROCOS_TARGET is read by the cmake files, and not by any other
> file or tool. So you need to get into a build directory first before
> you know which target the user wants to build for. This is for builds
> without autoproj.
I still don't understand.
To change OROCOS_TARGET, you have to re-run cmake anyways. Your
workflow, as far as I understand it, is:
cd build
cmake -DOROCOS_TARGET=xenomai ..
make install
<do stuff>
cd build
cmake -DOROCOS_TARGET=gnulinux ..
make install
(or set OROCOS_TARGET in the shell and re-run cmake without any options
... That's were you diverging from the "standard" build system workflow)
The standard workflow (at least for the "different configuration case",
I don't really know for the "multiple targets" case) is:
cd build-xenomai
cmake -DOROCOS_TARGET=xenomai ..
make install
<do stuff>
cd build-gnulinux
cmake -DOROCOS_TARGET=gnulinux ..
make install
The advantage of this workflow is that it does not require any magic
from within the CMake or autotools code.
I'm just trying to understand the general logic (and the current
multi-target workflow)
Multiple segmentation fault errors
On Wed, Feb 22, 2012 at 3:58 PM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...> wrote:
> On 02/22/2012 03:51 PM, Peter Soetens wrote:
>>>
>>> Ahh ... Right.
>>>
>>> However, that's not really explaining why you don't use separate build
>>> directories ... It is still the "general" workflow (cmake and autotools)
>>> when you want builds with different configurations.
>>
>>
>> Because OROCOS_TARGET is read by the cmake files, and not by any other
>> file or tool. So you need to get into a build directory first before
>> you know which target the user wants to build for. This is for builds
>> without autoproj.
>
>
> I still don't understand.
>
> To change OROCOS_TARGET, you have to re-run cmake anyways. Your workflow, as
> far as I understand it, is:
>
> cd build
> cmake -DOROCOS_TARGET=xenomai ..
> make install
> <do stuff>
> cd build
> cmake -DOROCOS_TARGET=gnulinux ..
> make install
We never use this. It's cumbersome.
>
> (or set OROCOS_TARGET in the shell and re-run cmake without any options ...
> That's were you diverging from the "standard" build system workflow)
Yep, we export OROCOS_TARGET=footarget in our .bashrc file, depending
on the system we're working on. For debugging we can then temporarily
change it and just rerun with rosmake, which builds all dependencies.
>
> The standard workflow (at least for the "different configuration case", I
> don't really know for the "multiple targets" case) is:
>
> cd build-xenomai
> cmake -DOROCOS_TARGET=xenomai ..
> make install
> <do stuff>
> cd build-gnulinux
> cmake -DOROCOS_TARGET=gnulinux ..
> make install
>
> The advantage of this workflow is that it does not require any magic from
> within the CMake or autotools code.
But we'd need to do that in every single package, which is not feasible.
>
> I'm just trying to understand the general logic (and the current
> multi-target workflow)
It's not an option for us to 'cd' into directories of dependencies. We
just run 'rosmake' in the top-project and then all dependencies
(re)build with the correct target setting.
Peter
Multiple segmentation fault errors
On 02/22/2012 04:36 PM, Peter Soetens wrote:
>> The advantage of this workflow is that it does not require any magic from
>> within the CMake or autotools code.
>
> But we'd need to do that in every single package, which is not feasible.
Agreed. When you said "not in autoproj", I did not understood that it
implied "using rosmake"
So, as far as I understand it now, this mechanism is meant to be used
with rosmake, which cannot create multiple build directories. Since
rosmake basically re-runs cmake when you change OROCOS_TARGET (how does
it detect that, by the way ? Does it forward the environment variable to
the cmake command line or is it some other magic ?)
Multiple segmentation fault errors
On Wed, Feb 22, 2012 at 6:14 PM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...> wrote:
> On 02/22/2012 04:36 PM, Peter Soetens wrote:
>>>
>>> The advantage of this workflow is that it does not require any magic from
>>> within the CMake or autotools code.
>>
>>
>> But we'd need to do that in every single package, which is not feasible.
>
> Agreed. When you said "not in autoproj", I did not understood that it
> implied "using rosmake"
>
> So, as far as I understand it now, this mechanism is meant to be used with
> rosmake, which cannot create multiple build directories.
Correct.
> Since rosmake
> basically re-runs cmake when you change OROCOS_TARGET (how does it detect
> that, by the way ? Does it forward the environment variable to the cmake
> command line or is it some other magic ?)
rosmake re-runs cmake every time. Dependencies that don't need to be
built can get a ROS_NOBUILD touch file to speed up that process. Most
of the time, we only run 'make' in the package we are coding in.
That's actually the main reason why catkin (aka rosbuild 2) has been
made: http://people.willowgarage.com/straszheim/catkin-dev/catkin/index.html
See also http://www.ros.org/reps/rep-0122.html for the intended
directory structure
Peter
Multiple segmentation fault errors
On 02/22/2012 09:47 PM, Peter Soetens wrote:
>> Since rosmake
>> basically re-runs cmake when you change OROCOS_TARGET (how does it detect
>> that, by the way ? Does it forward the environment variable to the cmake
>> command line or is it some other magic ?)
>
> rosmake re-runs cmake every time. Dependencies that don't need to be
> built can get a ROS_NOBUILD touch file to speed up that process. Most
> of the time, we only run 'make' in the package we are coding in.
>
> That's actually the main reason why catkin (aka rosbuild 2) has been
> made: http://people.willowgarage.com/straszheim/catkin-dev/catkin/index.html
> See also http://www.ros.org/reps/rep-0122.html for the intended
> directory structure
Oh. But that actually looks like a decent build system that could be
interfaced easily by others (e.g. autoproj). Do you know of the timeplan
on its deployment ?
Sylvain
Multiple segmentation fault errors
On Thu, Feb 23, 2012 at 10:06 AM, Sylvain Joyeux <sylvain [dot] joyeux [..] ...>wrote:
> On 02/22/2012 09:47 PM, Peter Soetens wrote:
>
>> Since rosmake
>>> basically re-runs cmake when you change OROCOS_TARGET (how does it detect
>>> that, by the way ? Does it forward the environment variable to the cmake
>>> command line or is it some other magic ?)
>>>
>>
>> rosmake re-runs cmake every time. Dependencies that don't need to be
>> built can get a ROS_NOBUILD touch file to speed up that process. Most
>> of the time, we only run 'make' in the package we are coding in.
>>
>> That's actually the main reason why catkin (aka rosbuild 2) has been
>> made: http://people.willowgarage.**com/straszheim/catkin-dev/**
>> catkin/index.html<http://people.willowgarage.com/straszheim/catkin-dev/catkin/index.html>
>> See also http://www.ros.org/reps/rep-**0122.html<http://www.ros.org/reps/rep-0122... the intended
>> directory structure
>>
> Oh. But that actually looks like a decent build system that could be
> interfaced easily by others (e.g. autoproj). Do you know of the timeplan on
> its deployment ?
>
>
It is being used in Fuerte for testing on a set of selected packages, but
the API is said to be still unstable. Migration to catkin will only happen
after Fuerte. I think they want to release it as an independent tool as
well (debian package or similar).
Peter