[ 
https://issues.apache.org/jira/browse/AXIS2C-1663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18053160#comment-18053160
 ] 

Robert Lazarski commented on AXIS2C-1663:
-----------------------------------------

Tagging this for possible inclusion into 2.0.1. 

fix requires rewriting dir_select() and the   
  scandir pattern (or adding synchronization), it's non-trivial work.

  1. Use opendir/readdir with absolute paths - Eliminate chdir by       
  building full paths for stat calls. Most robust fix.                  
  2. Use fstatat() with dirfd - Open directory with opendir(), get fd   
  with dirfd(), use fstatat(fd, name, ...) instead of stat().           
  POSIX-compliant, avoids chdir.                                        
  3. Add mutex - Quick fix: wrap the getcwd/chdir/scandir/chdir sequence
   in a mutex. Simple but adds locking overhead.                        
  4. Document as not thread-safe - Mark function as single-threaded     
  only.   

> Race condition in axutil_dir_handler_list_service_or_module_dirs
> ----------------------------------------------------------------
>
>                 Key: AXIS2C-1663
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1663
>             Project: Axis2-C
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: mehturt
>            Priority: Major
>             Fix For: 2.0.1
>
>
> I'm calling a web service from multiple threads using the sample code 
> provided (axis2_svc_client_send_receive). When the web service is invoked in 
> parallel in multiple threads, the current working directory of the process 
> changes.  I was able to track this down and I think the problem is in 
> function axutil_dir_handler_list_service_or_module_dirs() which performs 
> getcwd and then changes directory to somewhere and back.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to