[openrtm-users 03074] Re: Is RTC::TimedStringSequence to bytestream conversion a well defined function?

Attila Bernáth attila.bernath @ sztaki.hu
2014年 7月 25日 (金) 18:06:55 JST


Dear Geoffrey (and those who read this),

I worked quite a bit to make up a self-contained example that shows the anomaly.

I have not completely succeeded.
The attached code, when compiled, does not show the phenomenon. However:
- the code I started with does not always show the phenomenon either
(it seems that it depends on the contents of the memory),
- if you compile and run the attached code with valgrind, it shows
that some uninitialized values are copied into the byte arrays at some
point.

One more remark: the byte array that I start with in the attached code
is obtained from a valid RTC::TimedStringSeq data.

I have linux 12.04, and g++ of version 4.6.3

Attila

2014-07-23 15:05 GMT+02:00 Geoffrey Biggs <geoffrey.biggs at aist.go.jp>:
> Hi Attila,
>
> It will be easier to investigate the behaviour you are seeing if you can
> provide an example.
>
> Geoff
>
> On Wed, 23 Jul 2014 13:53:37 Attila Bern㙈﹀h wrote:
>> Dear All,
>>
>>
>> I have the following problem. I generate some RTC::TimedStringSequence
>> data (say a1), then I serialize it into a byte stream (say b1) using
>> the cdrMemoryStream API. Then I convert this bytestream b1 back to a
>> RTC::TimedStringSequence variable (say a2): all is fine, the content
>> of a1 and that of b1 is the same as far as I can judge. But if I
>> convert a2 into a bytestream b2 again, then b1 and b2 differ
>> sometimes. Is this possible?
>>
>> Valgrind says that some uninitialized memory area is copied into the
>> bytestreams: is this OK?
>>
>> I can put together some minimal example, if needed.
>>
>> Attila
>> _______________________________________________
>> openrtm-users mailing list
>> openrtm-users at openrtm.org
>> http://www.openrtm.org/mailman/listinfo/openrtm-users
>
> _______________________________________________
> openrtm-users mailing list
> openrtm-users at openrtm.org
> http://www.openrtm.org/mailman/listinfo/openrtm-users
>
> _______________________________________________
> openrtm-users mailing list
> openrtm-users at openrtm.org
> http://www.openrtm.org/mailman/listinfo/openrtm-users
>
-------------- next part --------------
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

project(cdrStreamProba)

set(CMAKE_BUILD_TYPE Debug)

find_package(OpenRTM)

if(${OpenRTM_FOUND})
  MESSAGE(STATUS "OpenRTM configuration Found")
else(${OpenRTM_FOUND})
  message(STATUS "Use cmake/Modules/FindOpenRTM.cmake in the project")
  list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
  find_package(OpenRTM REQUIRED)
endif(${OpenRTM_FOUND})
if (DEFINED OPENRTM_INCLUDE_DIRS)
  string(REGEX REPLACE "-I" ";"
    OPENRTM_INCLUDE_DIRS "${OPENRTM_INCLUDE_DIRS}")
  string(REGEX REPLACE " ;" ";"
    OPENRTM_INCLUDE_DIRS "${OPENRTM_INCLUDE_DIRS}")
endif (DEFINED OPENRTM_INCLUDE_DIRS)
include_directories(${OPENRTM_INCLUDE_DIRS})




#add_executable(bad_test_RTMHexConverter bad_test_RTMHexConverter.cpp)
#target_link_libraries(bad_test_RTMHexConverter ${OPENRTM_LIBRARIES})

#add_executable(bad_test_omniOrb bad_test_omniOrb.cpp)
#target_link_libraries(bad_test_omniOrb ${OPENRTM_LIBRARIES})

add_executable(TimedStringSeq TimedStringSeq.cpp)
target_link_libraries(TimedStringSeq ${OPENRTM_LIBRARIES})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TimedStringSeq.cpp
Type: text/x-c++src
Size: 3130 bytes
Desc: not available
URL: <http://www.openrtm.org/pipermail/openrtm-users/attachments/20140725/2ced156f/attachment.cpp>


More information about the openrtm-users mailing list