question for the "base gurus"

Clemens Lang cal at
Wed Jan 25 22:53:29 UTC 2017


On Wed, Jan 25, 2017 at 12:53:25AM +0100, René J.V. Bertin wrote:
> > The only difference in MacPorts behavior I would expect here is the
> > check whether output is to a terminal.
> Between the 2 commands above? Indeed, but there must be subtle
> differences in the overall context. Strace inserts code to replace
> standard library functions with wrappers that generate trace output,

No, that's not how strace works. It uses ptrace(2).

> > If that's something you suspect, I recommend you compile a copy of
> > Pextlib with address sanitizer. Since Pextlib is probably
> > dlopen(3)'d by
> Actually, I wasn't thinking about Pextlib here, because InstallCmd()
> is apparently called directly from the Tcl interpreter. I could use
> gcc's sanitiser on Tcl itself, of course.

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.

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

> But I had another episode well after I posted my question, which
> allowed me to run the process through valgrind and got me a bit
> further after I made the xinstall -v option activate a verbose mode.
> 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?
Did you try 0755?

> I take it there's less interest in the part that makes the -v option
> turn on verbose mode?

Yes. I don't think we have a use case for verbose installing.
Installation just needs to work correctly, and debugging code shouldn't
be committed.


More information about the macports-dev mailing list