From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: segfault when using XIM with multi-tty on gnu/linux Date: Sat, 13 Dec 2008 09:46:23 -0500 Message-ID: <87vdto5e0w.fsf@cyd.mit.edu> References: <87abb0bow8.fsf@cyd.mit.edu> <29ba8f210812130303x4110cf29j2be1387e606afee3@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1229179596 25553 80.91.229.12 (13 Dec 2008 14:46:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Dec 2008 14:46:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Zsitvai_J=C3=A1nos?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 13 15:47:40 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LBVmN-0005hw-3D for ged-emacs-devel@m.gmane.org; Sat, 13 Dec 2008 15:47:39 +0100 Original-Received: from localhost ([127.0.0.1]:41018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBVlB-0005gJ-IF for ged-emacs-devel@m.gmane.org; Sat, 13 Dec 2008 09:46:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBVl7-0005gE-24 for emacs-devel@gnu.org; Sat, 13 Dec 2008 09:46:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBVl4-0005fy-Hh for emacs-devel@gnu.org; Sat, 13 Dec 2008 09:46:19 -0500 Original-Received: from [199.232.76.173] (port=52920 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBVl4-0005fv-BN for emacs-devel@gnu.org; Sat, 13 Dec 2008 09:46:18 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]:58323) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBVl4-00079P-9p for emacs-devel@gnu.org; Sat, 13 Dec 2008 09:46:18 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 76F5957E196; Sat, 13 Dec 2008 09:46:24 -0500 (EST) In-Reply-To: <29ba8f210812130303x4110cf29j2be1387e606afee3@mail.gmail.com> ("Zsitvai =?utf-8?Q?J=C3=A1nos=22's?= message of "Sat, 13 Dec 2008 12:03:28 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:106874 Archived-At: "Zsitvai J=C3=A1nos" writes: >> I can't reproduce this bug, even now that Emacs calls XCloseIM. Do you >> still see the segfault? > > Yes, it's happening again. I have attached a backtrace of it. One > workaround is to unset XMODIFIERS before starting emacs. > > With XMODIFIERS=3D@im=3DSCIM set, for me, the procedure to reproduce > differs a bit from above: > 5. start X11-capable emacs frame with emacsclient -c again > 6. close the X11 emacs frame > 7. segfault Does the following patch change anything? If not, could you run Emacs under a debugger with breakpoints at xim_close_dpy and xim_destroy_callback? Is xim_destroy_callback called during frame deletion? If not, could you verify that XIMClose is called by Emacs exactly once per frame deletion? *** trunk/src/xterm.c.~1.1016.~ 2008-12-13 09:39:37.000000000 -0500 --- trunk/src/xterm.c 2008-12-13 09:42:20.000000000 -0500 *************** *** 8324,8330 **** xfree (dpyinfo->xim_callback_data->resource_name); xfree (dpyinfo->xim_callback_data); #endif /* HAVE_X11R6_XIM */ ! if (dpyinfo->display) XCloseIM (dpyinfo->xim); dpyinfo->xim =3D NULL; XFree (dpyinfo->xim_styles); --- 8324,8330 ---- xfree (dpyinfo->xim_callback_data->resource_name); xfree (dpyinfo->xim_callback_data); #endif /* HAVE_X11R6_XIM */ ! if (dpyinfo->display && dpyinfo->xim) XCloseIM (dpyinfo->xim); dpyinfo->xim =3D NULL; XFree (dpyinfo->xim_styles);