GNU bug report logs - #15094
Fix for posix_memalign on Cygwin

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Wed, 14 Aug 2013 16:23:02 UTC

Severity: normal

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15094 in the body.
You can then email your comments to 15094 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15094; Package emacs. (Wed, 14 Aug 2013 16:23:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ken Brown <kbrown <at> cornell.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 14 Aug 2013 16:23:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: emacs-bug <bug-gnu-emacs <at> gnu.org>
Subject: Fix for posix_memalign on Cygwin
Date: Wed, 14 Aug 2013 12:22:18 -0400
[Message part 1 (text/plain, inline)]
Cygwin allows applications to supply their own malloc but not, until 
today, their own posix_memalign.  This has caused problems with the GTK 
build of Emacs on Cygwin.  The problem became worse with the latest Glib 
update.  Anyone who wants the gory details can find them starting here:

  http://cygwin.com/ml/cygwin-xfree/2013-08/msg00018.html

Cygwin was just patched today to allow applications to supply their own 
posix_memalign (but not their own memalign), which solves the Glib 
problem.  But posix_memalign in gmalloc.c calls memalign, so I need to 
make sure that it calls Emacs's memalign.  The attached patch does this. 
 Is this a reasonable way to handle the problem?  (I plan to also add 
an explanatory comment.)

Thanks.

Ken
[memalign.patch (text/plain, attachment)]

Reply sent to Ken Brown <kbrown <at> cornell.edu>:
You have taken responsibility. (Wed, 14 Aug 2013 19:12:01 GMT) Full text and rfc822 format available.

Notification sent to Ken Brown <kbrown <at> cornell.edu>:
bug acknowledged by developer. (Wed, 14 Aug 2013 19:12:02 GMT) Full text and rfc822 format available.

Message #10 received at 15094-done <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: 15094-done <at> debbugs.gnu.org
Subject: Re: bug#15094: Fix for posix_memalign on Cygwin
Date: Wed, 14 Aug 2013 15:11:09 -0400
On 8/14/2013 12:22 PM, Ken Brown wrote:
> Cygwin allows applications to supply their own malloc but not, until
> today, their own posix_memalign.  This has caused problems with the GTK
> build of Emacs on Cygwin.  The problem became worse with the latest Glib
> update.  Anyone who wants the gory details can find them starting here:
>
>    http://cygwin.com/ml/cygwin-xfree/2013-08/msg00018.html
>
> Cygwin was just patched today to allow applications to supply their own
> posix_memalign (but not their own memalign), which solves the Glib
> problem.  But posix_memalign in gmalloc.c calls memalign, so I need to
> make sure that it calls Emacs's memalign.  The attached patch does this.
>   Is this a reasonable way to handle the problem?  (I plan to also add
> an explanatory comment.)

I made this more complicated than necessary.  I've installed a simpler 
version as bzr revision 113880, and I'm closing the bug.

Ken





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15094; Package emacs. (Wed, 14 Aug 2013 19:29:02 GMT) Full text and rfc822 format available.

Message #13 received at 15094 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 15094 <at> debbugs.gnu.org
Subject: Re: bug#15094: Fix for posix_memalign on Cygwin
Date: Wed, 14 Aug 2013 22:29:05 +0300
> Date: Wed, 14 Aug 2013 15:11:09 -0400
> From: Ken Brown <kbrown <at> cornell.edu>
> 
> On 8/14/2013 12:22 PM, Ken Brown wrote:
> > Cygwin allows applications to supply their own malloc but not, until
> > today, their own posix_memalign.  This has caused problems with the GTK
> > build of Emacs on Cygwin.  The problem became worse with the latest Glib
> > update.  Anyone who wants the gory details can find them starting here:
> >
> >    http://cygwin.com/ml/cygwin-xfree/2013-08/msg00018.html
> >
> > Cygwin was just patched today to allow applications to supply their own
> > posix_memalign (but not their own memalign), which solves the Glib
> > problem.  But posix_memalign in gmalloc.c calls memalign, so I need to
> > make sure that it calls Emacs's memalign.  The attached patch does this.
> >   Is this a reasonable way to handle the problem?  (I plan to also add
> > an explanatory comment.)
> 
> I made this more complicated than necessary.  I've installed a simpler 
> version as bzr revision 113880, and I'm closing the bug.

Thanks, but could you please make the commentary more clear?  I'm
afraid it doesn't make sense to me: if posix_memalign calls memalign,
then why does the latter have to be renamed, if all you want is for it
to be called?  Why won't it be called unless renamed?

TIA




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15094; Package emacs. (Wed, 14 Aug 2013 19:54:02 GMT) Full text and rfc822 format available.

Message #16 received at 15094 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15094 <at> debbugs.gnu.org
Subject: Re: bug#15094: Fix for posix_memalign on Cygwin
Date: Wed, 14 Aug 2013 15:52:53 -0400
On 8/14/2013 3:29 PM, Eli Zaretskii wrote:
> Thanks, but could you please make the commentary more clear?  I'm
> afraid it doesn't make sense to me: if posix_memalign calls memalign,
> then why does the latter have to be renamed, if all you want is for it
> to be called?  Why won't it be called unless renamed?

How's this:

/* Cygwin allows applications to provide their own malloc.  As of
cygwin-1.7.24, applications that provide their own malloc are also
allowed to provide their own posix_memalign (but not memalign).  Calls
to memalign are handled by Cygwin's memalign, which always returns
ENOSYS if the application has defined its own malloc.  So we have to
rename memalign in order to make sure that posix_memalign calls
Emacs's memalign rather than Cygwin's.  */

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15094; Package emacs. (Thu, 15 Aug 2013 02:47:01 GMT) Full text and rfc822 format available.

Message #19 received at 15094 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 15094 <at> debbugs.gnu.org
Subject: Re: bug#15094: Fix for posix_memalign on Cygwin
Date: Thu, 15 Aug 2013 05:46:42 +0300
> Date: Wed, 14 Aug 2013 15:52:53 -0400
> From: Ken Brown <kbrown <at> cornell.edu>
> CC: 15094 <at> debbugs.gnu.org
> 
> /* Cygwin allows applications to provide their own malloc.  As of
> cygwin-1.7.24, applications that provide their own malloc are also
> allowed to provide their own posix_memalign (but not memalign).  Calls
> to memalign are handled by Cygwin's memalign, which always returns
> ENOSYS if the application has defined its own malloc.  So we have to
> rename memalign in order to make sure that posix_memalign calls
> Emacs's memalign rather than Cygwin's.  */

How does Cygwin memalign come into play, when Emacs provides its own?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15094; Package emacs. (Thu, 15 Aug 2013 11:53:02 GMT) Full text and rfc822 format available.

Message #22 received at 15094 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15094 <at> debbugs.gnu.org
Subject: Re: bug#15094: Fix for posix_memalign on Cygwin
Date: Thu, 15 Aug 2013 07:51:36 -0400
On 8/14/2013 10:46 PM, Eli Zaretskii wrote:
>> Date: Wed, 14 Aug 2013 15:52:53 -0400
>> From: Ken Brown <kbrown <at> cornell.edu>
>> CC: 15094 <at> debbugs.gnu.org
>>
>> /* Cygwin allows applications to provide their own malloc.  As of
>> cygwin-1.7.24, applications that provide their own malloc are also
>> allowed to provide their own posix_memalign (but not memalign).  Calls
>> to memalign are handled by Cygwin's memalign, which always returns
>> ENOSYS if the application has defined its own malloc.  So we have to
>> rename memalign in order to make sure that posix_memalign calls
>> Emacs's memalign rather than Cygwin's.  */
>
> How does Cygwin memalign come into play, when Emacs provides its own?

As I said in the comment, Cygwin does not let applications define their 
own memalign.  During linking, calls to memalign become calls to 
Cygwin's memalign.

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15094; Package emacs. (Thu, 15 Aug 2013 13:01:01 GMT) Full text and rfc822 format available.

Message #25 received at 15094 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15094 <at> debbugs.gnu.org
Subject: Re: bug#15094: Fix for posix_memalign on Cygwin
Date: Thu, 15 Aug 2013 09:00:06 -0400
On 8/15/2013 7:51 AM, Ken Brown wrote:
> On 8/14/2013 10:46 PM, Eli Zaretskii wrote:
>>> Date: Wed, 14 Aug 2013 15:52:53 -0400
>>> From: Ken Brown <kbrown <at> cornell.edu>
>>> CC: 15094 <at> debbugs.gnu.org
>>>
>>> /* Cygwin allows applications to provide their own malloc.  As of
>>> cygwin-1.7.24, applications that provide their own malloc are also
>>> allowed to provide their own posix_memalign (but not memalign).  Calls
>>> to memalign are handled by Cygwin's memalign, which always returns
>>> ENOSYS if the application has defined its own malloc.  So we have to
>>> rename memalign in order to make sure that posix_memalign calls
>>> Emacs's memalign rather than Cygwin's.  */
>>
>> How does Cygwin memalign come into play, when Emacs provides its own?
>
> As I said in the comment, Cygwin does not let applications define their
> own memalign.  During linking, calls to memalign become calls to
> Cygwin's memalign.

Hold on...I think I'm missing something obvious.  I have to recheck this.

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15094; Package emacs. (Thu, 15 Aug 2013 16:16:01 GMT) Full text and rfc822 format available.

Message #28 received at 15094 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15094 <at> debbugs.gnu.org
Subject: Re: bug#15094: Fix for posix_memalign on Cygwin
Date: Thu, 15 Aug 2013 12:15:49 -0400
On 8/15/2013 9:00 AM, Ken Brown wrote:
> On 8/15/2013 7:51 AM, Ken Brown wrote:
>> On 8/14/2013 10:46 PM, Eli Zaretskii wrote:
>>>> Date: Wed, 14 Aug 2013 15:52:53 -0400
>>>> From: Ken Brown <kbrown <at> cornell.edu>
>>>> CC: 15094 <at> debbugs.gnu.org
>>>>
>>>> /* Cygwin allows applications to provide their own malloc.  As of
>>>> cygwin-1.7.24, applications that provide their own malloc are also
>>>> allowed to provide their own posix_memalign (but not memalign).  Calls
>>>> to memalign are handled by Cygwin's memalign, which always returns
>>>> ENOSYS if the application has defined its own malloc.  So we have to
>>>> rename memalign in order to make sure that posix_memalign calls
>>>> Emacs's memalign rather than Cygwin's.  */
>>>
>>> How does Cygwin memalign come into play, when Emacs provides its own?
>>
>> As I said in the comment, Cygwin does not let applications define their
>> own memalign.  During linking, calls to memalign become calls to
>> Cygwin's memalign.
>
> Hold on...I think I'm missing something obvious.  I have to recheck this.

Thanks for pressing me on this, Eli.  I did of course miss the obvious 
fact that posix_memalign in gmalloc.c will use memalign as defined in 
the same file.  I'll revert the change.  I'll also use the opportunity 
to update some comments elsewhere in the code.

Sorry for the noise.

Ken





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15094; Package emacs. (Thu, 15 Aug 2013 16:40:04 GMT) Full text and rfc822 format available.

Message #31 received at 15094 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 15094 <at> debbugs.gnu.org
Subject: Re: bug#15094: Fix for posix_memalign on Cygwin
Date: Thu, 15 Aug 2013 19:39:40 +0300
> Date: Thu, 15 Aug 2013 12:15:49 -0400
> From: Ken Brown <kbrown <at> cornell.edu>
> CC: 15094 <at> debbugs.gnu.org
> 
> Thanks for pressing me on this, Eli.  I did of course miss the obvious 
> fact that posix_memalign in gmalloc.c will use memalign as defined in 
> the same file.  I'll revert the change.  I'll also use the opportunity 
> to update some comments elsewhere in the code.

Thanks.

> Sorry for the noise.

No need to apologize: no harm was done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Sep 2013 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 360 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.