English 中文(简体)
共享的XDR 例行公事和向数据科点
原标题:Shared XDR routines and pointer to .rodata section

我利用石头为方案Im发展中的客户和服务器制造障碍。 因此,这些障碍利用XDR来收集数据并通过该网发送数据。 在我执行这部法典时,有人投掷了部分过失:

char *str = "Hello!";
my_remote_call(str, strlen(str));

Instead, no problems if I modify it in this way:

char *str = "Hello!";
char *str2 = (char*) malloc(strlen(str));
memcpy(str2, str, strlen(str));
my_remote_call(str2, strlen(str2));

与亚洲开发银行合作 我发现,在我召集的Xdr_u_char()职能中产生分裂错误。 我的问题是:

在第一种情况下,Hello string由汇编者在.rodata节中分配,而在第二种情况下,一部分肥皂被用于纪念雕塑。 由于Xdr_u_char签名明确要求

char*

而不是

const char*

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Fapis%2Fxdr_u_char.htm 因此,在这种情况下,这意味着Xdr_u_char()功能改变我的数据?

问题回答

我认为,它正在接收而不是发送数据。 您是否确实使用XDR(XDR_ENCODE)模式?

向特别提款权发送载体时,请使用<条码>xdr_string而不是;显示<条码>∗.x文档。 ......





相关问题
Signal 11, segmentation fault on iphone App exit

I have an iphone app. It seems to run fine. When I connect to a provisioned iphone to Xcode and run the App, the console log in the Organizer window, always complains about a Segmentation fault when ...

Segmentation fault on large array sizes

The following code gives me a segmentation fault when run on a 2Gb machine, but works on a 4GB machine. int main() { int c[1000000]; cout << "done "; return 0; } The size of the ...

PHP doesn t handle stack overflow?

I was surprised when I just tried the following PHP code: function foo() { foo(); } foo(); I expected to get "500: Internal server error". Instead the connection was closed immediately (no bytes ...

PHP segmentation fault caused by php while loop

I discovered a way to make php segfault, and I m a bit curious about what s happening. Maybe someone can explain this for me? joern@xps:..com/trunk5/tools/nestedset> cat > while.php <?php ...

C: Accessing a pointer from outside a function

I have the following code: int takeEven(int *nums, int numelements, int *newlist) { newlist = malloc(numelements * sizeof *newlist); int i, found = 0; for(i = 0; i < numelements; ++i, ...

Segmentation fault on time(0);

I m rewriting an old program to do some new stuff, and suddenly I get a segmentation fault error on the following line of code: time_t seconds_since_time_begun = time(0); Why, oh why? Update: I ...

热门标签