<div dir="ltr">This segfault is probably caused by incorrect use of the CORBA string data type.<div><br></div><div>The TimedString data type uses a CORBA (omniORB) string data type for its "data" member. You need to be careful about ownership of memory when putting strings into it. Usually, you use CORBA::string_dup() rather than passing a raw pointer. See the StringIO example included with OpenRTM for how to work with strings.</div>
<div><br></div><div>Geoff</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 15 July 2014 20:30,  <span dir="ltr"><<a href="mailto:attila.bernath@sztaki.hu" target="_blank">attila.bernath@sztaki.hu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear All, I have a simple example that tries to use the Streaming API, but<br>
segfaults. Program received signal SIGSEGV, Segmentation fault.<br>
0x00007ffff72af9d8 in cdrStream::marshalString (this=0x7fffffffe370,<br>
s=0x7ffff79718b4 "", bounded=0) at /usr/include/omniORB4/<u></u>cdrStream.h:590 590<br>
pd_ncs_c->marshalString(*this,<u></u>pd_tcs_c,bounded,0,s); The code (sorry, I don't<br>
see how to attach a file):<br>
******************************<u></u>**************************** #include #include<br>
#include #include using std::cout; using std::cerr; using std::endl; using<br>
std::stringstream; using std::string; int main(int argc, char **argv) { //<br>
srand(123); RTC::TimedString data; // const char* c = "hu"; // data.data = c;<br>
std::cout << data.data << std::endl; cdrMemoryStream os; std::cerr << "Hi" <<<br>
std::endl; data >>= os; std::cerr << "Hi2" << std::endl; }<br>
******************************<u></u>**************************** I was trying to<br>
dig deeper and debug the omniorb code, but I did not find a good way: is<br>
there any? Thanks! Attila<br>
<br>
______________________________<u></u>_________________<br>
openrtm-users mailing list<br>
<a href="mailto:openrtm-users@openrtm.org" target="_blank">openrtm-users@openrtm.org</a><br>
<a href="http://www.openrtm.org/mailman/listinfo/openrtm-users" target="_blank">http://www.openrtm.org/<u></u>mailman/listinfo/openrtm-users</a><br>
</blockquote></div><br></div>