[Bug 816] New: Assertion failure when loading a typekit installed on the orocos 'root' directory

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

Summary: Assertion failure when loading a typekit installed on
the orocos 'root' directory
Product: Toolchain
Version: master
Platform: Other
OS/Version: Other
Status: NEW
Severity: critical
Priority: P5
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: charles [dot] lesire [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

An assertion fails when I just start the deployer with no RTT_COMPONENT_PATH
defined (then using default installation path).

I have just created my component with orocreate-pkg, compile and install it on
the default install folder (orocos/ in the orocos install folder, which in my
case is the classical one, on the autoproj tree)

When I create a package 'abba', no problem. The deployer loads the rtt-types,
then the ABBA typekit and transports.
But with the 'ABBA' component, the assertion fails because the deployer first
tries to load the ABBA typekit, then the rtt-types.

Of course, everything is fine if I install the component elsewhere, and
manually import it.

The failure trace is:
deployer-gnulinux -linfo
0.000 [ Info ][Logger] Real-time memory: 17232 bytes free of 20480 allocated.
0.000 [ Info ][Logger] Setting OCL factory for real-time logging
0.000 [ Info ][Logger] No RTT_COMPONENT_PATH set. Using default:
/home/lesire/work/autoproj/install/toolchain/lib/orocos
0.000 [ Info ][Logger] Loading plugin libraries from directory
/home/lesire/work/autoproj/install/toolchain/lib/orocos/plugins ...
0.001 [ Info ][Logger] Loaded RTT Service 'marshalling' from
'rtt-marshalling-gnulinux'
0.001 [ Info ][Logger] Loaded RTT Service 'scripting' from
'rtt-scripting-gnulinux'
0.001 [ Info ][Logger] Loading typekit libraries from directory
/home/lesire/work/autoproj/install/toolchain/lib/orocos/types ...
0.027 [ Info ][TypekitRepository::Import] Loading Transport
MQueue:///orogen/ABBA.
0.027 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA/MQueue'
from 'ABBA-transport-mqueue-gnulinux'
0.027 [ Info ][TypekitRepository::Import] Loading Typekit rtt-types.
0.027 [ Info ][Logger] Loaded RTT TypeKit/Transport 'rtt-types' from
'rtt-typekit-gnulinux'
0.054 [ Info ][TypekitRepository::Import] Loading Transport
CORBA:///orogen/ABBA.
0.054 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA/CORBA' from
'ABBA-transport-corba-gnulinux'
0.057 [ Info ][TypekitRepository::Import] Loading Transport
CORBA://rtt-types.
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for ConnPolicy
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for TaskContext
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for array
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for bool
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for char
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for double
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for float
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for int
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for string
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for uint
0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for void
0.057 [ Info ][Logger] Loaded RTT TypeKit/Transport 'rtt-corba-types' from
'rtt-transport-corba-gnulinux'
0.058 [ Info ][TypekitRepository::Import] Loading Typekit /orogen/ABBA.
0.058 [ Info ][TypekitRepository::Import] Registered new 'MQueue' transport
for /ABBAData
0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for /ABBAData
0.058 [ Info ][TypekitRepository::Import] TypeInfo for type '/std/string'
already exists as 'string': I'll alias the original and install the new
instance.
0.058 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was already
added for type /std/string
0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for /std/string
0.058 [ Info ][TypekitRepository::Import] TypeInfo for type
'/std/vector</double>' already exists as 'array': I'll alias the original and
install the new instance.
0.058 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was already
added for type /std/vector</double>
0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
for /std/vector</double>
0.058 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA' from
'ABBA-typekit-gnulinux'
0.059 [ Info ][TypekitRepository::Import] Loading Transport
mqueue://rtt-types.
deployer-gnulinux:
/home/lesire/work/autoproj/toolchain/rtt/rtt/transports/mqueue/MQLib.cpp:58:
virtual bool RTT::mqueue::MQLibPlugin::registerTransport(std::string,
RTT::types::TypeInfo*): Assertion `name == ti->getTypeName()' failed.

[Bug 816] Assertion failure when loading a typekit installed on

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

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

What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED

--- Comment #2 from Peter Soetens <peter [..] ...> 2011-02-24 22:06:27 CET ---
(In reply to comment #0)
> An assertion fails when I just start the deployer with no RTT_COMPONENT_PATH
> defined (then using default installation path).
>
...
> deployer-gnulinux:
> /home/lesire/work/autoproj/toolchain/rtt/rtt/transports/mqueue/MQLib.cpp:58:
> virtual bool RTT::mqueue::MQLibPlugin::registerTransport(std::string,
> RTT::types::TypeInfo*): Assertion `name == ti->getTypeName()' failed.

I have removed this assertion from MQLib.cpp and CorbaLib.cpp on the 2.2
branch. It should now work again as expected.

Thanks for reporting,
Peter

[Bug 816] Assertion failure when loading a typekit installed on

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

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

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |peter [..] ...

--- Comment #1 from Peter Soetens <peter [..] ...> 2011-02-14 22:36:22 CET ---
(In reply to comment #0)
> An assertion fails when I just start the deployer with no RTT_COMPONENT_PATH
> defined (then using default installation path).
>
> I have just created my component with orocreate-pkg, compile and install it on
> the default install folder (orocos/ in the orocos install folder, which in my
> case is the classical one, on the autoproj tree)
>
> When I create a package 'abba', no problem. The deployer loads the rtt-types,
> then the ABBA typekit and transports.
> But with the 'ABBA' component, the assertion fails because the deployer first
> tries to load the ABBA typekit, then the rtt-types.
>
> Of course, everything is fine if I install the component elsewhere, and
> manually import it.
>
> The failure trace is:
> deployer-gnulinux -linfo
> 0.000 [ Info ][Logger] Real-time memory: 17232 bytes free of 20480 allocated.
> 0.000 [ Info ][Logger] Setting OCL factory for real-time logging
> 0.000 [ Info ][Logger] No RTT_COMPONENT_PATH set. Using default:
> /home/lesire/work/autoproj/install/toolchain/lib/orocos
> 0.000 [ Info ][Logger] Loading plugin libraries from directory
> /home/lesire/work/autoproj/install/toolchain/lib/orocos/plugins ...
> 0.001 [ Info ][Logger] Loaded RTT Service 'marshalling' from
> 'rtt-marshalling-gnulinux'
> 0.001 [ Info ][Logger] Loaded RTT Service 'scripting' from
> 'rtt-scripting-gnulinux'
> 0.001 [ Info ][Logger] Loading typekit libraries from directory
> /home/lesire/work/autoproj/install/toolchain/lib/orocos/types ...
> 0.027 [ Info ][TypekitRepository::Import] Loading Transport
> MQueue:///orogen/ABBA.
> 0.027 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA/MQueue'
> from 'ABBA-transport-mqueue-gnulinux'
> 0.027 [ Info ][TypekitRepository::Import] Loading Typekit rtt-types.
> 0.027 [ Info ][Logger] Loaded RTT TypeKit/Transport 'rtt-types' from
> 'rtt-typekit-gnulinux'
> 0.054 [ Info ][TypekitRepository::Import] Loading Transport
> CORBA:///orogen/ABBA.
> 0.054 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA/CORBA' from
> 'ABBA-transport-corba-gnulinux'
> 0.057 [ Info ][TypekitRepository::Import] Loading Transport
> CORBA://rtt-types.
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for ConnPolicy
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for TaskContext
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for array
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for bool
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for char
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for double
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for float
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for int
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for string
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for uint
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for void
> 0.057 [ Info ][Logger] Loaded RTT TypeKit/Transport 'rtt-corba-types' from
> 'rtt-transport-corba-gnulinux'
> 0.058 [ Info ][TypekitRepository::Import] Loading Typekit /orogen/ABBA.
> 0.058 [ Info ][TypekitRepository::Import] Registered new 'MQueue' transport
> for /ABBAData
> 0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for /ABBAData
> 0.058 [ Info ][TypekitRepository::Import] TypeInfo for type '/std/string'
> already exists as 'string': I'll alias the original and install the new
> instance.
> 0.058 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was already
> added for type /std/string
> 0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for /std/string
> 0.058 [ Info ][TypekitRepository::Import] TypeInfo for type
> '/std/vector</double>' already exists as 'array': I'll alias the original and
> install the new instance.
> 0.058 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was already
> added for type /std/vector</double>
> 0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for /std/vector</double>
> 0.058 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA' from
> 'ABBA-typekit-gnulinux'
> 0.059 [ Info ][TypekitRepository::Import] Loading Transport
> mqueue://rtt-types.
> deployer-gnulinux:
> /home/lesire/work/autoproj/toolchain/rtt/rtt/transports/mqueue/MQLib.cpp:58:
> virtual bool RTT::mqueue::MQLibPlugin::registerTransport(std::string,
> RTT::types::TypeInfo*): Assertion `name == ti->getTypeName()' failed.

This is a weak assert that shouldn't have been there in the first place. It's
the same one failing as Steven reported.

The assert should have checked: 'Types()->type(name) == ti'. Yet, it doesn't
belong here, since an assert should check the internal code, and not an API as
it does here (which might relax some preconditions, as we see here).

IMHO it's a bad example of an assert, which isn't a reason to throw all asserts
overboard. So the fix is just to remove it.

You must disable asserts in production code (like on your live system), so
always compile with -DNDEBUG. With cmake, this can be done by using the
'Release' or 'MinSizeRel' cmake build type.

Peter

Fucking asserts!

I use this bug report to claim ;) that we should avoid using asserts in
RTT (and co). It is so disturbing to have no way to launch the
application. The only solution when an assert fails, is to try to solve
or at least to figure out what happens by 'debugging' (I mean, put some
breakpoints on the code and use gdb).

I see no case where assert are really useful! Exception
throwing/catching should do the job (printing errors in the deployer
when catching exceptions for instance).

I remember this issue was already discussed (or started to be discussed)
on the ml.

Charles.

On 14/02/2011 17:59, Charles Lesire wrote:
> http://bugs.orocos.org/show_bug.cgi?id=816
>
> Summary: Assertion failure when loading a typekit installed on
> the orocos 'root' directory
> Product: Toolchain
> Version: master
> Platform: Other
> OS/Version: Other
> Status: NEW
> Severity: critical
> Priority: P5
> Component: RTT
> AssignedTo: orocos-dev [..] ...
> ReportedBy: charles [dot] lesire [..] ...
> CC: orocos-dev [..] ...
> Estimated Hours: 0.0
>
>
> An assertion fails when I just start the deployer with no RTT_COMPONENT_PATH
> defined (then using default installation path).
>
> I have just created my component with orocreate-pkg, compile and install it on
> the default install folder (orocos/ in the orocos install folder, which in my
> case is the classical one, on the autoproj tree)
>
> When I create a package 'abba', no problem. The deployer loads the rtt-types,
> then the ABBA typekit and transports.
> But with the 'ABBA' component, the assertion fails because the deployer first
> tries to load the ABBA typekit, then the rtt-types.
>
> Of course, everything is fine if I install the component elsewhere, and
> manually import it.
>
> The failure trace is:
> deployer-gnulinux -linfo
> 0.000 [ Info ][Logger] Real-time memory: 17232 bytes free of 20480 allocated.
> 0.000 [ Info ][Logger] Setting OCL factory for real-time logging
> 0.000 [ Info ][Logger] No RTT_COMPONENT_PATH set. Using default:
> /home/lesire/work/autoproj/install/toolchain/lib/orocos
> 0.000 [ Info ][Logger] Loading plugin libraries from directory
> /home/lesire/work/autoproj/install/toolchain/lib/orocos/plugins ...
> 0.001 [ Info ][Logger] Loaded RTT Service 'marshalling' from
> 'rtt-marshalling-gnulinux'
> 0.001 [ Info ][Logger] Loaded RTT Service 'scripting' from
> 'rtt-scripting-gnulinux'
> 0.001 [ Info ][Logger] Loading typekit libraries from directory
> /home/lesire/work/autoproj/install/toolchain/lib/orocos/types ...
> 0.027 [ Info ][TypekitRepository::Import] Loading Transport
> MQueue:///orogen/ABBA.
> 0.027 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA/MQueue'
> from 'ABBA-transport-mqueue-gnulinux'
> 0.027 [ Info ][TypekitRepository::Import] Loading Typekit rtt-types.
> 0.027 [ Info ][Logger] Loaded RTT TypeKit/Transport 'rtt-types' from
> 'rtt-typekit-gnulinux'
> 0.054 [ Info ][TypekitRepository::Import] Loading Transport
> CORBA:///orogen/ABBA.
> 0.054 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA/CORBA' from
> 'ABBA-transport-corba-gnulinux'
> 0.057 [ Info ][TypekitRepository::Import] Loading Transport
> CORBA://rtt-types.
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for ConnPolicy
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for TaskContext
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for array
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for bool
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for char
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for double
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for float
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for int
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for string
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for uint
> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for void
> 0.057 [ Info ][Logger] Loaded RTT TypeKit/Transport 'rtt-corba-types' from
> 'rtt-transport-corba-gnulinux'
> 0.058 [ Info ][TypekitRepository::Import] Loading Typekit /orogen/ABBA.
> 0.058 [ Info ][TypekitRepository::Import] Registered new 'MQueue' transport
> for /ABBAData
> 0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for /ABBAData
> 0.058 [ Info ][TypekitRepository::Import] TypeInfo for type '/std/string'
> already exists as 'string': I'll alias the original and install the new
> instance.
> 0.058 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was already
> added for type /std/string
> 0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for /std/string
> 0.058 [ Info ][TypekitRepository::Import] TypeInfo for type
> '/std/vector</double>' already exists as 'array': I'll alias the original and
> install the new instance.
> 0.058 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was already
> added for type /std/vector</double>
> 0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
> for /std/vector</double>
> 0.058 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA' from
> 'ABBA-typekit-gnulinux'
> 0.059 [ Info ][TypekitRepository::Import] Loading Transport
> mqueue://rtt-types.
> deployer-gnulinux:
> /home/lesire/work/autoproj/toolchain/rtt/rtt/transports/mqueue/MQLib.cpp:58:
> virtual bool RTT::mqueue::MQLibPlugin::registerTransport(std::string,
> RTT::types::TypeInfo*): Assertion `name == ti->getTypeName()' failed.
>

Fucking asserts!

On Mon, Feb 14, 2011 at 6:07 PM, Charles Lesire-Cabaniols
<Charles [dot] Lesire [..] ...> wrote:
> I use this bug report to claim ;) that we should avoid using asserts in
> RTT (and co). It is so disturbing to have no way to launch the
> application. The only solution when an assert fails, is to try to solve
> or at least to figure out what happens by 'debugging' (I mean, put some
> breakpoints on the code and use gdb).

Compiling as 'Release' is the other option.

>
> I see no case where assert are really useful! Exception
> throwing/catching should do the job (printing errors in the deployer
> when catching exceptions for instance).
>

Asserts and exceptions serve two completely orthogonal purposes:

Assert: checks the internal consistency of a library, independent of the
input the user provided.
Exceptions: checks the validity of the input provided by the user of your
library, assuming that (and keeping) the library is internally consistent.

So Assert's are a programmer's tools, during unit testing and stress testing,
and may be omitted from production code. Exceptions are for telling
users they gave bad/unexpected input and are enabled always.

Peter

Fucking asserts!

Peter Soetens wrote:
> Compiling as 'Release' is the other option.
Or just append NDEBUG to the CPPFLAGS if you want to keep all symbols and debuging info ?

Fucking asserts!

On Mon, 14 Feb 2011, Charles Lesire-Cabaniols wrote:

> I use this bug report to claim ;) that we should avoid using asserts in
> RTT (and co). It is so disturbing to have no way to launch the
> application. The only solution when an assert fails, is to try to solve
> or at least to figure out what happens by 'debugging' (I mean, put some
> breakpoints on the code and use gdb).

