jart / cosmopolitan

build-once run-anywhere c library
ISC License
17.81k stars 610 forks source link

Issue with APE on OpenBSD 7.5 (current) #1263

Open G4Vi opened 1 month ago

G4Vi commented 1 month ago

Maybe this an issue with APE on OpenBSD 7.5 (current) in general? I just tried running the latest RedBean server on my box and got a nearly identical error:

.ape[24517]: pinsyscalls addr 200417 code 33, pinoff 0xffffffff (pin 0 0-0 0) (libcpin 0 0-0 0) error 78

Originally posted by @neezer in https://github.com/jart/cosmopolitan/discussions/1250#discussioncomment-10269614

neezer commented 4 weeks ago

Here's what I see on OpenBSD 7.6 (-current):

eos% curl -LO https://redbean.dev/redbean-2.2.com
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2260k  100 2260k    0     0   941k      0  0:00:02  0:00:02 --:--:--  942k
eos% chmod u+x redbean-2.2.com
eos% ./redbean-2.2.com -v
./redbean-2.2.com[2]: syntax error: `zero byte' unexpected
jart commented 4 weeks ago

I hope there's a workaround for the system call pinning thing in 7.5. As for the /bin/sh change (you are using /bin/sh right?) in 7.6 we're going to need to send them a patch that makes their zero byte check consistent with FreeBSD's per POSIX rules.

neezer commented 4 weeks ago

you are using /bin/sh right?

Yup. Get the same thing in zsh too, fwiw.

jart commented 4 weeks ago

What version of zsh? I patched it in zsh 5.9 https://github.com/zsh-users/zsh/commit/326d9c203b3980c0f841bc62b06e37134c6e51ea

neezer commented 4 weeks ago

zsh-5.9p0, installed via pkg_add zsh.

jart commented 4 weeks ago

Could you check if the OpenBSD developers patched it?

neezer commented 4 weeks ago

Could you check if the OpenBSD developers patched it?

I think not?

I'm no expert here, but I believe the official package is built from here (based on reading Solène's article), and none of those patches look like they undo your earlier work. I think distfile refers to the latest zsh-5.9 asset, and downloading and inspecting that reveals your change is still there in Src/exec.c.

I sent pea@ (listed as the package maintainer) an email asking for clarification.

neezer commented 3 weeks ago

@jart Haven't heard back from pea@ yet about this, FYI. Anything else I can look to help debug this?