public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* GSlice problem with emacs Gtk+ build
@ 2009-12-07 16:06 Ken Brown
  2009-12-07 19:13 ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 3+ messages in thread
From: Ken Brown @ 2009-12-07 16:06 UTC (permalink / raw)
  To: cygwin-xfree

There's been a longstanding problem with emacs if it is configured to 
use Gtk+ in Cygwin.  The relevant threads begin here:

   http://cygwin.com/ml/cygwin/2006-07/threads.html#00823
   http://cygwin.com/ml/cygwin/2007-02/threads.html#00469
   http://cygwin.com/ml/cygwin/2007-02/threads.html#00503

Briefly, the problem is the following (quoted from the emacs 
etc/PROBLEMS file):

"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."

The symptom is that emacs crashes with an error message like the following:

***MEMORY-ERROR***: [2428]: GSlice: failed to allocate 120 bytes 
(alignment: 128): Function not implemented

Fatal error (6)Aborted (core dumped)

There's a known workaround, which is to set G_SLICE=always-malloc before 
starting emacs.  As emacs maintainer, I've been reluctant to provide the 
Gtk+ version of emacs, because I don't want to answer hundreds of emails 
telling people about the workaround.  I could supply a wrapper script 
that sets G_SLICE, but I'm still afraid that would cause a lot of 
confusion; I suspect many people are in the habit of calling 
emacs-X11.exe directly.  I have therefore configured the emacs-X11 
package to use Xaw instead of Gtk+.  But Gtk+ is really much nicer, and 
I would like to be able to provide an emacs-X11 that uses it.

At the time this was first discussed, Cygwin did not have an X 
maintainer.  Now that we have Jon and Yaakov actively providing Cygwin/X 
support, I wonder if it would be possible to revisit the issue and try 
to fix the problem.  For example, might it be as simple as patching the 
Cygwin port of glib to achieve the same effect as setting 
G_SLICE=always-malloc?

Ken


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GSlice problem with emacs Gtk+ build
  2009-12-07 16:06 GSlice problem with emacs Gtk+ build Ken Brown
@ 2009-12-07 19:13 ` Yaakov (Cygwin/X)
  2009-12-07 22:18   ` Ken Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Yaakov (Cygwin/X) @ 2009-12-07 19:13 UTC (permalink / raw)
  To: cygwin-xfree

On 07/12/2009 10:06, Ken Brown wrote:
> There's a known workaround, which is to set G_SLICE=always-malloc before
> starting emacs. As emacs maintainer, I've been reluctant to provide the
> Gtk+ version of emacs, because I don't want to answer hundreds of emails
> telling people about the workaround. I could supply a wrapper script
> that sets G_SLICE, but I'm still afraid that would cause a lot of
> confusion; I suspect many people are in the habit of calling
> emacs-X11.exe directly. I have therefore configured the emacs-X11
> package to use Xaw instead of Gtk+. But Gtk+ is really much nicer, and I
> would like to be able to provide an emacs-X11 that uses it.

What about adding to the beginning of main():

#ifdef __CYGWIN__
     setenv("G_SLICE", "always-malloc", 1);
#endif


Yaakov
Cygwin/X

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GSlice problem with emacs Gtk+ build
  2009-12-07 19:13 ` Yaakov (Cygwin/X)
@ 2009-12-07 22:18   ` Ken Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Ken Brown @ 2009-12-07 22:18 UTC (permalink / raw)
  To: cygwin-xfree

On 12/7/2009 2:13 PM, Yaakov (Cygwin/X) wrote:
> On 07/12/2009 10:06, Ken Brown wrote:
>> There's a known workaround, which is to set G_SLICE=always-malloc before
>> starting emacs. As emacs maintainer, I've been reluctant to provide the
>> Gtk+ version of emacs, because I don't want to answer hundreds of emails
>> telling people about the workaround. I could supply a wrapper script
>> that sets G_SLICE, but I'm still afraid that would cause a lot of
>> confusion; I suspect many people are in the habit of calling
>> emacs-X11.exe directly. I have therefore configured the emacs-X11
>> package to use Xaw instead of Gtk+. But Gtk+ is really much nicer, and I
>> would like to be able to provide an emacs-X11 that uses it.
> 
> What about adding to the beginning of main():
> 
> #ifdef __CYGWIN__
>     setenv("G_SLICE", "always-malloc", 1);
> #endif

Thanks, Yaakov!  I was looking for more complicated solutions and never 
thought of the easy one.  That fixes it.

Ken

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-07 22:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-07 16:06 GSlice problem with emacs Gtk+ build Ken Brown
2009-12-07 19:13 ` Yaakov (Cygwin/X)
2009-12-07 22:18   ` Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).