question for the "base gurus"

René J.V. Bertin rjvbertin at
Wed Jan 25 23:31:29 UTC 2017

On Wednesday January 25 2017 23:53:29 Clemens Lang wrote:


> Pextlib is an extension for the Tcl interpreter. Yes, InstallCmd() is
> called by Tcl, but the way this works is that the Pextlib library is
> loaded into Tcl and registers the xinstall command, which causes Tcl to
> invoke InstallCmd() whenever the interpreter hits an xinstall.

Well yes, of course, how else would it work?

> If you compile a copy of Pextlib with address sanitizer, you'll
> immediately see memory corruption.

I presume it works through instrumenting the code being compiled, so 

> > Apparently the issue is not in Tcl or Pextlib, but in
> > getmode()/setmode(): if and when things go wrong the 775 (sic) mode
> > I'm requesting in the Portfile is translated to a mask of 0255.
> Have you considered octal vs. decimal and potentially different parsing?

Yes and what do you mean with "potentially different parsing"?

> Did you try 0755?

No, and I probably should use that mask anyway instead of 0775. It's a thought for if and when the issue comes back.
BTW, the resulting mask was 0225, not 255.
I did manage to catch the issue with a debugger attached and could thus fix the incorrect mask before it was actually used. And the incorrect mask wasn't always 0225, I saw at least 2 other values. Exactly as you'd expect for something that's not reproducible systematically.

It's also thanks to that debugging session that I finally noticed that Pextlib was using its own setmode/getmode copies.


More information about the macports-dev mailing list