[Bug 869] New: Mac OS X regression in types test

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

Summary: Mac OS X regression in types test
Product: Toolchain
Version: master
Platform: All
OS/Version: Mac OS X
Status: NEW
Severity: normal
Priority: P3
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: kiwi [dot] net [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Fails to convert types char and float. Same code works fine on Ubuntu Narwhal
(boost 1.42). Results for Mac OS X (boost 1.46.1 or 1.44)

XXX Failed to convert char to char
/g/o/rtt/tests/typekit_test.cpp:151: error in "testComposeDecompose": check
ti->composeType( ti->decomposeType(input->getDataSource()),
output->getDataSource()) failed
...
XXX Failed to convert float to float
/g/o/rtt/tests/typekit_test.cpp:151: error in "testComposeDecompose": check
ti->composeType( ti->decomposeType(input->getDataSource()),
output->getDataSource()) failed

given the following mod to rtt/internal/DataSource.inl

diff --git a/rtt/internal/DataSource.inl b/rtt/internal/DataSource.inl
index d94615e..448d737 100644
--- a/rtt/internal/DataSource.inl
+++ b/rtt/internal/DataSource.inl
@@ -1,6 +1,7 @@
 #ifndef CORELIB_DATASOURCE_INL
 #define CORELIB_DATASOURCE_INL
 
+#include <iostream>
 #include "AssignCommand.hpp"
 #include "DataSourceTypeInfo.hpp"
 #include "../types/TypeTransporter.hpp"
@@ -85,8 +86,10 @@ namespace RTT
                 this->set( o->value() );
                 return true;
             }
+           std::cout << "XXX Failed to evaluate " << other->getType() << " for
" << DataSourceTypeInfo<T>::getType() <<"\n";
             return false;
         }
+       std::cout << "XXX Failed to convert " << other->getType() << " to " <<
DataSourceTypeInfo<T>::getType() <<"\n";
         return false;
     }

[Bug 869] Mac OS X regression in types test

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

--- Comment #6 from S Roderick <kiwi [dot] net [..] ...> 2011-07-18 13:54:39 CEST ---
Created attachment 717
--> http://bugs.orocos.org/attachment.cgi?id=717
Mac + boost 1.46 log from trimmed down types_test program

[Bug 869] Mac OS X regression in types test

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

--- Comment #5 from S Roderick <kiwi [dot] net [..] ...> 2011-07-18 13:53:54 CEST ---
Created attachment 716
--> http://bugs.orocos.org/attachment.cgi?id=716
Produce trimmed down types_test program

[Bug 869] Mac OS X regression in types test

On Jul 18, 2011, at 06:53 , S Roderick wrote:

>
> http://bugs.orocos.org/show_bug.cgi?id=869
>
> --- Comment #5 from S Roderick <kiwi [dot] net [..] ...> 2011-07-18 13:53:54 CEST ---
> Created attachment 716
> --> http://bugs.orocos.org/attachment.cgi?id=716
> Produce trimmed down types_test program

Sorry, patch applies to RTT v2 master.

[Bug 869] Mac OS X regression in types test

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

