- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- msgrcv issue
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 05:51 AM
тАО04-12-2010 05:51 AM
I've noticed following issue: having two or more processes that receive IPC messages via msgrcv() call are getting stuck when one process requesting msgtyp > 0 and other one(s) have msgtyp = 0.
Have you noticed something like this?
> uname -mnrsv
HP-UX ktest B.11.31 U ia64
> model
ia64 hp server rx7640
Solved! Go to Solution.
- Tags:
- msgrcv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 05:58 AM
тАО04-12-2010 05:58 AM
Re: msgrcv issue
# ./msg_r
creating msgq...
Mon Apr 12 15:54:40 2010
msgq_id = 20971608, mtype = 999
# ./msg_r 20971608
reusing msgq [20971608]
Mon Apr 12 15:54:45 2010
msgq_id = 20971608, mtype = 0
Mon Apr 12 15:55:00 2010
received 1 [Hello]
Mon Apr 12 15:55:00 2010
msgq_id = 20971608, mtype = 0
Mon Apr 12 15:55:00 2010
received 1 [Hello]
Mon Apr 12 15:55:00 2010
msgq_id = 20971608, mtype = 0
# ./msg_s 20971608 1 'Hello'
Mon Apr 12 15:54:48 2010
msgq_id = 20971608, mtype = 1, mtext [Hello]
# ./msg_s 20971608 1 'Hello'
Mon Apr 12 15:55:00 2010
msgq_id = 20971608, mtype = 1, mtext [Hello]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 06:00 AM
тАО04-12-2010 06:00 AM
Re: msgrcv issue
#include
#include
#include
#include
typedef struct
{
long mtype;
char mtext[100];
} msgx_ent;
int main( int argc, char *argv[] )
{
int msgq_id;
time_t t;
msgx_ent msgx_buf;
int msg_len;
setvbuf(stdout, NULL, _IONBF, 0);
if ( argc > 1 )
{
printf("reusing msgq [%s]\n", argv[1]);
msgq_id = atoi(argv[1]);
}
else
{
printf("creating msgq...\n");
msgq_id = msgget(IPC_PRIVATE, 0664);
}
again:
t = time(NULL);
printf("%s\tmsgq_id = %d, mtype = %d\n",
ctime(&t), msgq_id, argc > 1 ? 0 : 999);
msg_len = msgrcv(msgq_id, &msgx_buf, 100, argc > 1 ? 0 : 999, 0);
t = time(NULL);
if ( msg_len < 0 )
{
printf("%s\tmsg_len = %d, errno = %d\n",
ctime(&t), msg_len, errno);
}
else
{
printf("%s\treceived %d [%s]\n",
ctime(&t), msgx_buf.mtype, msgx_buf.mtext);
}
goto again;
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 06:00 AM
тАО04-12-2010 06:00 AM
Re: msgrcv issue
#include
#include
#include
#include
typedef struct
{
long mtype;
char mtext[100];
} msgx_ent;
int main( int argc, char *argv[] )
{
int msgq_id;
time_t t;
msgx_ent msgx_buf;
int msg_len;
setvbuf(stdout, NULL, _IONBF, 0);
msgq_id = atoi(argv[1]);
msgx_buf.mtype = atoi(argv[2]);
strcpy(msgx_buf.mtext, argv[3]);
t = time(NULL);
printf("%s\tmsgq_id = %d, mtype = %ld, mtext [%s]\n",
ctime(&t), msgq_id, msgx_buf.mtype, msgx_buf.mtext);
msg_len = msgsnd(msgq_id, &msgx_buf, strlen(msgx_buf.mtext)+1, 0);
if ( msg_len < 0 )
{
printf("msg_len = %d, errno = %d\n", msg_len, errno);
}
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 06:04 AM
тАО04-12-2010 06:04 AM
Re: msgrcv issue
- issue persist on ELF-64 and ELF-32 binaries
- issue vanish when I send message with msgtype == 999 (the one that is specified in msgrcv() call)
Any idea what's wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 06:08 AM
тАО04-12-2010 06:08 AM
Re: msgrcv issue
You might use 'tusc' to see some details. You don't offer any code, in particular the setting of 'msgflg' and any values of 'errno'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 06:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 06:29 AM
тАО04-12-2010 06:29 AM
Re: msgrcv issue
Indeed, this patch is not applied. I've just asked admin for installation. In case it solves the issue (or not), I will update the status here.
Thank you! Michal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-12-2010 11:34 PM
тАО04-12-2010 11:34 PM
Re: msgrcv issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2010 03:53 AM
тАО04-13-2010 03:53 AM
Re: msgrcv issue
> I can confirm that patch, you've suggested, fixed the issue we had. Thank you very much for your help. Michal
If you are happy with the answers you received, please read this about assigning points:
http://forums13.itrc.hp.com/service/forums/helptips.do?#28
Regards!
...JRF...