ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » AIX threading '_r' help please

Post new topic  Reply to topic
 AIX threading '_r' help please « View previous topic :: View next topic » 
Author Message
RogerLacroix
PostPosted: Wed Jan 19, 2005 10:01 am    Post subject: AIX threading '_r' help please Reply with quote

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
View user's profile Send private message Visit poster's website
kman
PostPosted: Mon Feb 14, 2005 10:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
RogerLacroix
PostPosted: Tue Feb 15, 2005 9:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » AIX threading '_r' help please
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.