--- Comment #4 from Peter Soetens <peter [..] ...> 2011-06-15 18:22:05 CEST ---
(In reply to comment #3)
> Created attachment 707
> fixes the char('

Hmm... fixes the char('c') syntax. It was not supported previously, but it may
help nailing type bugs down. I think the root cause of this bug is that on
macos-x the global typeinfo pointer is being overwritten or so and that for
this reason type comparisons fail. Maybe the .dylib patches fix this problem ?

I have pushed this to toolchain-2.4. Please see if this improves things or at
least testing things...

Peter

[Bug 869] Mac OS X regression in types test

On Jun 15, 2011, at 11:22 , Peter Soetens wrote:

>
> http://bugs.orocos.org/show_bug.cgi?id=869
>
> --- Comment #4 from Peter Soetens <peter [..] ...> 2011-06-15 18:22:05 CEST ---
> (In reply to comment #3)
>> Created attachment 707
>> fixes the char('
>
> Hmm... fixes the char('c') syntax. It was not supported previously, but it may
> help nailing type bugs down. I think the root cause of this bug is that on
> macos-x the global typeinfo pointer is being overwritten or so and that for
> this reason type comparisons fail. Maybe the .dylib patches fix this problem ?
>
> I have pushed this to toolchain-2.4. Please see if this improves things or at
> least testing things...
>
> Peter

There's more to this than we thought ... nasty nasty bug ...

It has something to do with boost type_discover and std::vector<double>. Use the attached patch to get a trimmed down types_test program that demonstrates the problem. Comment out line 151 (or 153, depending on your boost version) and the problem goes away. It doesn't matter where in the problem this line occurs, before or after the test, it still causes the problem. Separately, with that line above enabled, switch between the different variable types in the AType structure at top of types_test.cpp. _ONLY_ type_discovery _AND_ std::vector<double> cause the problem. And only on the mac, or only with boost 1.46.1 (not sure which yet).

Same code works fine on Lucid w/ boost 1.41, but fails on Snow Leopard w/ boost 1.46.1

I'll keep hacking at it ...
S

[Bug 869] Mac OS X regression in types test

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

--- Comment #3 from Peter Soetens <peter [..] ...> 2011-06-15 18:19:36 CEST ---
Created attachment 707
--> http://bugs.orocos.org/attachment.cgi?id=707
fixes the char('

[Bug 869] Mac OS X regression in types test

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

--- Comment #2 from S Roderick <kiwi [dot] net [..] ...> 2011-06-04 20:43:02 CEST ---
Created attachment 701
--> http://bugs.orocos.org/attachment.cgi?id=701
Char type test case in types_test program

[Bug 869] Mac OS X regression in types test

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

--- Comment #1 from S Roderick <kiwi [dot] net [..] ...> 2011-06-04 20:42:28 CEST ---
Think that there's something deeper going on here. At least with char ...

./value_test 
Running 5 test cases...
/g/o/rtt/tests/value_test.cpp:215: fatal error in "testConcatRtstring": Parse
error at line 9: Fatal Semantic error: Cannot apply binary operation rt_string
+ char.
 
*** 1 failure detected in test suite "Master Test Suite"

and the line in question is

       + "       s1 =  rt_string(\"Now: \") + 1 + rt_string(\"st \") + s1 +
'!'\n"
 

OR

/value_test 
Running 5 test cases...
/g/o/rtt/tests/value_test.cpp:215: fatal error in "testConcatRtstring": Parse
error at line 9: No such constructor found: char(char)
 
*** 1 failure detected in test suite "Master Test Suite"

and the line in question is

       + "       s1 =  rt_string(\"Now: \") + 1 + rt_string(\"st \") + s1 +
char('!')\n"
 

And for "types_test" with the attached testCharType() function

./types_test 
Running 11 test cases...
/g/o/rtt/tests/types_test.cpp:562: fatal error in "testTypes": Parse error at
line 19: Fatal Semantic error: array does not have member "size".
/g/o/rtt/tests/types_test.cpp:562: fatal error in "testCharType": Parse error
at line 2: No such constructor found: char(char)
/g/o/rtt/tests/types_test.cpp:562: fatal error in "testOperators": Parse error
at line 3: Semantic error: Attempt to initialize a var char with a char.
/g/o/rtt/tests/types_test.cpp:562: fatal error in "testDotsAndIndexes": Parse
error at line 2: No such constructor found: matrix(int, array)
Assertion failed: (ret), function convert, file
/g/o/rtt/rtt/typekit/../types/TemplateConstructor.hpp, line 107.
unknown location:0: fatal error in "testConversions": signal: SIGABRT
(application abort requested)
/g/o/rtt/tests/types_test.cpp:554: last checkpoint
/g/o/rtt/tests/types_test.cpp:562: fatal error in "testProperties": Parse error
at line 9: Fatal Semantic error: Illegal use of []: array[ int ].
 
*** 6 failures detected in test suite "Master Test Suite"

It's almost as though Mac OS X's ability to manipulate the char type in scripts
is just plain broken.