[Bug 817] New: Calling addConstructor on non-existing type causes segfault.

http://bugs.orocos.org/show_bug.cgi?id=817

Summary: Calling addConstructor on non-existing type causes
segfault.
Product: Toolchain
Version: 2.2
Platform: All
OS/Version: GNU/Linux
Status: NEW
Severity: minor
Priority: P5
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: ruben [dot] smits [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Hi ,

When I try to load the rtt_ros_integration types plugin by setting the
RTT_COMPONENT_PATH this causes a crash:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffec5c09b7 in
ros_integration::ROSPrimitivesTypekitPlugin::loadConstructors (this=<value
optimized out>)
at
/home/rsmits/ros/kul-ros-pkg/stacks/orocos_toolchain_ros/rtt_ros_integration/src/orocos/types/ros_primitives_typekit_plugin.cpp:122
122 ti->type("float")->addConstructor( newConstructor(
&int_to_float, true ));

This is probably due to the fact that I did not load the rtt-primitives typekit
yet and therefor the "float" type is not known yet.

Is the segfault expected behavior or should we catch this?

BTW: If I put the RTT path first in the RTT_COMPONENT_PATH, the problem
disappears.

-- Ruben

[Bug 817] Calling addConstructor on non-existing type causes seg

http://bugs.orocos.org/show_bug.cgi?id=817

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX

--- Comment #1 from Peter Soetens <peter [..] ...> 2011-02-24 21:58:50 CET ---
(In reply to comment #0)
> Hi ,
>
> When I try to load the rtt_ros_integration types plugin by setting the
> RTT_COMPONENT_PATH this causes a crash:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007fffec5c09b7 in
> ros_integration::ROSPrimitivesTypekitPlugin::loadConstructors (this=<value
> optimized out>)
> at
> /home/rsmits/ros/kul-ros-pkg/stacks/orocos_toolchain_ros/rtt_ros_integration/src/orocos/types/ros_primitives_typekit_plugin.cpp:122
> 122 ti->type("float")->addConstructor( newConstructor(
> &int_to_float, true ));
>
> This is probably due to the fact that I did not load the rtt-primitives typekit
> yet and therefor the "float" type is not known yet.
>
> Is the segfault expected behavior or should we catch this?
>
> BTW: If I put the RTT path first in the RTT_COMPONENT_PATH, the problem
> disappears.
>
> -- Ruben

It's expected behavior. The larger problem is that no aliases exist (it was
probably known as float32), which is fixed on the master branch.

Peter