all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: emacs-devel@gnu.org, Angelo Graziosi <angelo.graziosi@alice.it>
Subject: Re: Warning starting Emacs  (Cygwin)
Date: Sat, 02 Aug 2008 16:19:51 -0400	[thread overview]
Message-ID: <87k5ezcgpk.fsf@stupidchicken.com> (raw)
In-Reply-To: <200808021930.m72JUTrw014872@sallyv1.ics.uci.edu> (Dan Nicolaescu's message of "Sat, 02 Aug 2008 12:30:29 -0700")

Dan Nicolaescu <dann@ics.uci.edu> writes:

> The check is very likely fine, I was hoping you understand the code
> the macro guards...  Please see Angelo's messages, he gives a lot of
> details that might ring a bell.

I don't understand the code in check_memory_limits is trying to do.
rlim_cur and rlim_max are the "soft limit" and "hard limit" for the
amount of memory the Emacs process can possibly occupy; so why are we
interested in comparing the two?  There's no guarantee that this has
anything to do with the amount of memory Emacs actually consumes.

(There's also a separate bug: the `cp' variable isn't initialized if
HAVE_GETRLIMIT is defined, even though it is used.)

In short, I think the code is simply based on a misunderstanding of
getrlimit.  The following patch should fix this confusion, by setting
data_size using morecore instead of rlimit.rlim_cur.

However, this raises the separate issue of bug#86, which is that the
real_morecore/__morecore hack causes crashes on HP/UX.  I think this
whole function should be wrapped in a `#if GNU_MALLOC ', at the very
least.  If we're using some unknown malloc implementation, just make it
a no-op.


*** trunk/src/vm-limit.c.~1.23.~	2008-05-14 03:49:59.000000000 -0400
--- trunk/src/vm-limit.c	2008-08-02 16:15:22.000000000 -0400
***************
*** 166,172 ****
      return;
  
    five_percent = rlimit.rlim_max / 20;
-   data_size = rlimit.rlim_cur;
  
  #else /* not HAVE_GETRLIMIT */
  
--- 166,171 ----
***************
*** 174,179 ****
--- 173,180 ----
      get_lim_data ();
    five_percent = lim_data / 20;
  
+ #endif /* not HAVE_GETRLIMIT */
+ 
    /* Find current end of memory and issue warning if getting near max */
  #ifdef REL_ALLOC
    if (real_morecore)
***************
*** 183,190 ****
    cp = (char *) (*__morecore) (0);
    data_size = (char *) cp - (char *) data_space_start;
  
- #endif /* not HAVE_GETRLIMIT */
- 
    if (!warn_function)
      return;
  
--- 184,189 ----




  parent reply	other threads:[~2008-08-02 20:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 14:45 Failure bootstrapping Emacs (Cygwin) Angelo Graziosi
2008-07-31 16:27 ` Angelo Graziosi
2008-07-31 16:57   ` Angelo Graziosi
2008-07-31 17:00   ` Dan Nicolaescu
2008-08-01 10:38     ` Warning starting Emacs (was Re: Failure bootstrapping Emacs (Cygwin)) Angelo Graziosi
2008-08-01 12:51       ` Warning starting Emacs (Cygwin) Angelo Graziosi
2008-08-01 13:08         ` Dan Nicolaescu
2008-08-01 14:13           ` Angelo Graziosi
2008-08-01 14:36             ` Dan Nicolaescu
2008-08-01 20:47               ` Angelo Graziosi
2008-08-02  4:06                 ` Dan Nicolaescu
2008-08-02 14:29                   ` Angelo Graziosi
2008-08-02 15:02                     ` Angelo Graziosi
2008-08-02 18:59                     ` Dan Nicolaescu
2008-08-02 19:14                       ` Chong Yidong
2008-08-02 19:30                         ` Dan Nicolaescu
2008-08-02 19:54                           ` Eli Zaretskii
2008-08-02 20:19                           ` Chong Yidong [this message]
2008-08-02 20:24                             ` Chong Yidong
2008-08-03  3:26                               ` Eli Zaretskii
2008-08-03  6:20                         ` Andreas Vögele
2008-08-03 14:10                           ` Chong Yidong
2008-08-03 22:35                             ` Angelo Graziosi
2008-08-04  6:25                               ` Andreas Vögele

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k5ezcgpk.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=angelo.graziosi@alice.it \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.