fork & gtk-perk = nono
- From: Kenneth Albanowski <kjahds kjahds com>
- To: gtk-list redhat com
- Subject: fork & gtk-perk = nono
- Date: Sun, 6 Sep 1998 17:27:09 -0400 (EDT)
I'm forwarding this to the list for Marc Lehmann. He's noted that forking
from within Gtk/Perl does not work very well. I'm not enough of an expert
in X to know for sure whether this is a fundamental X glitch, a Gtk
limitation, or just a bug.
--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
---------- Forwarded message ----------
Date: Sun, 6 Sep 1998 22:48:43 +0200
From: Marc Lehmann <pcg@goof.com>
To: kjahds@kjahds.com
Subject: [gtk-list-request@redhat.com: Re: fork & gtk-perk = nono]
I tried to "fork" in a perl program while using the perl Gtk module
(compiled with support for gdkimlib). After the child process exits,
the parent either dies with broken pipe or segfaults.
It seems the child process takes the connection to the server down.
The problem is severe in perl, as a simple "use Gtk" (i.e. without
initializing the library) already has the effect of rendering
fork unusable.
I'm not on the list, please include me in a Cc: when replying thanks.
versions used:
Gtk-0.3 --with-imlib (slightly patched)
gtk+ Sep 5
imlib Sep 4
----- Forwarded message -----
Sender: Marc Lehmann <pcg@goof.com>
On Sat, 5 Sep 1998, Marc Lehmann wrote:
>
> try this:
>
> ---------------------------------------------------------------------
> use Gtk;
>
> fork || exit;
>
> sleep 1;
> ---------------------------------------------------------------------
>
> Gives me:
> Gdk-Message:
> ** ERROR **: sigpipe caught
> [Exit 1]
>
> Remove the fork and everything is fine. Whenever a subprocess terminates,
> the parent process either segfaults or gives another Gdk message. Here's an
> excerpt from strace:
>
> fork() = 1038
> [pid 1037] time([904962734]) = 904962734
> [pid 1037] nanosleep(0xbffff698, 0xbffff698, 0x4012b530, 0xbffff698, 0xbffff6d8 <unfinished ...>
> [pid 1038] getpid() = 1038
> [pid 1038] SYS_175(0x2, 0xbffff6f8, 0, 0x8, 0x54) = 0
> [pid 1038] write(4, "f\2\3\0\200\0\0\0\1\0\0\0<\0\2\0"..., 32) = 32
> [pid 1038] read(4, "\1\2&\0\0\0\0\0\2\0\300\2\234\\^"..., 32) = 32
> [pid 1038] shutdown(4, 2 /* send and receive */) = 0
> [pid 1038] close(4) = 0
> [pid 1038] _exit(0) = ?
> <... nanosleep resumed> ) = -1 EINTR (Interrupted system call)
> --- SIGCHLD (Child exited) ---
> time([904962734]) = 904962734
> SYS_175(0x2, 0xbffff6f8, 0, 0x8, 0x4) = 0
> write(4, "f\2\3\0\200\0\0\0\1\0\0\0<\0\2\0"..., 32) = -1 EPIPE (Broken pipe)
> --- SIGPIPE (Broken pipe) ---
>
> the child process closes the display connection (?). a workaround is
> exec "/bin/true" to end the subprocess.
>
> Maybe its a bug in Gdk, maybe its a "bug" in Gtk(perl), maybe
> its an unfortunate side-effect, in either case, it kills "fork".
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@goof.com |e|
-=====/_/_//_/\_,_/ /_/\_\ --+
The choice of a GNU generation |
|
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]