GNU bug report logs - #45515
28.0.50; [feature/native-comp] emacsGcc crash on Apple Silicon M1

Previous Next

Package: emacs;

Reported by: michal panoch <michal <at> panoch.net>

Date: Mon, 28 Dec 2020 21:38:01 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

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 45515 in the body.
You can then email your comments to 45515 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#45515; Package emacs. (Mon, 28 Dec 2020 21:38:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to michal panoch <michal <at> panoch.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 28 Dec 2020 21:38:01 GMT) Full text and rfc822 format available.

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

From: michal panoch <michal <at> panoch.net>
To: bug-gnu-emacs <at> gnu.org
Cc: mp <at> maya.cz
Subject: 28.0.50; [feature/native-comp] emacsGcc crash on Apple Silicon M1
Date: Mon, 28 Dec 2020 21:57:44 +0100
hi,

i'm on the new Apple Silicon M1 architecture and using nix emacs-overlay - https://github.com/nix-community/emacs-overlay/

like this: ~/.config/nixpkgs/overlays/emacs.nix

import (builtins.fetchTarball {
  url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
})

install whith:

$ nix-env -iA nixpkgs.emacsGcc

it compiles no problem. it runs and bytecompiles everything no problem, but after a while it crashes with:

Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0, VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES), port, 0, false, prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS), function backing_map, file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c, line 192. Fatal error 6: Aborted [1] 2319 abort emacs --fg-daemon

any idea how to investigate?

uname -a:
Darwin mpm.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64


In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.2.0, NS appkit-2022.20 Version 10.16 (Build 20C69))
Repository revision: 87f6e937995c433825173fb0473a801791d5beac
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.1

Configured using:
 'configure
 --prefix=/nix/store/9rsfjqclzwgsh63szkdb6mn2572pv9zi-emacs-gcc-20201217.0
 --disable-build-details --with-modules --with-ns
 --disable-ns-self-contained --with-nativecomp
 CFLAGS=-DMAC_OS_X_VERSION_MAX_ALLOWED=101200'

Configured features:
JPEG TIFF PNG RSVG GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS NS MODULES NATIVE_COMP THREADS JSON PDUMPER

Important settings:
  value of $LC_CTYPE: UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs
password-cache json map text-property-search time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp
comp-cstr warnings subr-x rx cl-extra help-mode easymenu seq cl-seq
byte-opt cl-macs gv jka-compr cl-loaddefs cl-lib bytecomp byte-compile
cconv iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face pcase macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads kqueue cocoa ns multi-tty
make-network-process nativecomp emacs)

Memory information:
((conses 16 85548 8869)
 (symbols 48 7929 1)
 (strings 32 23659 2908)
 (string-bytes 1 870425)
 (vectors 16 15702)
 (vector-slots 8 305764 19876)
 (floats 8 31 37)
 (intervals 56 198 0)
 (buffers 984 11))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Tue, 29 Dec 2020 09:02:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: michal panoch <michal <at> panoch.net>
Cc: mp <at> maya.cz, 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on
 Apple Silicon M1
Date: Tue, 29 Dec 2020 09:01:28 +0000
michal panoch <michal <at> panoch.net> writes:

> hi,
>
> i'm on the new Apple Silicon M1 architecture and using nix emacs-overlay - https://github.com/nix-community/emacs-overlay/
>
> like this: ~/.config/nixpkgs/overlays/emacs.nix
>
> import (builtins.fetchTarball {
>   url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
> })
>
> install whith:
>
> $ nix-env -iA nixpkgs.emacsGcc
>
> it compiles no problem. it runs and bytecompiles everything no problem, but after a while it crashes with:
>
> Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0, VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES), port, 0, false, prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS), function backing_map, file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c, line 192. Fatal error 6: Aborted [1] 2319 abort emacs --fg-daemon
>
> any idea how to investigate?
>
> uname -a:
> Darwin mpm.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64

Hi Michal,

this assertion is out of our code so doesn't ring any bell to me.
Running under a debugger to have a back-trace of the crash might give
more information.

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Tue, 29 Dec 2020 15:08:01 GMT) Full text and rfc822 format available.

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

From: mp <michal <at> panoch.net>
To: 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on Apple
 Silicon M1
Date: Tue, 29 Dec 2020 16:07:08 +0100
On 29.12.2020 10:01, Andrea Corallo wrote:

