From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "d.henman" Newsgroups: gmane.emacs.devel Subject: cygwin emacs gtk2 problem fix Date: Mon, 07 Jul 2008 09:32:08 +0900 Message-ID: <20080707093208.3952@blackhawk> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1215390743 22545 80.91.229.12 (7 Jul 2008 00:32:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Jul 2008 00:32:23 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 07 02:33:08 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 1KFefC-0002qN-AB for ged-emacs-devel@m.gmane.org; Mon, 07 Jul 2008 02:33:06 +0200 Original-Received: from localhost ([127.0.0.1]:40534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KFeeK-0001b4-IS for ged-emacs-devel@m.gmane.org; Sun, 06 Jul 2008 20:32:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KFeeF-0001Z3-Oj for emacs-devel@gnu.org; Sun, 06 Jul 2008 20:32:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KFeeD-0001Vi-LC for emacs-devel@gnu.org; Sun, 06 Jul 2008 20:32:06 -0400 Original-Received: from [199.232.76.173] (port=39283 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KFeeD-0001VL-FX for emacs-devel@gnu.org; Sun, 06 Jul 2008 20:32:05 -0400 Original-Received: from mail1.asahi-net.or.jp ([202.224.39.197]:14005 helo=mail.asahi-net.or.jp) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KFeeC-0005t1-VK for emacs-devel@gnu.org; Sun, 06 Jul 2008 20:32:05 -0400 Original-Received: from blackhawk (p051062.dynamic.ppp.asahi-net.or.jp [221.113.51.62]) by mail.asahi-net.or.jp (Postfix) with ESMTP id E904F2A80E for ; Mon, 7 Jul 2008 09:32:02 +0900 (JST) Original-cc: X-Mailer: MH-E 8.0.3+cvs; GNU Mailutils 1.9.90; GNU Emacs 23.0.60 X-detected-kernel: 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:100400 Archived-At: I have found a simple fix to for the cygwin emacs gtk2 problem, as mentioned in the etc/PROBLEM file. I do not have, the proper status to change the cvs files, so I am presenting this patch for the etc/PROBLEM file. The patch below describes my fix fo r the gtk2 emacs crash problem on startup, due to failure to allocate memory. Regards, Darel Henman For reference, this fix works on my machine which uses the following gtk2 elements and cygwin version: glib-2.16.4 , atk-1.9.0 , pixman-0.11.4 , cairo-1.6.4 , pango-1.21.3 , gtk+-2.12.11 CYGWIN_NT-5.1 1.5.25(0.156/4/2) 2008-06-12 compiled with: gcc (GCC) 4.3.2 20080619 (prerelease) ================ submitted patch for etc/PROBLEMS file follows ================ --- emacs/etc/PROBLEMS +++ modified-20080707 @@ -233,7 +233,7 @@ This happens because of bugs in Gtk+. Gtk+ 2.10 seems to be OK. See bug http://bugzilla.gnome.org/show_bug.cgi?id=85715. -** Emacs compiled with Gtk+ crashes on startup on Cygwin. +** Emacs compiled with Gtk+ crashes on startup from Cygwin's X11 window. A typical error message is ***MEMORY-ERROR***: emacs[5172]: GSlice: failed to allocate 504 bytes @@ -241,8 +241,18 @@ Emacs supplies its own malloc, but glib (part of Gtk+) calls memalign and on Cygwin, that becomes the Cygwin supplied memalign. As malloc is not the -Cygwin malloc, the Cygwin memalign always returns ENOSYS. A fix for this -problem would be welcome. +Cygwin malloc, the Cygwin memalign always returns ENOSYS. + +A fix for this, that worked for me, involves setting the G_SLICE environment +variable, which allows reconfiguration of the GSlice memory allocator. It is +convenient to do this in your X11's $HOME/.xinitrc file as follows, before any +"exec emacs &" line in the file, if you have any: + +export G_SLICE=always-malloc + +This fix can be easily tested on a cygwin x-window command line by typing: + $ export G_SLICE=always-malloc + $ emacs * General runtime problems ================ end of submitted etc/PROBLEMS patch ================