unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Johan Widén" <j.e.widen@gmail.com>
Cc: 65445@debbugs.gnu.org
Subject: bug#65445: 29.1; Android emacs: False memory full condition, due to Java exception (?)
Date: Tue, 22 Aug 2023 07:52:18 +0800	[thread overview]
Message-ID: <s0dcyzgvtql.fsf@yahoo.com> (raw)
In-Reply-To: <878ra4m77d.fsf@gmail.com> ("Johan Widén"'s message of "Mon, 21 Aug 2023 22:46:13 +0200")

Johan Widén <j.e.widen@gmail.com> writes:

> This bug report is for Android emacs, but I am writing it in my Ubuntu
> emacs, so the config of the Ubuntu emacs is irrelevant. I can send the
> Android emacs figures later, if so desired. I currently have Android
> emacs connected to a debugger, with the stacktrace active, so for now
> I
> would like to avoid executing report-emacs-bug there.
>
> The following bug, or similar, have appeared in all Android emacs
> versions that I have downloaded from Sourceforge. The latest was
> downloaded 20-aug-2023 15:38 UTC.
>
> I append a stacktrace. This is from my own build, but the only file
> that is modifed relative to the repo is alloc.c where I have added 20
> lines or so before the place where I triggered an abort(). I put an
> abort() in memory full, as I so far have not been able to set
> functioning break points.
>
> What happens is that after some editing emacs reports that memory is
> full. But (memory-info) and (memory-report) shows that there is a lot
> of free memory. Emacs internal data allocation is about 150 megabyte,
> and free memory is about 300 megabyte.
>
> I will try to analyze the stack trace more, but I thought it might be
> of interest.  I can trigger the bug fairly repeatable, in the
> following manner: I use spacemacs in evil mode. I start spacemacs and
> open a pdf book in pdf-tools. I then split the window and open a (non
> empty) text file. At the beginning of the text file I enter the evil
> commands: i0C-[yl which inserts a '0' and then copies it to evils two
> 'yank' registers.  That is when the memory full condition occurs. I
> have triggered the bug or a similar bug several times in other editing
> conditions, but I have not been able to repeat those. It was a bit of
> phase of the moon.

Callers of android_exception_check assume that the preceding call(s) to
Java never signal exceptions, so that if an exception is signaled, it
must be an OOM error.  This assumption is made to avoid type comparisons
or local reference allocation (both of which may culminate in more OOM
errors) that would otherwise be necessary to establish the real cause of
an exception.

When an exception is registered by android_exception_check, it makes an
attempt to print it to the log buffer.  Piping it to `grep -A10
"Possible out of memory error"' should uncover the Java stack trace
saved in the exception.





  reply	other threads:[~2023-08-21 23:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21 20:46 bug#65445: 29.1; Android emacs: False memory full condition, due to Java exception (?) Johan Widén
2023-08-21 23:52 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-08-22  2:27   ` Eli Zaretskii
2023-08-22  2:27     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-22  5:21       ` Johan Widén
2023-08-22  5:25         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-22  5:52           ` Johan Widén
2023-08-22  6:51             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-22  7:09               ` Johan Widén
2023-08-22  7:28                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02 16:30                   ` Stefan Kangas
2023-09-02 17:21                     ` Johan Widén
2023-09-02 18:52                       ` Stefan Kangas
2023-09-02 18:56                         ` Johan Widén

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=s0dcyzgvtql.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65445@debbugs.gnu.org \
    --cc=j.e.widen@gmail.com \
    --cc=luangruo@yahoo.com \
    /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 public inbox

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

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