Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 65880 - multithreaded clnt_call failure on RH7.2
multithreaded clnt_call failure on RH7.2
Status: CLOSED DUPLICATE of bug 65544
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i586 Linux
high Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-06-03 14:05 EDT by Konda Reddy
Modified: 2016-11-24 10:01 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-21 13:49:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
This file is a tar file and it contains the sample to reproduce the problem (110.00 KB, patch)
2002-06-03 14:07 EDT, Konda Reddy
no flags Details | Diff

  None (edit)
Description Konda Reddy 2002-06-03 14:05:46 EDT
Description of Problem:
I have a multi-threaded client, in which I create CLIENT handle in the first 
thread, and then use clnt_call() in secondary thread to access server. clnt_call
() return failure.
If the clnt_create() and clnt_call() are invoked in the same thread then 
clnt_call() returns success. 
On Linux RH7.1 there is no problem. but it's giving problem on RH7.2 (kernel 
level- 2.4.9-31 - i586). 

Version-Release number of selected component (if applicable):
Redhat 7.2

How Reproducible:
The problem is reproducible in a simple multi threaded RPC program.

I am attaching new.tar file. Just run compile script to compile the programs.
Steps to Reproduce:
1. run "compile"  - to compile the sample.
2. run "dateproc & "  - to run the RPC server
3. run "rdate hostname" - to run the client. (Hostname must be the machine name 
where the dateproc server is running.

Actual Results:
clnt_call() Returns Failure.

Expected Results:
It should return SUCCESS.

Additional Information:
Here is the results when I run the sample:
[no-view] KONDAR@tintin> dateproc &
[1] 13294
[no-view] KONDAR@tintin> rdate tintin
Before clnt_create  in main thread 
clnt_call  failed  at   date_clnt.c[22]
tintin: RPC: Can't encode arguments
time on host tintin = 1023127658
time on host tintin = Mon Jun  3 23:37:38 2002
Comment 1 Konda Reddy 2002-06-03 14:07:48 EDT
Created attachment 59405 [details]
This file is a tar file and it contains the sample to reproduce the problem
Comment 2 Jakub Jelinek 2002-06-04 05:15:37 EDT
Older glibc's didn't support multithreaded RPC properly.
In recent glibc's, each thread has its own RPC state, so you have to clnt_create
in the thread you want to use it.
Comment 3 Konda Reddy 2002-06-04 05:43:48 EDT
Hi Jakub,

Is there any alternative way to use CLIENT handle created in other threads ?

Basically, In my application I create CLIENT handle in main thread and keep on 
calling clnt_call() in secondary thread in regular interval. This is to make 
sure that the server is alive.

It would be nice if you could suggest something here. I am really stuck with 
problem :-(

Comment 4 Konda Reddy 2002-06-04 08:43:54 EDT
If that is the case, how it is working fine with RedHat 7.1 ?

My application is huge one and I am just porting it from Redhat 7.1 to 7.2 and 
I hit this problem.
Comment 5 Alan Cox 2002-12-15 15:48:43 EST

*** This bug has been marked as a duplicate of 65544 ***
Comment 6 Red Hat Bugzilla 2006-02-21 13:49:00 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.