MsgSend_r problem

I have encountered a problem that involves MsgSend_r. Three processes are
involved. Let’s call them process A, process B, and process C. Process A
spawns process B and process C. Process B has several threads. One of the
threads is reply-blocked on MsgSend_r to process C. When there is some
external activity, process C will reply to process B and I will see a printf
in process B. After doing the necessary handling, process B will initiate
another MsgSend_r to process C and stay reply-blocked.

Process A eventually kills process B with SIGTERM. Sometimes when process B
is terminating, MsgSend_r actually returns a non-negative value. I see the
printf in process B when it is no longer reply-blocked. The data is invalid
though so when it is used, process B will SIGSEGV. When this happens,
process C is still running. Why does MsgSend_r return when the process is
terminating? Is this a bug?

Please help.

Rex

Rex Lam <Rex.Lam@igt.com> wrote:

I have encountered a problem that involves MsgSend_r. Three processes are
involved. Let’s call them process A, process B, and process C. Process A
spawns process B and process C. Process B has several threads. One of the
threads is reply-blocked on MsgSend_r to process C. When there is some
external activity, process C will reply to process B and I will see a printf
in process B. After doing the necessary handling, process B will initiate
another MsgSend_r to process C and stay reply-blocked.

Process A eventually kills process B with SIGTERM. Sometimes when process B
is terminating, MsgSend_r actually returns a non-negative value. I see the
printf in process B when it is no longer reply-blocked. The data is invalid
though so when it is used, process B will SIGSEGV. When this happens,
process C is still running. Why does MsgSend_r return when the process is
terminating? Is this a bug?

Take a look of “Unblock” part in resmgr docs.

Basically if a client blocked on a server, and the client wish to unblock,
(in your case, client receive a signal and needs to process it), a pulse
send to server, the server then noticed the satuation, and let the client
go (By MsgReply()/MsgError() back).

If your server (process C) do not handle UNBLOCK, or didn’t handle it right,
your server/client will in unreliable states.

-xtang