> michal panoch <michal <at> panoch.net> writes:
>
>> hi,
>>
>> i'm on the new Apple Silicon M1 architecture and using nix emacs-overlay - https://github.com/nix-community/emacs-overlay/
>>
>> like this: ~/.config/nixpkgs/overlays/emacs.nix
>>
>> import (builtins.fetchTarball {
>>    url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
>> })
>>
>> install whith:
>>
>> $ nix-env -iA nixpkgs.emacsGcc
>>
>> it compiles no problem. it runs and bytecompiles everything no problem, but after a while it crashes with:
>>
>> Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0, VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES), port, 0, false, prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS), function backing_map, file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c, line 192. Fatal error 6: Aborted [1] 2319 abort emacs --fg-daemon
>>
>> any idea how to investigate?
>>
>> uname -a:
>> Darwin mpm.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64
> Hi Michal,
>
> this assertion is out of our code so doesn't ring any bell to me.
> Running under a debugger to have a back-trace of the crash might give
> more information.
>
> Thanks
>
>    Andrea
trying to run with gbd, but it doesn't seem to be working:

mp <at> mpm:~ :$ gdb /Users/mp/.nix-profile/bin/emacs
GNU gdb (GDB) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /Users/mp/.nix-profile/bin/emacs...
(No debugging symbols found in /Users/mp/.nix-profile/bin/emacs)
(gdb) r --fg-daemon
Starting program: 
/nix/store/2y79kkpvkbjdd2jzdxx2w3p3mxdqpagf-user-environment/bin/emacs 
--fg-daemon
[New Thread 0x2a03 of process 54326]
[New Thread 0x2b03 of process 54326]
../../gdb/target.c:2149: internal-error: void 
target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

../../gdb/target.c:2149: internal-error: void 
target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Command aborted.
Error calling thread_get_state for GP registers for thread 0x2a03
warning: Mach error at "../../gdb/i386-darwin-nat.c:83" in function 
"virtual void i386_darwin_nat_target::fetch_registers(struct regcache *, 
int)": (ipc/send) invalid destination port (0x10000003)


any idea how to proceed?

-mp-






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Tue, 29 Dec 2020 15:34:01 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: mp <michal <at> panoch.net>
Cc: 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on
 Apple Silicon M1
Date: Tue, 29 Dec 2020 15:33:44 +0000
mp <michal <at> panoch.net> writes:

> On 29.12.2020 10:01, Andrea Corallo wrote:
>
>> michal panoch <michal <at> panoch.net> writes:
>>
>>> hi,
>>>
>>> i'm on the new Apple Silicon M1 architecture and using nix emacs-overlay - https://github.com/nix-community/emacs-overlay/
>>>
>>> like this: ~/.config/nixpkgs/overlays/emacs.nix
>>>
>>> import (builtins.fetchTarball {
>>>    url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
>>> })
>>>
>>> install whith:
>>>
>>> $ nix-env -iA nixpkgs.emacsGcc
>>>
>>> it compiles no problem. it runs and bytecompiles everything no problem, but after a while it crashes with:
>>>
>>> Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0,
>>> VM_FLAGS_ANYWHERE |
>>> VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES), port, 0, false,
>>> prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS), function
>>> backing_map, file
>>> /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c,
>>> line 192. Fatal error 6: Aborted [1] 2319 abort emacs --fg-daemon
>>>
>>> any idea how to investigate?
>>>
>>> uname -a:
>>> Darwin mpm.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64
>> Hi Michal,
>>
>> this assertion is out of our code so doesn't ring any bell to me.
>> Running under a debugger to have a back-trace of the crash might give
>> more information.
>>
>> Thanks
>>
>>    Andrea
>
> trying to run with gbd, but it doesn't seem to be working:
>
> mp <at> mpm:~ :$ gdb /Users/mp/.nix-profile/bin/emacs
> GNU gdb (GDB) 10.1
> Copyright (C) 2020 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-apple-darwin".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <https://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
>     <http://www.gnu.org/software/gdb/documentation/>.
>
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from /Users/mp/.nix-profile/bin/emacs...
> (No debugging symbols found in /Users/mp/.nix-profile/bin/emacs)

This build is stripped (no debug symbols).  I'd build manually from
source to have 100% control leaving a side a layer (not a Nix expert of
user).

> (gdb) r --fg-daemon
> Starting program:
> /nix/store/2y79kkpvkbjdd2jzdxx2w3p3mxdqpagf-user-environment/bin/emacs
> --fg-daemon
> [New Thread 0x2a03 of process 54326]
> [New Thread 0x2b03 of process 54326]
> ../../gdb/target.c:2149: internal-error: void
> target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid'
> failed.
> A problem internal to GDB has been detected,

