Thanks to Kalrish i can now build tup in windows with mingw toolchain. I 
debugged this problem further  and sure enough it is the chdir and getcwd 
calls that are the source of problems.

>From msdn (i presume chdir internally calls SetCurrentDirectory):

Multithreaded applications and shared library code should not use the 
> GetCurrentDirectory function and should avoid using relative path names. 
> The current directory state written by the SetCurrentDirectory function is 
> stored as a global variable in each process, therefore multithreaded 
> applications cannot reliably use this value without possible data 
> corruption from other threads that may also be reading or setting this 
> value. This limitation also applies to the SetCurrentDirectoryand 
> GetFullPathName functions. The exception being when the application is 
> guaranteed to be running in a single thread, for example parsing file names 
> from the command line argument string in the main thread prior to creating 
> any additional threads. Using relative path names in multithreaded 
> applications or shared library code can yield unpredictable results and is 
> not supported.


I have a fix that removes calls to fchdir or chdir (except in initial scan) 
in tup source code, passing around absolute paths only, to get rid of these 
aborts in windows.  There are other minor changes as well.

http://www.github.com/svark/tup is forked off kalrish's 
<https://github.com/kalrish/tup>repo.

Thanks,
Arun


On Thursday, June 8, 2017 at 12:37:55 PM UTC+5:30, arun.s wrote:
>
> I keep running into these two errors when running tup on windows in multi 
> threaded mode. 
>
>
> *>tup error: Unable to open directory for update work.*
>
>
>
> *>chdir: No such file or directory*
> *>tup error: Failed to fchdir in a compat wrapper function.*
>
> I use tup v0.7.3-60-gd3bfa7c but I have encountered this in v0.7.5.
> I use 0.7.3.* because it allows me to ignore PDB files.
>
> Has anyone else encountered these. It is difficult to reproduce this.  But 
> i face this very often to be frustrated by them.
> More the threads more the chances of these aborts. Does anyone know of any 
> workarounds?
>
> I reduced the chances of these aborts earlier on by creating the generated 
> directories myself before building but these errors persist.
>
>
> Thanks,
> Arun
>
>
>
>
>

-- 
-- 
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to