You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2003/11/03 15:08:45 UTC

Re: svn commit: rev 7609 - in trunk/subversion: clients/cmdline include libsvn_client libsvn_subr

striker@tigris.org writes:

> Author: striker
> Date: Sun Nov  2 15:19:37 2003
> New Revision: 7609
>
> Modified:
>    trunk/subversion/clients/cmdline/propedit-cmd.c
>    trunk/subversion/clients/cmdline/util.c
>    trunk/subversion/include/svn_io.h
>    trunk/subversion/libsvn_client/blame.c
>    trunk/subversion/libsvn_client/cat.c
>    trunk/subversion/libsvn_client/ra.c
>    trunk/subversion/libsvn_client/repos_diff.c
>    trunk/subversion/libsvn_subr/io.c
> Log:
> Fix a large chunk of issue #929.
>
> * subversion/include/svn_io.h
>
>   (svn_io_temp_dir): New.  Temporary duplicate the implementation
>     that is in APR, since APR 0.9.5 has a broken apr_temp_dir_get().

Is this really the implementation used in APR?  It's not thread safe,
it could return a path that is totally invalid if one thread copies
the global cached path while another thread is writing into the cache.

On the Subversion front svn_io_temp_dir should return a path that has
been svn_path_canonicalized, at present using TEMPDIR="." or
TEMPDIR="/home/philip/" fails.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 7609 - in trunk/subversion: clients/cmdline include libsvn_client libsvn_subr

Posted by "C. Michael Pilato" <cm...@collab.net>.
Branko Čibej <br...@xbc.nu> writes:

> How do you propagate environment changes to a running process?
> (I mean on broken systems such as Unix; Windows knows how to do that,.of
> course. :-p )

Windows was what I was thinking about.  But heh, I've never actually
thought about the differences between Windows and Unix in that respect!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: svn commit: rev 7609 - in trunk/subversion: clients/cmdline include libsvn_client libsvn_subr

Posted by Branko Čibej <br...@xbc.nu>.
C. Michael Pilato wrote:

>Philip Martin <ph...@codematters.co.uk> writes:
>
>  
>
>>Is this really the implementation used in APR?  It's not thread safe,
>>it could return a path that is totally invalid if one thread copies
>>the global cached path while another thread is writing into the cache.
>>    
>>
>
>Yeah, Sander's already gotten a couple of responses along this line.
>The idea of having a global cache was in my original proposal, but I
>never figured out how to do it safely.  Now, I feel like the cache
>should be tossed out, for the thread-safety issue already mentioned,
>but also because the library can be long-lived (think Subversion GUI),
>and changes to things like a user's %TEMP% environment variable should
>be immediately reflected the in temp-directory search algorithm.
>  
>
How do you propagate environment changes to a running process?
(I mean on broken systems such as Unix; Windows knows how to do that,.of
course. :-p )


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 7609 - in trunk/subversion: clients/cmdline include libsvn_client libsvn_subr

Posted by "C. Michael Pilato" <cm...@collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:

> Is this really the implementation used in APR?  It's not thread safe,
> it could return a path that is totally invalid if one thread copies
> the global cached path while another thread is writing into the cache.

Yeah, Sander's already gotten a couple of responses along this line.
The idea of having a global cache was in my original proposal, but I
never figured out how to do it safely.  Now, I feel like the cache
should be tossed out, for the thread-safety issue already mentioned,
but also because the library can be long-lived (think Subversion GUI),
and changes to things like a user's %TEMP% environment variable should
be immediately reflected the in temp-directory search algorithm.

> On the Subversion front svn_io_temp_dir should return a path that has
> been svn_path_canonicalized, at present using TEMPDIR="." or
> TEMPDIR="/home/philip/" fails.

Ooh!  That another interesting data point.  Thanks, Philip.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: svn commit: rev 7609 - in trunk/subversion: clients/cmdline include libsvn_client libsvn_subr

Posted by Sander Striker <st...@apache.org>.
> From: Philip Martin [mailto:philip@codematters.co.uk]
> Sent: Monday, November 03, 2003 4:09 PM

> >   (svn_io_temp_dir): New.  Temporary duplicate the implementation
> >     that is in APR, since APR 0.9.5 has a broken apr_temp_dir_get().
> 
> Is this really the implementation used in APR?  It's not thread safe,
> it could return a path that is totally invalid if one thread copies
> the global cached path while another thread is writing into the cache.

Correct.  This needs a fix, quite possibly by not caching.
 
> On the Subversion front svn_io_temp_dir should return a path that has
> been svn_path_canonicalized, at present using TEMPDIR="." or
> TEMPDIR="/home/philip/" fails.

Ah, right.  Thanks.


Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org