zsh-workers
 help / color / mirror / code / Atom feed
* Script interpreter path length limit (POUNDBANGLIMIT)
@ 2016-08-10 18:41 Dennis Sperlich
  2016-08-11  2:20 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Dennis Sperlich @ 2016-08-10 18:41 UTC (permalink / raw)
  To: zsh-workers

Hi,

i noticed an strange effect when calling a (python) script where the
interpreter is specified in the first line as follows:
#!/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/python/2.7.4-x86_64-slc6-gcc48/sw/lcg/external/Python/2.7.4/x86_64-slc6-gcc48-opt/bin/python

When i call this script from within zsh i get the following error:
zsh: $HOME/.local/bin/pip: bad interpreter:
/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/python/2.7: no such
file or directory

It seems like there is a arbitrary 63 character limit on the interpreter
char buffer. At least this is what i understand from the code in
Src/exec.c starting line 431.

So i'm wondering whether this is intentional and i'm not supposed to
point to interpreters with longer paths or just there due to historic
reasons? (i briefly checked, bash seems to have a limit of 79 characters
:-) )

Cheers
Dennis


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Script interpreter path length limit (POUNDBANGLIMIT)
  2016-08-10 18:41 Script interpreter path length limit (POUNDBANGLIMIT) Dennis Sperlich
@ 2016-08-11  2:20 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2016-08-11  2:20 UTC (permalink / raw)
  To: zsh-workers

On Aug 10,  8:41pm, Dennis Sperlich wrote:
}
} It seems like there is a arbitrary 63 character limit on the interpreter
} char buffer. At least this is what i understand from the code in
} Src/exec.c starting line 431.

The specific choice of 64 for the buffer size (63+nul) is historical and
loosely based on OS limitations of the 1990s.

A LOT of info about this here:

    http://www.in-ulm.de/~mascheck/various/shebang/#results

Rather lacking in very-recent OS's, but you get the idea how inconsistent
this is.  I can't find anything about a standard way to look up the limit
on the build architecture, probably because POSIX defines #! as optional.

The limit in zsh could be expanded to allow the OS to flag the error.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-11  2:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-10 18:41 Script interpreter path length limit (POUNDBANGLIMIT) Dennis Sperlich
2016-08-11  2:20 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).