GSlice problem with emacs Gtk+ build

Ken Brown
Mon Dec 7 16:06:00 GMT 2009

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

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 


Unsubscribe info:
Problem reports:

More information about the Cygwin-xfree mailing list