Hello all --
A user recently reported trouble killing shell buffers under xemacs
21.1.14 on irix64 6.5. The problem seems related to irix's use of 32-bit
pid's. Here's an illustration:
In the shell buffer:
% echo $$
137547967
In a lisp buffer:
(get-buffer-process (get-buffer "*shell*"))
#<process "shell" pid -128902941 state:run>
(emacs-pid)
130570717
xemacs thinks the shell process has pid -128902941, when its pid is
actually 137547967. This doesn't seem to be a simple signed/unsigned or
byte ordering issue:
137547967 = 00001000001100101101000010111111
-128902941 = 11111000010100010001100011100011
xemacs seems to understand the 32-bit pid's in general, since the output
from (emacs-pid) is valid. At least the logic seems to follow:
* from editfns.c, emacs-pid returns "make_int (getpid ())";
* from process.c, create_process uses make_int to store the pid in
the Lisp_Process structure, after getting it from PROCMETH
(create_process...), which in this case calls unix_create_process;
* from process-unix.c, the pid that unix_create_process returns is
the exact output from fork();
* both fork() and getpid() return pid_t's, which are 32-bit integers,
same as int.
So I can't figure out where this bogus pid is getting introduced! I've
tested with other xemacs versions, back to 20.4, and the problem is
always present. But there's a new twist in 21.1.14: you can't exit
xemacs gracefully. In 20.4, even if you kill your shell process by hand,
you'll get a warning when you try to exit that it's still running. But
if you ignore the warning you can exit cleanly. In 21.1.14 you get the
same warning, but if you try to ignore it and exit anyway, you get stuck
in a loop that looks like this:
really-early-error-handler((error "kill (-101159227, 1) failed:
Invalid argument"))
and there's no way out except to kill the xemacs process!
Has anyone else seen this behavior? If you need more specific diagnostic
information, I can try to provide it. Thanks in advance for any help...
--
Ron Isaacson
Morgan Stanley
ron.isaacson(a)morganstanley.com / (718) 754-2345
Show replies by date