GNU bug report logs - #30762
27.0.50; Apparent regression in process.c caused by checking pty_flag before calling setsid

Previous Next

Package: emacs;

Reported by: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>

Date: Sat, 10 Mar 2018 04:20:02 UTC

Severity: normal

Found in version 27.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

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 30762 in the body.
You can then email your comments to 30762 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#30762; Package emacs. (Sat, 10 Mar 2018 04:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Fitzsimmons <fitzsim <at> fitzsim.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 10 Mar 2018 04:20:02 GMT) Full text and rfc822 format available.

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

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: bug-gnu-emacs <at> gnu.org
Cc: Paul Eggert <eggert <at> cs.ucla.edu>
Subject: 27.0.50;
 Apparent regression in process.c caused by checking pty_flag before
 calling setsid
Date: Fri, 09 Mar 2018 23:18:51 -0500
Hi,

On x86_64, CentOS 7.3.1611, I noticed that on master tip (I tested
461e6818...), eudc-expand-inline was hanging.  It calls the ldapsearch
command line utility (by way of ldap-search-internal) using
start-process, and waits for a password prompt:

  (let* ((process-connection-type nil)
	 (proc-args (append arglist ldap-ldapsearch-args
			    filter))
	 (proc (apply #'start-process "ldapsearch" buf
		      ldap-ldapsearch-prog
		      proc-args)))
    (while (null (progn
		   (goto-char (point-min))
		   (re-search-forward
		    ldap-ldapsearch-password-prompt-regexp
		    (point-max) t)))
      (accept-process-output proc 1))
      [...])

master tip gets stuck in that while loop, whereas Emacs 25.1 is fine.

If I print the contents of the buffer within the loop, it shows:

Process ldapsearch stopped (tty output)

I isolated the working-to-non-working transition to this commit:

commit 8e5a769965313a7a1c42b5992ed24e8b0ea71ead
Author: Paul Eggert <eggert <at> cs.ucla.edu>
Date:   Tue Dec 6 23:41:45 2016 -0800

    Clean out some IRIX cruft
    
    * etc/MACHINES: Remove obsolete discussion of IRIX.
    * src/process.c (allocate_pty) [__sgi]: Remove SGI-specific code.
    (create_process) [HAVE_PTYS]: Don't worry about IRIX.
    * src/syntax.c (scan_sexps_forward): Remove obsolete comment.
    * src/unexelf.c [__sgi]: Don't include <syms.h>.
    (unexec) [__sgi]: Remove SGI-specific code.

and specifically the addition of this check in src/process.c:

-      /* We tried doing setsid only if pty_flag, but it caused
-	 process_set_signal to fail on SGI when using a pipe.  */
-      setsid ();
+      if (pty_flag)
+	setsid ();

If I remove the if (pty_flag) line, then eudc-expand-inline works again.

It may be that ldap-search-internal should change how it's invoking
ldapsearch, but I thought I would report the change in process.c
behavior anyway.

Thomas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30762; Package emacs. (Sat, 10 Mar 2018 08:37:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: 30762 <at> debbugs.gnu.org, eggert <at> cs.ucla.edu
Subject: Re: bug#30762: 27.0.50;
 Apparent regression in process.c caused by checking pty_flag before
 calling setsid
Date: Sat, 10 Mar 2018 10:36:15 +0200
> From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
> Date: Fri, 09 Mar 2018 23:18:51 -0500
> Cc: Paul Eggert <eggert <at> cs.ucla.edu>
> 
> master tip gets stuck in that while loop, whereas Emacs 25.1 is fine.
> 
> If I print the contents of the buffer within the loop, it shows:
> 
> Process ldapsearch stopped (tty output)
> 
> I isolated the working-to-non-working transition to this commit:
> 
> commit 8e5a769965313a7a1c42b5992ed24e8b0ea71ead
> Author: Paul Eggert <eggert <at> cs.ucla.edu>
> Date:   Tue Dec 6 23:41:45 2016 -0800
> 
>     Clean out some IRIX cruft
>     
>     * etc/MACHINES: Remove obsolete discussion of IRIX.
>     * src/process.c (allocate_pty) [__sgi]: Remove SGI-specific code.
>     (create_process) [HAVE_PTYS]: Don't worry about IRIX.
>     * src/syntax.c (scan_sexps_forward): Remove obsolete comment.
>     * src/unexelf.c [__sgi]: Don't include <syms.h>.
>     (unexec) [__sgi]: Remove SGI-specific code.
> 
> and specifically the addition of this check in src/process.c:
> 
> -      /* We tried doing setsid only if pty_flag, but it caused
> -	 process_set_signal to fail on SGI when using a pipe.  */
> -      setsid ();
> +      if (pty_flag)
> +	setsid ();
> 
> If I remove the if (pty_flag) line, then eudc-expand-inline works again.

This change is on the emacs-26 branch as well, so if we want to
restore previous code, we should do it on emacs-26, not only on
master.

Thanks.




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sun, 11 Mar 2018 02:34:01 GMT) Full text and rfc822 format available.

Notification sent to Thomas Fitzsimmons <fitzsim <at> fitzsim.org>:
bug acknowledged by developer. (Sun, 11 Mar 2018 02:34:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
Cc: 30762-done <at> debbugs.gnu.org
Subject: Re: bug#30762: 27.0.50; Apparent regression in process.c caused by
 checking pty_flag before calling setsid
Date: Sat, 10 Mar 2018 18:33:05 -0800
Eli Zaretskii wrote:
> This change is on the emacs-26 branch as well, so if we want to
> restore previous code, we should do it on emacs-26, not only on
> master.

I installed the fix into emacs-26 and merged it into master. Thanks, Thomas, for 
reporting it and for tracking down the fix.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 08 Apr 2018 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 78 days ago.

Previous Next


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