Looks like an internal problem of gdb?  Perhaps gdb doesn't like to run
under rosetta?  Is this an X86 gdb build correct?  You might be more
lucky with lldb.

That said I think to have native-comp running native on M1 GCC will have
to be ported and AFAIK this has still not be done (at list in GCC
trunk).

Hope it helps

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Tue, 29 Dec 2020 15:46:01 GMT) Full text and rfc822 format available.

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

From: mp <michal <at> panoch.net>
To: 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on Apple
 Silicon M1
Date: Tue, 29 Dec 2020 16:45:05 +0100
On 29.12.2020 16:33, Andrea Corallo wrote:

> mp <michal <at> panoch.net> writes:
>
>> On 29.12.2020 10:01, Andrea Corallo wrote:
>>
>>> michal panoch <michal <at> panoch.net> writes:
>>>
>>>> hi,
>>>>
>>>> i'm on the new Apple Silicon M1 architecture and using nix emacs-overlay - https://github.com/nix-community/emacs-overlay/
>>>>
>>>> like this: ~/.config/nixpkgs/overlays/emacs.nix
>>>>
>>>> import (builtins.fetchTarball {
>>>>     url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
>>>> })
>>>>
>>>> install whith:
>>>>
>>>> $ nix-env -iA nixpkgs.emacsGcc
>>>>
>>>> it compiles no problem. it runs and bytecompiles everything no problem, but after a while it crashes with:
>>>>
>>>> Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0,
>>>> VM_FLAGS_ANYWHERE |
>>>> VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES), port, 0, false,
>>>> prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS), function
>>>> backing_map, file
>>>> /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c,
>>>> line 192. Fatal error 6: Aborted [1] 2319 abort emacs --fg-daemon
>>>>
>>>> any idea how to investigate?
>>>>
>>>> uname -a:
>>>> Darwin mpm.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64
>>> Hi Michal,
>>>
>>> this assertion is out of our code so doesn't ring any bell to me.
>>> Running under a debugger to have a back-trace of the crash might give
>>> more information.
>>>
>>> Thanks
>>>
>>>     Andrea
>> trying to run with gbd, but it doesn't seem to be working:
>>
>> mp <at> mpm:~ :$ gdb /Users/mp/.nix-profile/bin/emacs
>> GNU gdb (GDB) 10.1
>> Copyright (C) 2020 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later
>> <http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.
>> Type "show copying" and "show warranty" for details.
>> This GDB was configured as "x86_64-apple-darwin".
>> Type "show configuration" for configuration details.
>> For bug reporting instructions, please see:
>> <https://www.gnu.org/software/gdb/bugs/>.
>> Find the GDB manual and other documentation resources online at:
>>      <http://www.gnu.org/software/gdb/documentation/>.
>>
>> For help, type "help".
>> Type "apropos word" to search for commands related to "word"...
>> Reading symbols from /Users/mp/.nix-profile/bin/emacs...
>> (No debugging symbols found in /Users/mp/.nix-profile/bin/emacs)
> This build is stripped (no debug symbols).  I'd build manually from
> source to have 100% control leaving a side a layer (not a Nix expert of
> user).
>
>> (gdb) r --fg-daemon
>> Starting program:
>> /nix/store/2y79kkpvkbjdd2jzdxx2w3p3mxdqpagf-user-environment/bin/emacs
>> --fg-daemon
>> [New Thread 0x2a03 of process 54326]
>> [New Thread 0x2b03 of process 54326]
>> ../../gdb/target.c:2149: internal-error: void
>> target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid'
>> failed.
>> A problem internal to GDB has been detected,
> Looks like an internal problem of gdb?  Perhaps gdb doesn't like to run
> under rosetta?  Is this an X86 gdb build correct?
yep. its an X86 build.. the arm build fails for some reason..
>    You might be more
> lucky with lldb.

tried lldb, but it doesn't help much i guess:

2020-12-29 16:38:51.737315+0100 emacs[85147:7251664] [emacs] 
CGContextSetStrokeColorWithColor: invalid context 0x0. Backtrace:
  <NSColorSetWithFillAndStroke+165>
   <ns_draw_window_cursor+862>
    <display_and_set_cursor+2278>
     <update_cursor_in_window_tree+235>
      <update_cursor_in_window_tree+99>
       <-[EmacsView windowDidResignKey:]+162>