Well, a failing assert _does_ mean that there is something terribly wrong,
so what sense does it make to continue with the "application"?

> I see no case where assert are really useful! Exception
> throwing/catching should do the job (printing errors in the deployer
> when catching exceptions for instance).

Exceptions are not realtime safe (they require the C++ runtime, and that's
not a deterministic piece of code...). And exceptions are so damned easy to
get wrong or forget about until they bite you (typically somewhere else
then where the real problem was caused...).

> I remember this issue was already discussed (or started to be discussed)
> on the ml.

Indeed.

> Charles.

Herman

>
> On 14/02/2011 17:59, Charles Lesire wrote:
>> http://bugs.orocos.org/show_bug.cgi?id=816
>>
>> Summary: Assertion failure when loading a typekit installed on
>> the orocos 'root' directory
>> Product: Toolchain
>> Version: master
>> Platform: Other
>> OS/Version: Other
>> Status: NEW
>> Severity: critical
>> Priority: P5
>> Component: RTT
>> AssignedTo: orocos-dev [..] ...
>> ReportedBy: charles [dot] lesire [..] ...
>> CC: orocos-dev [..] ...
>> Estimated Hours: 0.0
>>
>>
>> An assertion fails when I just start the deployer with no RTT_COMPONENT_PATH
>> defined (then using default installation path).
>>
>> I have just created my component with orocreate-pkg, compile and install it on
>> the default install folder (orocos/ in the orocos install folder, which in my
>> case is the classical one, on the autoproj tree)
>>
>> When I create a package 'abba', no problem. The deployer loads the rtt-types,
>> then the ABBA typekit and transports.
>> But with the 'ABBA' component, the assertion fails because the deployer first
>> tries to load the ABBA typekit, then the rtt-types.
>>
>> Of course, everything is fine if I install the component elsewhere, and
>> manually import it.
>>
>> The failure trace is:
>> deployer-gnulinux -linfo
>> 0.000 [ Info ][Logger] Real-time memory: 17232 bytes free of 20480 allocated.
>> 0.000 [ Info ][Logger] Setting OCL factory for real-time logging
>> 0.000 [ Info ][Logger] No RTT_COMPONENT_PATH set. Using default:
>> /home/lesire/work/autoproj/install/toolchain/lib/orocos
>> 0.000 [ Info ][Logger] Loading plugin libraries from directory
>> /home/lesire/work/autoproj/install/toolchain/lib/orocos/plugins ...
>> 0.001 [ Info ][Logger] Loaded RTT Service 'marshalling' from
>> 'rtt-marshalling-gnulinux'
>> 0.001 [ Info ][Logger] Loaded RTT Service 'scripting' from
>> 'rtt-scripting-gnulinux'
>> 0.001 [ Info ][Logger] Loading typekit libraries from directory
>> /home/lesire/work/autoproj/install/toolchain/lib/orocos/types ...
>> 0.027 [ Info ][TypekitRepository::Import] Loading Transport
>> MQueue:///orogen/ABBA.
>> 0.027 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA/MQueue'
>> from 'ABBA-transport-mqueue-gnulinux'
>> 0.027 [ Info ][TypekitRepository::Import] Loading Typekit rtt-types.
>> 0.027 [ Info ][Logger] Loaded RTT TypeKit/Transport 'rtt-types' from
>> 'rtt-typekit-gnulinux'
>> 0.054 [ Info ][TypekitRepository::Import] Loading Transport
>> CORBA:///orogen/ABBA.
>> 0.054 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA/CORBA' from
>> 'ABBA-transport-corba-gnulinux'
>> 0.057 [ Info ][TypekitRepository::Import] Loading Transport
>> CORBA://rtt-types.
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for ConnPolicy
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for TaskContext
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for array
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for bool
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for char
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for double
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for float
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for int
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for string
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for uint
>> 0.057 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for void
>> 0.057 [ Info ][Logger] Loaded RTT TypeKit/Transport 'rtt-corba-types' from
>> 'rtt-transport-corba-gnulinux'
>> 0.058 [ Info ][TypekitRepository::Import] Loading Typekit /orogen/ABBA.
>> 0.058 [ Info ][TypekitRepository::Import] Registered new 'MQueue' transport
>> for /ABBAData
>> 0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for /ABBAData
>> 0.058 [ Info ][TypekitRepository::Import] TypeInfo for type '/std/string'
>> already exists as 'string': I'll alias the original and install the new
>> instance.
>> 0.058 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was already
>> added for type /std/string
>> 0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for /std/string
>> 0.058 [ Info ][TypekitRepository::Import] TypeInfo for type
>> '/std/vector</double>' already exists as 'array': I'll alias the original and
>> install the new instance.
>> 0.058 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was already
>> added for type /std/vector</double>
>> 0.058 [ Info ][TypekitRepository::Import] Registered new 'CORBA' transport
>> for /std/vector</double>
>> 0.058 [ Info ][Logger] Loaded RTT TypeKit/Transport '/orogen/ABBA' from
>> 'ABBA-typekit-gnulinux'
>> 0.059 [ Info ][TypekitRepository::Import] Loading Transport
>> mqueue://rtt-types.
>> deployer-gnulinux:
>> /home/lesire/work/autoproj/toolchain/rtt/rtt/transports/mqueue/MQLib.cpp:58:
>> virtual bool RTT::mqueue::MQLibPlugin::registerTransport(std::string,
>> RTT::types::TypeInfo*): Assertion `name == ti->getTypeName()' failed.
>>
>

Fucking asserts!

Herman Bruyninckx wrote:
> Exceptions are not realtime safe (they require the C++ runtime, and that's
> not a deterministic piece of code...). And exceptions are so damned easy to
> get wrong or forget about until they bite you (typically somewhere else
> then where the real problem was caused...).

About exception, i was just looking for task error states, and i think that rtt should not rely on exceptions. The error() and fatal() calls allow to put a task in an error state, but i don't understant why we should throw an exception for the Exception state. Why don't have an exception() call and let the user catch exceptions and call exception() ?

Fucking asserts!

On Tue, Feb 15, 2011 at 11:39 PM, Paul Chavent <paul [dot] chavent [..] ...>wrote:

> Herman Bruyninckx wrote:
> > Exceptions are not realtime safe (they require the C++ runtime, and
> that's
> > not a deterministic piece of code...). And exceptions are so damned easy
> to
> > get wrong or forget about until they bite you (typically somewhere else
> > then where the real problem was caused...).
>
> About exception, i was just looking for task error states, and i think that
> rtt should not rely on exceptions. The error() and fatal() calls allow to
> put a task in an error state, but i don't understant why we should throw an
> exception for the Exception state. Why don't have an exception() call and
> let the user catch exceptions and call exception() ?
>

Because user code may not always catch all exceptions. Not a desirable
scenario, but can (and will) happen.

Adolfo

> --
> Orocos-Dev mailing list
> Orocos-Dev [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
>

Fucking asserts!

On Wed, 16 Feb 2011, Adolfo Rodríguez Tsouroukdissian wrote:

> On Tue, Feb 15, 2011 at 11:39 PM, Paul Chavent <paul [dot] chavent [..] ...> wrote:
> Herman Bruyninckx wrote:
> > Exceptions are not realtime safe (they require the C++ runtime,
> and that's
> > not a deterministic piece of code...). And exceptions are so
> damned easy to
> > get wrong or forget about until they bite you (typically somewhere
> else
> > then where the real problem was caused...).
>
> About exception, i was just looking for task error states, and i think
> that rtt should not rely on exceptions. The error() and fatal() calls
> allow to put a task in an error state, but i don't understant why we
> should throw an exception for the Exception state. Why don't have an
> exception() call and let the user catch exceptions and call exception() ?
>
> Because user code may not always catch all exceptions. Not a desirable scenario,
> but can (and will) happen.

Indeed... The "feature" of allowing and supporting exceptions leads, in
practice, very often to some form of lazyness in compenent developers, in
the sense that they tend to rely on "downstream" developers to catch
exceptions in an "appropriate way". I've seen too many projects and
implementations where this has happened, and where developers say something
like "Yes, yes, we know, but this was just a temporary solution...". I want
to avoid temporary solutions in Orocos, whenever possible...

> Adolfo

Herman