GNU bug report logs - #12040
24.1.50; `term' hangs on FreeBSD 10.0-CURRENT without pty(4)

Previous Next

Package: emacs;

Reported by: Jan Beich <jbeich <at> tormail.org>

Date: Tue, 24 Jul 2012 02:09:02 UTC

Severity: important

Tags: patch

Found in version 24.1.50

Fixed in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12040 in the body.
You can then email your comments to 12040 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12040; Package emacs. (Tue, 24 Jul 2012 02:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Beich <jbeich <at> tormail.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 24 Jul 2012 02:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jan Beich <jbeich <at> tormail.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.1.50; `term' hangs on FreeBSD 10.0-CURRENT without pty(4)
Date: Mon, 23 Jul 2012 23:31:27 +1200
[Message part 1 (text/plain, inline)]
Starting with FreeBSD 8.0-RELEASE the system uses new tty layer that no
longer supports old style pseudo ttys *unless* pty(4) kernel module is
loaded. However, pty(4) device is still included in GENERIC kernel on
all releases except 10.0-CURRENT (removed in r233271).

  $ emacs -Q
  M-x term
  <hangs here>

  $ sudo kldload pty
  [try again]

A few ways to solve this:
- use openpty() in -lutil like darwin
- add use posix_openpt() support

http://svn.freebsd.org/changeset/base/233271
https://pub.allbsd.org/FreeBSD-snapshots/ # for testing, seems to be down atm

[openpty.diff (text/x-patch, attachment)]
[posix_openpt.diff (text/x-patch, attachment)]

Severity set to 'important' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 15 Aug 2012 17:14:02 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 15 Aug 2012 17:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12040; Package emacs. (Thu, 16 Aug 2012 06:55:01 GMT) Full text and rfc822 format available.

Message #12 received at 12040 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jan Beich <jbeich <at> tormail.org>
Cc: 12040 <at> debbugs.gnu.org
Subject: Re: bug#12040: 24.1.50;
	`term' hangs on FreeBSD 10.0-CURRENT without pty(4)
Date: Thu, 16 Aug 2012 02:45:30 -0400
Jan Beich wrote:

> A few ways to solve this:
> - use openpty() in -lutil like darwin
> - add use posix_openpt() support

Thanks for the patches.
Do you (or anyone else) have a feeling for which is the best?
As written the posix_openpt one changes the behaviour on gnu-linux
platforms to use posix_openpt instead of getpt.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12040; Package emacs. (Thu, 16 Aug 2012 10:22:01 GMT) Full text and rfc822 format available.

Message #15 received at 12040 <at> debbugs.gnu.org (full text, mbox):

From: Jan Beich <jbeich <at> tormail.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 12040 <at> debbugs.gnu.org, Robert Millan <rmh <at> freebsd.org>
Subject: Re: bug#12040: 24.1.50;
	`term' hangs on FreeBSD 10.0-CURRENT without pty(4)
Date: Thu, 16 Aug 2012 05:10:03 -0500
(cc'ing Robert in case I misread glibc code)

Glenn Morris <rgm <at> gnu.org> writes:

> Jan Beich wrote:
>
>> A few ways to solve this:
>> - use openpty() in -lutil like darwin
>> - add use posix_openpt() support
>
> Thanks for the patches.
> Do you (or anyone else) have a feeling for which is the best?

I'd go with less wrappers - posix_openpt(). And also use it on netbsd,
dragonfly and probably darwin.

openpty() is implemented via posix_openpt() in libutil on recent freebsd.

posix_openpt() is a syscall on (k)freebsd. And /dev/ptmx only exists if
pty(4) is loaded, not sure how it affects binaries under linuxulator.

> As written the posix_openpt one changes the behaviour on gnu-linux
> platforms to use posix_openpt instead of getpt.

In glibc/linux case getpt() is implemented via posix_openpt():

  // sysdeps/unix/sysv/linux/getpt.c
  int
  __getpt (void)
  {
    int fd = __posix_openpt (O_RDWR);
    if (fd == -1)
      fd = __bsd_getpt ();
    return fd;
  }

In glibc/kfreebsd case getpt() iterates over /dev/ptyXX which won't work
without pty(4) in kernel.




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Fri, 17 Aug 2012 07:31:02 GMT) Full text and rfc822 format available.

Notification sent to Jan Beich <jbeich <at> tormail.org>:
bug acknowledged by developer. (Fri, 17 Aug 2012 07:31:02 GMT) Full text and rfc822 format available.

Message #20 received at 12040-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 12040-done <at> debbugs.gnu.org
Subject: Re: bug#12040: 24.1.50;
	`term' hangs on FreeBSD 10.0-CURRENT without pty(4)
Date: Fri, 17 Aug 2012 03:21:49 -0400
Version: 24.3

Thanks, I'm convinced. I installed the posix_openpt change for freebsd
and netbsd to the trunk, currently expected to be released as 24.3. I
left darwin alone for the time being.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 14 Sep 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.