I’m running babashka (v 1.13.224, latest is .229, but not available to me yet) in FreeBSD (installed via pkg install babashka) and seeing Failed to create the main Isolate. (code 32) when running bb without any arguments. The only reference I found about this error is a 4y reddit post (https://www.reddit.com/r/AsahiLinux/comments/13xbjuc/babashka_not_working_fatal_error_failed_to_create/)
mentioning page sizes or this 2y graal issue https://github.com/oracle/graal/issues/8476
Neither of those have the same code from my error, not sure that is incorrect.
Any points on how I can debug this further?
Does the latest one work with the Linux emulation? If yes, I can try to get it bumped in pkgsrc
Possible to grab the binary from releases and trying it out?
I’m trying it out now 😉 will report in some minutes
@rahul080327 latest release .229 worked fine 👍
# ./bb
Babashka v1.13.229
Type :repl/help for help
user=>
Okay great will try getting it bumped
I think it already is 229 in ports though, just not the quarterly repo which is a matter of time i.e., not something you can influence AFAIK
I’ll use the latest repo to get that version
Ah right, we work with the maintainer to release it. Good to know the latest works
out of curiosity, any idea what was causing the error?
Did that version ever work? Something changed to break it?
I don’t think so. I upgraded and bb stopped working
my CI was very unhappy 😅
Seems like a graal thing, I can take a look a bit later but maybe @borkdude recalls something faster
We did some ffi work in that release not sure if that affects bsd page sizes somehow
Maybe figuring out which version between 224 to 229 fixed it would help me, I have limited access to a freebsd machine
I installed the latest pkg from ports and the error is still there 😕 I’m testing it on a clean jail (container) now to be sure I’m not messing something up
If this persists, can you create an issue? Will follow up there
yeah, will do 🫡
just for my information: nothing on BSD works or does something work?
Latest Binary starts up but not via the package it seems. Could be a thing in packaging maybe
by hand, did you download the linux static binary or the mostly static?
please mention the exact URL
I got it guys 🙂 the Makefile points to the wrong tarbal: https://codeberg.org/FreeBSD/freebsd-ports/src/commit/51d3c91f5ecb7e20fac6e41c1266bdc5274cc0b2/lang/babashka/Makefile#L5
it should be -linux-amd64-static.tar.gz`
then it works
codeberg:
This endpoint is seeing a high influx of requests for this repository, to preserve the availability of Codeberg your request will not be processed. Sorry for the inconvenience and please try again later.
@borkdude we do need the dynamic one right? To let ffi work?
yes, mostly-static is preferred so dlopen works
FIY: I can get to the REPL and run my scripts (no ffi) using the static version under FreeBSD 15.1; does not lunch with the non-static version currently in ports
static is musl compiled which doesn’t let you use FFI. Preferably this one should be used: https://github.com/babashka/babashka/releases/download/v1.13.229/babashka-1.13.229-linux-amd64.tar.gz
I think if an issue can be made I can work with the maintainer on it
@slack.jcpsantiago just to confirm the non static binary doesn't even launch since .224 and latest right?
Could you check whether linprocfs is mounted? I suspect the dynamic Linux binary needs /proc/self/maps to find its stack, and the static one doesn’t. On the host:
mount | grep linprocfs
If nothing shows up:
mount -t linprocfs linprocfs /compat/linux/proc
bb -e 1
(`sysrc linux_enable=YES && service linux start` also mounts it, and keeps it mounted after a reboot.)
In a jail, mount it from the host into the jail’s tree:
mount -t linprocfs linprocfs /path/to/jail/compat/linux/proc
or add this to the jail’s entry in jail.conf:
mount += "linprocfs $path/compat/linux/proc linprocfs rw 0 0";
Then run the pkg bb again.I’m almost 100% sure the above is the proper fix
it was not mounted… I thought the allow.mount.linprocfs would do more… now that it is mounted the non-static version works
I could repro it in a Github Actions with and without it
thanks guys 🤝
Would there be something that could be improved by the pkg, e.g. a warning when the linprocfs isn’t mounted?
not sure, bb is the only software using linux emulation I’m using, so I’m still learning the quirks
@slack.jcpsantiago upon further digging and chatting with the maintainer, linprocfs should be mounted by default for Linux emulation. Somehow yours didn't due to either an error or a different setup that you may have via jails or chroot. If you could let us know more on it, could help narrow it down.
interesting.. that was my assumption too 🤔 it’s possible I misunderstood how jail config works.
here is my jail.conf
interface = "lo1";
# defaults to apply to all jails
exec.clean;
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown jail";
# filesystem
mount.devfs;
devfs_ruleset=4;
enforce_statfs=1;
#securelevel=2;
#allow.mount.zfs;
#allow.mount;
# disable all the shiny things
allow.mount.nodevfs;
allow.mount.nofdescfs;
allow.mount.nolinprocfs; # disables linprocfs for all jails
allow.mount.nonullfs;
allow.mount.noprocfs;
allow.mount.notmpfs;
allow.nochflags;
# but these are always useful
allow.raw_sockets;
allow.reserved_ports;
allow.sysvipc=1;
# misc
# allow.nomlock;
# allow.noquotas;
# allow.noread_msgbuf;
# allow.noset_hostname;
# allow.nosocket_af;
# allow.nosysvipc;
# sysvmsg=disable;
# sysvsem=disable;
children.max=0;
.include "/etc/jail.conf.d/*.conf";
ci {
persist = true;
allow.mount.devfs;
allow.mount.tmpfs;
allow.mount.linprocfs; # this should override the global setting above
allow.mount.procfs;
ip4.addr = "10.0.1.18";
host.hostname = "ci.jail";
path = "/jails/ci";
mount.fstab = "/jails/ci-linprocfs.fstab"; # added yesterday after our chat
depend caddy,forgejo;
}if you’re having a public discussion I can share my details there to avoid having you as man in the middle
just let me know, happy to help in any way I can 🙂
oh and the linux emulation is turned on inside the jail’s rc.conf:
linux_enable="YES"Yeah this looks like it. I was talking to the person directly on this, maybe adding this in the bsd section on the bb readme is good enough for now. cc @borkdude