Since the last dozen or so nightlies, Emacs has stopped being able to run subprocesses with a PTY attached, as vfork fails with “Invalid argument”. I haven’t had the time to debug that in detail yet, but does anyone know if something changed to the fork/vfork implementation in Haiku over the past few weeks?
Looked at the git log for src/system up until last August, not much which could explain this. Maybe hrev56392 ?
If you haven’t cleaned up the previous packages, you can still boot older revisions from the boot menu, and try to pinpoint which one started to break.
That doesn’t seem to be the case. It really just started happening in the last week or so, so within the last few nightlies.
I won’t have the time to look through everything and find exactly which nightly caused it for at least the next several weeks, so if someone else knows what might be going on I’d appreciate it if he came forth with that information.
Unfortunately Emacs calls `vfork’ directly, so it can’t be related to bash_completion, as bash doesn’t even have a chance to start when the error is reported. I mentioned PTYs as Emacs calls posix_spawn when a PTY is not attached, which doesn’t fail with EINVAL.
Note that Haiku does not have a real vfork; it just invokes the regular fork (and has always done so, not a recent change.)
I don’t know of any recent changes either. Do you know what hrev you were on that last worked, and what one you are on now?
Can you run strace (maybe with some arguments needed if the fork is invoked by a thread other than the main) to see what syscall is returning that error?
Bisecting via nightly images shows the problem starting after hrev56460. I saw a warning when building emacs about the functions referenced in hrev56465 so I’m suspicious of that one.
it turns out I was wrong about when the bug rears its head; it happens when the posix_spawn codepath is used, but the error message printed by Emacs in that case is misleading (which I will fix.)
Reverting hrev56465 in my local build of Haiku fixes the problem for me. I am building from the haikuports repository so the emacs commit is a couple of weeks old. I haven’t tried the latest git master of emacs with your changes.
Right, then I guess that’s the problem. Does anyone want to submit a bug report? (If not, I’ll do it, but my time is somewhat limited.) My change was limited to fixing the build warning.