Roman Neuhauser a écrit :
Hello,

I'm having trouble with nekoml on FreeBSD 9.0-CURRENT.

nekoml runs fine from my usual interactive shell (zsh), but fails
with "Uncaught exception - load.c(176): Module not found : ..." when
run from /bin/sh.  I've run into this behavior trying to build hss
(http://www.ncannasse.fr/projects/hss): the first thing done by the
Makefile is "nekoml hss/*.nml" which fails with the above error,
indicating Ast.nml (the first file in the expansion of the glob
pattern).

I've tried to pinpoint the source of the problem.  Grepping through
the neko sources didn't reveal anything obvious, so I wrote a trivial
execve(2) wrapper, and it reproduces the behavior:
[...]
The environment is the same in my interactive shell and the wrapper.
Maybe nekoml does something out-of-ordinary with file descriptors?
I'm out of my league here.

nekoml is actually the neko binary on which we append the nekoml compiler bytecode. So such bootable binaries need to be able to open themself to check if there is bytecode at the end of the file.

This is done by neko/vm/main.c(executable_path) which reads /proc/self/exe, and if not found use the "_" environment variable. It seems that in some cases both fail to give /usr/bin/nekoml on FreeBSD.

If you know any good way to easily know the current executable path on *BSD (and not the calling executable path) I'm open for patches. Both windows and OSX have OS-specific functions already.

Best,
Nicolas

--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to