For all you Mac OSX users out there...

This is kind of continuation of the [cd]
and [pwd] problem(s) I've already covered
in my last posting.

The Tcl8.4.x uses the OS-call realpath() to
figure-out the real physical path of the
file on the filesystem, stripped of all "./",
"../", constructs, symlinks and alike.

BANG: this function uses chdir/fchdir internally
which changes the process current working directory
for each invocation. It is called for just about
*every* path you pass to the Tcl library! Wow!
The funny thing: the man page does not care to
mention this *important* side-effect!

Of course, this defeats *any* multithreading code.
There is no single point like [cd] command which
mingles with the current dir; *all* path arithmetics
eventually call into the realpath() and it will
swap the current dir under your feet.

This is not the case in Solaris and/or Linux OS.
It appears to me that it only happens on Mac OSX
(aka Darwin).

First corrective measure is to define NO_REALPATH
variable on Tcl compilation time.
I have yet to figure out how to do this from the
configure step, but the quick/dirty way is to go
to the unix/tclUnixFCmd.c file and put at the very
top of the file:

#define NO_REALPATH

and recompile/reinstall the Tcl. This solves this
issue cleanly. The ultimate fix, of course, is to
modify the Darwin realpath() to behave better.

Concerning the memory trashing problems described
in my previous mail, I have made a fix and will try
to negotiate with the Tcl people to get it into
the Tcl project asap.

Cheers,
Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/

Reply via email to