GNOME Bugzilla – Bug 759346
vte calls posix_openpt with invalid arguments
Last modified: 2015-12-14 18:07:50 UTC
In src/pty.cc, function _vte_pty_open_posix, posix_openpt is always called with O_RDWR, O_NOCTTY, O_NONBLOCK, but POSIX standard only allows O_RDWR and O_NOCTTY. This causes the call to fail on FreeBSD because an invalid flag (O_NONBLOCK) is used. I think most *BSD support posix_openpt, as we can find in man pages: https://www.freebsd.org/cgi/man.cgi?query=posix_openpt&sektion=2&format=html https://www.dragonflybsd.org/cgi/web-man?command=posix_openpt§ion=3 https://man.netbsd.org/7.0/usr/share/man/html3/posix_openpt.html http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/posix_openpt.3 This means vte uses posix_openpt instead of openpty on *BSD. Hurd has a non-working posix_openpt function that returns 'function not implemented', so I think openpty support is still needed although the check in configure.ac may need to be modified to work on Hurd.
According to bug 670758, at least openbsd doesn't/didn't implement posix_openpt. If that's not try anymore, and all the still-developed BSDs work with the posix_openpt path, we should remove the openpty() path. I added a fallback to apply the NONBLOCK afterwards if posix_openpt with it fails with EINVAL. Can you please check if master now works for you?
(In reply to Christian Persch from comment #1) > According to bug 670758, at least openbsd doesn't/didn't implement > posix_openpt. If that's not try anymore, and all the still-developed BSDs > work with the posix_openpt path, we should remove the openpty() path. Since then, posix_openpt(3) has been implemented in OpenBSD fwiw.
I can run vte-2.91 now, but it shows 'JITing regex failed: bad JIT option' when searching text. I have pcre2 10.20 installed.
That's because your pcre2 doesn't support JIT. I've silenced this warning now. I removed the openpty codepath, would be good if everyone could test their BSD variant to verify :-)
--enable-jit is used when running configure for pcre2. Are there other options required?
That should be sufficient. What does $ pcre2test -C say about Just-in-time compiler support?
I found I had pcre2 installed by jhbuild, which didn't enable JIT. After running 'jhbuild uninstall pcre2', vte-2.91 uses pcre2 installed from FreeBSD ports and the warning is fixed now.