Print

Print


I ran my verification test and it didn't reproduce the problem. After asking it to send '12345678' I got this on the client side:
theMD = GetMetadata(theML);
(gdb) p theMD
$1 = 0x7fffc0000950 "12345678"
(gdb) p theML
$2 = 9

The response structure also is completely correct.

(gdb) p rInfo
$3 = (const XrdSsiRespInfo &) @0x6193e8: {{buff = 0x7fffc0000959 "how now brown cow ",
eMsg = 0x7fffc0000959 "how now brown cow ", fsize = 140736414615897,
strmP = 0x7fffc0000959}, {blen = 19, eNum = 19, fdnum = 19}, mdlen = 9,
mdata = 0x7fffc0000950 "12345678", rType = XrdSsiRespInfo::isData}

I suspect you may have fallen into the std::string c_str() trap. As the metadata must remain valid until the Responder's Finished() method is called. Using std:string is a rather precarious way of doing it since if the string goes out of scope or gets altered prior to Finished() being called, the behavior is undefined and you may be sending bad bytes. It would appear here that the string was reset to the null string before the metadata was actually sent.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/xrootd/xrootd","title":"xrootd/xrootd","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/xrootd/xrootd"}},"updates":{"snippets":[{"icon":"PERSON","message":"@abh3 in #537: I ran my verification test and it didn't reproduce the problem. After asking it to send '12345678' I got this on the client side:\r\ntheMD = GetMetadata(theML);\r\n(gdb) p theMD\r\n$1 = 0x7fffc0000950 \"12345678\"\r\n(gdb) p theML\r\n$2 = 9\r\n\r\nThe response structure also is completely correct.\r\n\r\n(gdb) p rInfo\r\n$3 = (const XrdSsiRespInfo \u0026) @0x6193e8: {{buff = 0x7fffc0000959 \"how now brown cow \",\r\n eMsg = 0x7fffc0000959 \"how now brown cow \", fsize = 140736414615897,\r\n strmP = 0x7fffc0000959}, {blen = 19, eNum = 19, fdnum = 19}, mdlen = 9,\r\n mdata = 0x7fffc0000950 \"12345678\", rType = XrdSsiRespInfo::isData}\r\n\r\nI suspect you may have fallen into the std::string c_str() trap. As the metadata must remain valid until the Responder's Finished() method is called. Using std:string is a rather precarious way of doing it since if the string goes out of scope or gets altered prior to Finished() being called, the behavior is undefined and you may be sending bad bytes. It would appear here that the string was reset to the null string before the metadata was actually sent.\r\n"}],"action":{"name":"View Issue","url":"https://github.com/xrootd/xrootd/issues/537#issuecomment-313288471"}}}

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1