|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
AIX threading '_r' help please |
« View previous topic :: View next topic » |
Author |
Message
|
RogerLacroix |
Posted: Wed Jan 19, 2005 10:01 am Post subject: AIX threading '_r' help please |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
A little help please,
I have a security exit that works just fine on Solaris, HP-UX & Linux but AIX is giving me great headaches.
AIX specs: AIX v5.1, WebSphere v5.3 and gcc v3.3.3
On AIX, the waidpid() function is always returning a '-1', whether the child process was successful or not. Here is a code snippet:
Code: |
pid=fork()
switch (pid)
{
case -1:
// error!!!
break;
case: 0
// child
rc = execvp(xxx, aaa);
break;
default:
// parent
wait_status = waitpid( pid, &status, 0 );
if (wait_status != -1)
// life's good
else
// error!!
break;
} |
I have both the parent and child write tons of stuff to the log file and I see the parent running fine, then the child runs fine but on AIX, waitpid() function will always return '-1'.
I created a driver program to invoke the shared module and then waitpid() works just fine on AIX.
I have compiled and linked it with '-pthread' and '-lpthread' as per IBM's own documentation on gcc & AIX:
http://www-106.ibm.com/developerworks/eserver/articles/gnu.html
But still, the waitpid() function in the security exit when driven by a queue manager returns '-1'. Ahhhhhhhhhhhhhhhhhhhhh…….
I know there were some discussions a while ago about AIX threading and the shared module having a name ending with '_r'. The '_r' is supposed to mean that the shared module is threaded. But what option or parameter, besides '-lpthread', do you specify to the linker to get it to create the '_r' shared module??????
Please help, because I have been banging my head against the wall for days and it really getting sore.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
kman |
Posted: Mon Feb 14, 2005 10:50 pm Post subject: |
|
|
Partisan
Joined: 21 Jan 2003 Posts: 309 Location: Kuala Lumpur, Malaysia
|
Roger, have you solve this?
I did not think for a moment that you would run into problems with compilation. Don't get me wrong.
I am just curious. What was the solution? If you have solved it.
Otherwise, I was thinking of the compilation options. But then you said you have followed the doc. I haven't been writing anything for a while, so I would not know for sure. I was thinking in the region of using cc_r (the _r compiler).  |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Feb 15, 2005 9:22 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
No, I still have this problem. Because I am using GCC on AIX, IBM has not been very helpful.
Although, I did get some hints about compiler options and about trying out the included AIX linker but I still have the problem.
I would love to have AIX's cc compiler but I don't, I am using GCC - hence I cannot try out cc_r.
After all of my debugging / testing, I don't think it is a threading issue but rather either MQ has either turned off signal handling for the shared library or is catching the signal itself.
Because several AIX / GCC development web sites that I have gone to state clearly that if you are using wait() or waitpid() functions then you need to code up a signal handler. i.e.
Code: |
sa.sa_handler = sigchld_handler;
sigfillset (&sa.sa_mask);
sa.sa_flags = SA_RESTART;
rc = sigaction (SIGCHLD, &sa, &osa); |
My reasoning is that if I drive the shared library from outside of MQ then it works perfectly. i.e. child is launched, signals are thrown & caught and waitpid() returns a correct value.
I would love to hear from someone who have coded MQ exits that use fork() & waitpid() on AIX.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|