<__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__+12>
         <___CFXRegistrationPost_block_invoke+49>
          <_CFXRegistrationPost+454>
           <_CFXNotificationPost+787>
            <-[NSNotificationCenter 
postNotificationName:object:userInfo:]+59>
             <-[NSWindow resignKeyWindow]+725>
              <_NXEndKeyAndMain+162>
               <-[NSApplication _handleDeactivateEvent:]+756>
                <-[NSApplication(NSEvent) sendEvent:]+2742>
                 <-[EmacsApp sendEvent:]+484>
                  <-[NSApplication _handleEvent:]+65>
                   <-[NSApplication run]+623>
                    <-[EmacsApp run]+404>
                     <ns_select+974>
                      <wait_reading_process_output+4132>
                       <sit_for+306>
                        <read_char+5162>
                         <read_key_sequence+2216>
                          <command_loop_1+1324>
                           <internal_condition_case+281>
                            <command_loop_2+48>
                             <internal_catch+279>
                              <command_loop+158>
                               <recursive_edit_1+115>
                                <Frecursive_edit+347>
                                 <main+6880>
<start+1>                                          2
Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0, 
VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES), 
port, 0, false, prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS), function 
backing_map, file 
/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c, 
line 192.
Process 85147 exited with status = 0 (0x00000000) Terminated due to signal 6
(lldb)


> That said I think to have native-comp running native on M1 GCC will have
> to be ported and AFAIK this has still not be done (at list in GCC
> trunk).

i see, so there is not much to be done at this point../

-mp-






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Tue, 29 Dec 2020 16:01:01 GMT) Full text and rfc822 format available.

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

From: Alan Third <alan <at> idiocy.org>
To: mp <michal <at> panoch.net>
Cc: 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on
 Apple Silicon M1
Date: Tue, 29 Dec 2020 16:00:38 +0000
On Tue, Dec 29, 2020 at 04:45:05PM +0100, mp wrote:
> tried lldb, but it doesn't help much i guess:
> 
> 2020-12-29 16:38:51.737315+0100 emacs[85147:7251664] [emacs]
> CGContextSetStrokeColorWithColor: invalid context 0x0. Backtrace:
>   <NSColorSetWithFillAndStroke+165>
>    <ns_draw_window_cursor+862>
>     <display_and_set_cursor+2278>
>      <update_cursor_in_window_tree+235>
>       <update_cursor_in_window_tree+99>
>        <-[EmacsView windowDidResignKey:]+162>
> <__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__+12>

Looks like it's trying to draw when the destination hasn't been set...
What was going on when it crashed? Were you changing to another
application?

It may be worth trying a more up to date merge from master as there's
been a wee bit of work on the NS port recently.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Tue, 29 Dec 2020 16:47:02 GMT) Full text and rfc822 format available.

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

From: mp <michal <at> panoch.net>
To: 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on Apple
 Silicon M1
Date: Tue, 29 Dec 2020 17:46:39 +0100
On 29.12.2020 17:00, Alan Third wrote:

> On Tue, Dec 29, 2020 at 04:45:05PM +0100, mp wrote:
>> tried lldb, but it doesn't help much i guess:
>>
>> 2020-12-29 16:38:51.737315+0100 emacs[85147:7251664] [emacs]
>> CGContextSetStrokeColorWithColor: invalid context 0x0. Backtrace:
>>    <NSColorSetWithFillAndStroke+165>
>>     <ns_draw_window_cursor+862>
>>      <display_and_set_cursor+2278>
>>       <update_cursor_in_window_tree+235>
>>        <update_cursor_in_window_tree+99>
>>         <-[EmacsView windowDidResignKey:]+162>
>> <__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__+12>
> Looks like it's trying to draw when the destination hasn't been set...
> What was going on when it crashed? Were you changing to another
> application?
not really, it was just sitting there and then crashed..
> It may be worth trying a more up to date merge from master as there's
> been a wee bit of work on the NS port recently.

recompiling now, will try and report back..

-mp-






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Wed, 30 Dec 2020 00:44:01 GMT) Full text and rfc822 format available.

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

From: mp <michal <at> panoch.net>
To: 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on Apple
 Silicon M1
