unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Caroptions Caroptions <caroptions@hotmail.com>
To: "34762@debbugs.gnu.org" <34762@debbugs.gnu.org>
Subject: bug#34762: Acknowledgement (26.1.92; objc[27300]: Invalid or prematurely-freed autorelease pool 0x1040021e0.)
Date: Mon, 18 Mar 2019 23:26:53 +0000	[thread overview]
Message-ID: <BYAPR02MB581341AE96E751B6E8A27052CF470@BYAPR02MB5813.namprd02.prod.outlook.com> (raw)
In-Reply-To: <20190318120926.GA44536@breton.holly.idiocy.org>

[-- Attachment #1: Type: text/plain, Size: 2731 bytes --]

Thank you for coming back on this! I agree it is very odd, otherwise many people would experience it..

What I did, I have commented out:


  /* set main menu */

  if (needsSet)

    [NSApp setMainMenu: menu];


  // [pool release];

  unblock_input ();


}

as expected it start working fine, but not sure if it leads to memory leak ..

Also If run debug in Xcode and do step by step debugging Emacs hang this call:



          /* FIXME: we'd like to only parse the needed submenu, but this

               was causing crashes in the _common parsing code.. need to make

               sure proper initialization done.. */

/*        if (submenu && strcmp ([[submenu title] UTF8String], SSDATA (string)))

             continue; */


  submenu_start[i] = menu_items_used;


  menu_items_n_panes = 0;

  *hang*--> submenu_top_level_items[i] = parse_single_submenu (key, string, maps);

  submenu_n_panes[i] = menu_items_n_panes;

  submenu_end[i] = menu_items_used;

          n++;


  1.  In my understanding TRAMP to work with remote files starts separate thread and this thread prematurely release pool.
  2.  Another "theory" remote operations is naturally longer and file read/write much longer after 64 encode/decode, network transfer, opening local temp file and this lead to race conditions?
  3.  Or tramp include new menu item, which outside of standard event loop?

Anyway I am ready to troubleshoot and apply any patches/check code if needed.

Thanks,
Caroptions


________________________________
From: Alan Third <athird@googlemail.com> on behalf of Alan Third <alan@idiocy.org>
Sent: Monday, March 18, 2019 5:09 AM
To: Caroptions Caroptions
Cc: 34762@debbugs.gnu.org
Subject: Re: bug#34762: Acknowledgement (26.1.92; objc[27300]: Invalid or prematurely-freed autorelease pool 0x1040021e0.)

On Fri, Mar 15, 2019 at 08:55:49PM +0000, Caroptions Caroptions wrote:
> The bug reproduced on any compiled emacs.
>
> 26.1.92 has it, latest master branch has it... Do not understand why
> nobody else hit it as yet ..
>
> I think the problem somehow related to NSAutoreleasePool and
> pthreads : https://kenji.sx/posts/nsautoreleasepooldebian

Hi, thanks for reporting this. I didn’t get the previous email for
some reason, so I missed it.

This is an odd one. I don’t think it has anything to do with pthreads,
but I don’t really understand what’s going on. My best guess is that
somehow the autorelease pools are being drained out of order. I don’t
know why using tramp would cause that to happen.

One solution would be to remove the pool from ns_update_menubar
completely, but I assume it’s there for a good reason.
--
Alan Third

[-- Attachment #2: Type: text/html, Size: 10586 bytes --]

  reply	other threads:[~2019-03-18 23:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05 20:48 bug#34762: 26.1.92; objc[27300]: Invalid or prematurely-freed autorelease pool 0x1040021e0 Caroptions Caroptions
     [not found] ` <handler.34762.B.15518205747745.ack@debbugs.gnu.org>
2019-03-15 20:55   ` bug#34762: Acknowledgement (26.1.92; objc[27300]: Invalid or prematurely-freed autorelease pool 0x1040021e0.) Caroptions Caroptions
2019-03-18 12:09     ` Alan Third
2019-03-18 23:26       ` Caroptions Caroptions [this message]
2019-12-16  7:37 ` Fan Yang
2020-09-04  1:44 ` Win Treese
2020-09-05 20:02   ` Alan Third
2020-09-08 19:38     ` Win Treese
2020-09-08 20:51       ` Alan Third

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=BYAPR02MB581341AE96E751B6E8A27052CF470@BYAPR02MB5813.namprd02.prod.outlook.com \
    --to=caroptions@hotmail.com \
    --cc=34762@debbugs.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 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).