Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
Enrico Scholz <enrico.scholz(a)wirtschaft.tu-chemnitz.de>
writes:
>
> Is this a documented behaviour or just a bug?
It is a bug. Probably some weird configure failure or glibc 2.1
changed the signal semantics again. Does config.h look reasonable?
(At first I thought it might be the new vfork() stuff in the 2.2
kernels but Fcall_process_internal uses a normal fork.)
No, the normal fork() will be used. I have done some analysis, but can
not provide a patch:
1. The problems occurs in the X11-mode only. Under "xemacs -nw"
"call-process" works like expected.
2. The backtrace is
--------------------------------
#0 0x40491ef4 in __libc_read ()
#1 0x8647b50 in ?? ()
#2 0x80d5af3 in read_allowing_quit (fildes=13, buf=0x8647b78, size=512) at fileio.c:293
#3 0x8120f1a in filedesc_reader (stream=0x8647b08, data=0x8647b78 "h¯M@h¯M@",
size=512)
at lstream.c:931
#4 0x81202e0 in Lstream_raw_read (lstr=0x8647b08, buffer=0x8647b78 "h¯M@h¯M@",
size=512)
at lstream.c:509
#5 0x8120399 in Lstream_read_more (lstr=0x8647b08) at lstream.c:527
#6 0x81204f5 in Lstream_read (lstr=0x8647b08, data=0xbfffb000, size=16384) at
lstream.c:571
#7 0x806918a in Fcall_process_internal (nargs=5, args=0xbffff15c) at callproc.c:453
#8 0x808f6e6 in Ffuncall (nargs=6, args=0xbffff158) at eval.c:3206
--------------------------------
3. libc_read(), called by sys_read_1() in sysdep.c (the #1 above), gets
in the console-mode a SIGINT signal but in the X11-mode not. strace
says under X11:
....
access("/bin/sleep", X_OK) = 0
open("/dev/null", O_RDONLY) = 11
pipe([12, 13]) = 0
fork() = 567
close(13) = 0
close(11) = 0
close(13) = -1 EBADF (Bad file descriptor)
lseek(12, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
read(12, "",
[.... now it stops ....]
512)
--- SIGCHLD (Der Kind-Prozeß ist beendet) ---
and at the console:
....
access("/bin/sleep", X_OK) = 0
open("/dev/null", O_RDONLY) = 10
pipe([11, 12]) = 0
fork() = 627
close(12) = 0
close(10) = 0
close(12) = -1 EBADF (Bad file descriptor)
lseek(11, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
read(11, 0x850c960, 512) = ? ERESTARTSYS (To be restarted)
--- SIGINT (Unterbrechung) ---
write(9, "\0", 1) = 1
sigreturn() = ? (mask now [])
kill(-627, SIGINT) = 0
write(1, "\33[37;1HWaiting for process to "..., 82) = 82
wait4(627, [WIFSIGNALED(s) && WTERMSIG(s) == SIGINT], 0, NULL) = 627
--- SIGCHLD (Der Kind-Prozeß ist beendet) ---
4. The console-xemacs calls a lot of ioctl's setting the SIGINT
character. This calls are missing under X11 naturally.
I am not very familiarly with the internal xemacs structures and
process-flows, but I hope this mail helps a little bit.
Enrico
--
eMail: enrico.scholz(a)wirtschaft.tu-chemnitz.de
talk: ensc(a)ultra.csn.tu-chemnitz.de