Date: Wed, 30 Dec 2020 01:42:58 +0100
On 29.12.2020 16:33, Andrea Corallo wrote:
> mp <michal <at> panoch.net> writes:
>
>> On 29.12.2020 10:01, Andrea Corallo wrote:
>>
>>> michal panoch <michal <at> panoch.net> writes:
>>>
>>>> hi,
>>>>
>>>> i'm on the new Apple Silicon M1 architecture and using nix emacs-overlay - https://github.com/nix-community/emacs-overlay/
>>>>
>>>> like this: ~/.config/nixpkgs/overlays/emacs.nix
>>>>
>>>> import (builtins.fetchTarball {
>>>>     url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
>>>> })
>>>>
>>>> install whith:
>>>>
>>>> $ nix-env -iA nixpkgs.emacsGcc
>>>>
>>>> it compiles no problem. it runs and bytecompiles everything no problem, but after a while it crashes with:
>>>>
>>>> Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0,
>>>> VM_FLAGS_ANYWHERE |
>>>> VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES), port, 0, false,
>>>> prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS), function
>>>> backing_map, file
>>>> /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c,
>>>> line 192. Fatal error 6: Aborted [1] 2319 abort emacs --fg-daemon
>>>>
>>>> any idea how to investigate?
>>>>
>>>> uname -a:
>>>> Darwin mpm.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64
>>> Hi Michal,
>>>
>>> this assertion is out of our code so doesn't ring any bell to me.
>>> Running under a debugger to have a back-trace of the crash might give
>>> more information.
>>>
>>> Thanks
>>>
>>>     Andrea
>> trying to run with gbd, but it doesn't seem to be working:
>>
>> mp <at> mpm:~ :$ gdb /Users/mp/.nix-profile/bin/emacs
>> GNU gdb (GDB) 10.1
>> Copyright (C) 2020 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later
>> <http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.
>> Type "show copying" and "show warranty" for details.
>> This GDB was configured as "x86_64-apple-darwin".
>> Type "show configuration" for configuration details.
>> For bug reporting instructions, please see:
>> <https://www.gnu.org/software/gdb/bugs/>.
>> Find the GDB manual and other documentation resources online at:
>>      <http://www.gnu.org/software/gdb/documentation/>.
>>
>> For help, type "help".
>> Type "apropos word" to search for commands related to "word"...
>> Reading symbols from /Users/mp/.nix-profile/bin/emacs...
>> (No debugging symbols found in /Users/mp/.nix-profile/bin/emacs)
> This build is stripped (no debug symbols).  I'd build manually from
> source to have 100% control leaving a side a layer (not a Nix expert of
> user).
>
>> (gdb) r --fg-daemon
>> Starting program:
>> /nix/store/2y79kkpvkbjdd2jzdxx2w3p3mxdqpagf-user-environment/bin/emacs
>> --fg-daemon
>> [New Thread 0x2a03 of process 54326]
>> [New Thread 0x2b03 of process 54326]
>> ../../gdb/target.c:2149: internal-error: void
>> target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid'
>> failed.
>> A problem internal to GDB has been detected,
> Looks like an internal problem of gdb?  Perhaps gdb doesn't like to run
> under rosetta?  Is this an X86 gdb build correct?  You might be more
> lucky with lldb.
>
> That said I think to have native-comp running native on M1 GCC will have
> to be ported and AFAIK this has still not be done (at list in GCC
> trunk).
>
> Hope it helps
>
>    Andrea

looks like it has been fixed.. after installing new nix package 
emacs-gcc-20201229.0 it hasn't crashed yet..

-mp-






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Wed, 30 Dec 2020 20:26:02 GMT) Full text and rfc822 format available.

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

From: mp <michal <at> panoch.net>
To: 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on Apple
 Silicon M1
Date: Wed, 30 Dec 2020 21:25:54 +0100
Ok, so the problem persists, now it takes longer for emacs daemon to crash..

Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0, 
VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES), 
port, 0, false, prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS), function 
backing_map, file 
/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c, 
line 192.
Fatal error 6: Aborted
[1]    6134 abort      emacs --fg-daemon
emacs --fg-daemon  528.80s user 46.86s system 36% cpu 26:32.46 total

-mp-






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Thu, 31 Dec 2020 14:00:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: mp <michal <at> panoch.net>
Cc: 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on
 Apple Silicon M1
Date: Thu, 31 Dec 2020 13:59:04 +0000
mp <michal <at> panoch.net> writes:

> Ok, so the problem persists, now it takes longer for emacs daemon to crash..
>
> Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0,
> VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES),
> port, 0, false, prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS),
> function backing_map, file
> /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c,
> line 192.
> Fatal error 6: Aborted
> [1]    6134 abort      emacs --fg-daemon
> emacs --fg-daemon  528.80s user 46.86s system 36% cpu 26:32.46 total
>
> -mp-

Hi mp,

is this after having merged from latest master as Alan suggested?

I suspect this might be not related to native compilation but to the NS
port.

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Sat, 02 Jan 2021 10:30:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 45515 <at> debbugs.gnu.org, mp <michal <at> panoch.net>
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on
 Apple Silicon M1
Date: Sat, 02 Jan 2021 10:29:20 +0000
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> mp <michal <at> panoch.net> writes:
>
>> Ok, so the problem persists, now it takes longer for emacs daemon to crash..
>>
>> Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0,
>> VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES),
>> port, 0, false, prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS),
>> function backing_map, file
>> /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c,
>> line 192.
>> Fatal error 6: Aborted
>> [1]    6134 abort      emacs --fg-daemon
>> emacs --fg-daemon  528.80s user 46.86s system 36% cpu 26:32.46 total
>>
>> -mp-
>
> Hi mp,
>
> is this after having merged from latest master as Alan suggested?
>
> I suspect this might be not related to native compilation but to the NS
> port.
>
> Thanks
>
>   Andrea

Hi Michal,

I've merged latest master into native-comp.  Do you still see this
issue on 5db5064395?

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Sat, 02 Jan 2021 10:30:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45515; Package emacs. (Sat, 02 Jan 2021 18:57:02 GMT) Full text and rfc822 format available.

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

From: mp <michal <at> panoch.net>
To: 45515 <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on Apple
 Silicon M1
Date: Sat, 2 Jan 2021 19:56:02 +0100
On 02.01.2021 11:29, Andrea Corallo wrote:

> Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>> mp <michal <at> panoch.net> writes:
>>
>>> Ok, so the problem persists, now it takes longer for emacs daemon to crash..
>>>
>>> Assertion failed: (mach_vm_map(mach_task_self(), &address, size, 0,
>>> VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES),
>>> port, 0, false, prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS),
>>> function backing_map, file
>>> /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-569.6/SkyLight/Services/Windows/CGSBackingStore.c,
>>> line 192.
>>> Fatal error 6: Aborted
>>> [1]    6134 abort      emacs --fg-daemon
>>> emacs --fg-daemon  528.80s user 46.86s system 36% cpu 26:32.46 total
>>>
>>> -mp-
>> Hi mp,
>>
>> is this after having merged from latest master as Alan suggested?
>>
>> I suspect this might be not related to native compilation but to the NS
>> port.
>>
>> Thanks
>>
>>    Andrea
> Hi Michal,
>
> I've merged latest master into native-comp.  Do you still see this
> issue on 5db5064395?
>
>    Andrea
>
Hi Andrea,

After merging the latest master, it looks good so far. It also appears 
to be running faster, but not as fast as a regular emacs (non 
native-comp) compiled for Apple architecture. Which runs about 10x faster!

Not sure if it is possible to compile the native-comp for Apple at this 
point..?

-mp-






Reply sent to Andrea Corallo <akrl <at> sdf.org>:
You have taken responsibility. (Sat, 02 Jan 2021 21:12:02 GMT) Full text and rfc822 format available.

Notification sent to michal panoch <michal <at> panoch.net>:
bug acknowledged by developer. (Sat, 02 Jan 2021 21:12:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: mp <michal <at> panoch.net>
Cc: 45515-done <at> debbugs.gnu.org
Subject: Re: bug#45515: 28.0.50; [feature/native-comp] emacsGcc crash on
 Apple Silicon M1
Date: Sat, 02 Jan 2021 21:11:16 +0000
mp <michal <at> panoch.net> writes:

>> Hi Michal,
>>
>> I've merged latest master into native-comp.  Do you still see this
>> issue on 5db5064395?
>>
>>    Andrea
>>
> Hi Andrea,
>
> After merging the latest master, it looks good so far.

Nice, I'm closing this for now, we can always reopen in case.

> It also appears to be running faster, but not as fast as a regular
> emacs (non native-comp) compiled for Apple architecture. Which runs
> about 10x faster!
>
> Not sure if it is possible to compile the native-comp for Apple at
> this point..?

I think we'll probably have to wait GCC 12.

  Andrea




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 31 Jan 2021 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 83 days ago.

Previous Next


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