From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eval EXEC Newsgroups: gmane.emacs.devel Subject: Re: [scratch/igc] 985247b6bee crash on Linux, KDE, Wayland Date: Fri, 06 Sep 2024 00:32:59 +0800 Message-ID: <87wmjqf4ck.fsf@gmail.com> References: <8734mezkgo.fsf@gmail.com> <87plpis6ff.fsf@protonmail.com> <87bk124aip.fsf@gmail.com> <87h6aus5yz.fsf@protonmail.com> <87tteu2vfq.fsf@gmail.com> <87a5gmrsrr.fsf@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6288"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 05 19:41:33 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1smGU9-0001Pr-17 for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Sep 2024 19:41:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smGTL-0004Vf-Ql; Thu, 05 Sep 2024 13:40:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smFPw-0007ZN-6x for emacs-devel@gnu.org; Thu, 05 Sep 2024 12:33:08 -0400 Original-Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smFPt-0001Zf-Ny for emacs-devel@gnu.org; Thu, 05 Sep 2024 12:33:07 -0400 Original-Received: by mail-pf1-x444.google.com with SMTP id d2e1a72fcca58-715cc93694fso905309b3a.2 for ; Thu, 05 Sep 2024 09:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725553982; x=1726158782; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=N0BMCbbFx0U/yxFouXumd5QcSmnciPTYTrmLLDc8og8=; b=IKE3mKmp2qPTvVvMBUibtIqnBmc7aynmmBd5H1JrOcNTqxo+mwR5FC4UJbsoP1AXbC nHQ3qvK/I7Hqvty2+ajIo5nSL3jtSz2kgzZwLfCtM9Z+TFOPVRJAEzzjTaEPHw5i46rv O0e6cJlf4JuzwYmR5jrMjKAwSlwOmeyRJs/5FGjTQUIxYIcfS62p9H9KzmBJxtsBlztC bjYqAjI25IeFKOg9i6S/egV+Ui00y8bGz1ok7uXR3qZw5OPHkpyTFsGheZFfzWR3U2Ap nhJiUf0TkbWwFn3dFEyjDl6DdMuH4dgVjDGNuM59Ds/n5zcA8Q8+tha0tUQtPQH2TNWh SrCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725553982; x=1726158782; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N0BMCbbFx0U/yxFouXumd5QcSmnciPTYTrmLLDc8og8=; b=c229YwNGPVNmjqFdfwhLyE6rNbzR2bJKs68YmHr//egZWtiyvJTk+q6mN9P86QWWJu LPRahJ0pAtabGMEXPjysiNbghYN5Yf+0LzgvnqTTq4Tt/uGnPxasbOw4aKR+2zPxcqj9 pIIvx7PXTc8ET67LPEAqSkC90OLIrAn+nt/Aky8NqT4t/ze0FEtOkbVUJMK/Uw6qpjoD kz6aLXtCGF8aSMYpB6g8BIM8DBdVCRKyToMpXpagbEMcyT9L/BOTHxp7Vh1bSJY1g5hF Y2D3t6ocp2HAV4FMyAiIr2x0/dDVs1GRrmPr/BliRSbGXi1PulhxZ2JirAC52lau+iy1 SYwQ== X-Gm-Message-State: AOJu0Yz6ztiTuXZh19xy+XznF1YLL2K2AOZeZUxBZtjQRzNrDIggzXnb Abij5Eo6kId9bNAXKFHZDS2451/gFhkpPAYrt6sVgk6i9+HQBwLtgp2kGzVuSWM= X-Google-Smtp-Source: AGHT+IEvJbt+md+smY0LmxfP+WH0IbxwDX+K9PizTynOmM2FETwK4jJEkQm4MzohyXDRbF/MV2/ExA== X-Received: by 2002:a05:6a00:23c3:b0:706:3329:5533 with SMTP id d2e1a72fcca58-7173c589cfcmr20161464b3a.24.1725553981859; Thu, 05 Sep 2024 09:33:01 -0700 (PDT) Original-Received: from localhost (144.34.182.14.16clouds.com. [144.34.182.14]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-717785b4db7sm3386411b3a.207.2024.09.05.09.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 09:33:01 -0700 (PDT) In-Reply-To: <87a5gmrsrr.fsf@protonmail.com> (Pip Cet's message of "Thu, 05 Sep 2024 16:04:42 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::444; envelope-from=execvy@gmail.com; helo=mail-pf1-x444.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 05 Sep 2024 13:40:39 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323421 Archived-At: Pip Cet writes: > "Eval EXEC" writes: >> Pip Cet writes: >>> "Eval EXEC" writes: >>>> Pip Cet writes: >>>>> "Eval EXEC" writes: >>>>> >>>> I'm useing CPU: 13th Gen Intel(R) Core(TM) i9-13900H (20) @ 5.40 GHz >>> >>> Thanks! Which gcc version are you using? Does anyone know how to >>> translate -march=3Dnative on that machine to an explicit >>> -march=3D... argument? >> >> My gcc version is : gcc (GCC) 13.2.0 > > And that's a -march=3Draptorlake -mtune=3Draptorlake CPU, I think. The > closest I have is a version of GCC 13.3, and that generates what looks > like working code with -march=3Draptorlake -mtune=3Draptorlake; it stores= an > interior pointer in %r15 while calling the allocation function, which is > stored in _setjmp and should be traced properly. > >>>>> I'd recommend these CFLAGS: >>>>> >>>>> -g3 -ggdb -fno-omit-frame-pointer >>>>> >>>>> in addition to what you have. >>>> >>>> Thank you, now I'm going to compile scratch/igc branch by these CFLAGS. >>>> >>>>> Can you disassemble 'copy_font_spec' and 'Flist' by running: >>>>> >>>>> $ gdb /path/to/emacs >>>>> (gdb) disass copy_font_spec >>>>> (gdb) disass Flist >>>> >>>> Sorry, I have deleted the core dump file and the emacs binary. >>> >>> Can you disassemble them in the new emacs binary, that you're building >>> now? I realize it's possible the code will be different due to the >>> different CFLAGS, but as the crash happened with -fno-omit-frame-pointer >>> there might be something else going on... >> >> emacs on =EE=82=A0 scratch/igc via =E2=9D=84=EF=B8=8F impure >> =E2=9D=AF gdb ../emacs-build/scratch_igc/bin/emacs >> GNU gdb (GDB) 14.2 >> Copyright (C) 2023 Free Software Foundation, Inc. >> License GPLv3+: GNU GPL version 3 or later >> 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-unknown-linux-gnu". >> Type "show configuration" for configuration details. >> For bug reporting instructions, please see: >> . >> Find the GDB manual and other documentation resources online at: >> . >> >> For help, type "help". >> Type "apropos word" to search for commands related to "word"... >> Reading symbols from ../emacs-build/scratch_igc/bin/emacs... >> (gdb) disass copy_font_spec >> Dump of assembler code for function copy_font_spec: >> Address range 0x626760 to 0x62695e: > [...] >> End of assembler dump. >> (gdb) > > Those look okay to me. > > That's with -O2, right? Can you try compiling with -O3 and > disassembling those functions to see what the other bug was? Yes, it's -O2. Now I compiled emacs by -O3, it's: ``` emacs on =EE=82=A0 scratch/igc via =E2=9D=84=EF=B8=8F impure =E2=9D=AF gdb ../emacs-build/scratch_igc-commit-985247b6/bin/emacs GNU gdb (GDB) 14.2 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-unknown-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . --Type for more, q to quit, c to continue without paging--c For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ../emacs-build/scratch_igc-commit-985247b6/bin/emacs... (gdb) disass copy_font_spec Dump of assembler code for function copy_font_spec: Address range 0x679e90 to 0x67a08e: 0x0000000000679e90 <+0>: push %rbp 0x0000000000679e91 <+1>: lea -0x5(%rdi),%eax 0x0000000000679e94 <+4>: mov %rsp,%rbp 0x0000000000679e97 <+7>: push %r15 0x0000000000679e99 <+9>: push %r14 0x0000000000679e9b <+11>: push %r13 0x0000000000679e9d <+13>: push %r12 0x0000000000679e9f <+15>: push %rbx 0x0000000000679ea0 <+16>: mov %rdi,%rbx 0x0000000000679ea3 <+19>: sub $0x18,%rsp 0x0000000000679ea7 <+23>: test $0x7,%al 0x0000000000679ea9 <+25>: jne 0x42ef02 0x0000000000679eaf <+31>: mov 0x3(%rdi),%rdx 0x0000000000679eb3 <+35>: lea -0x5(%rdi),%r13 0x0000000000679eb7 <+39>: movabs $0x400000003f000000,%r12 0x0000000000679ec1 <+49>: movabs $0x4000000025000000,%rax 0x0000000000679ecb <+59>: and %r12,%rdx 0x0000000000679ece <+62>: cmp %rax,%rdx 0x0000000000679ed1 <+65>: jne 0x42ef02 0x0000000000679ed7 <+71>: mov 0x22035a(%rip),%rax # 0x89a23= 8 0x0000000000679ede <+78>: mov $0x8,%esi 0x0000000000679ee3 <+83>: mov $0x78,%edi 0x0000000000679ee8 <+88>: mov 0x210(%rax),%rax 0x0000000000679eef <+95>: mov 0x20(%rax),%rdx 0x0000000000679ef3 <+99>: call 0x6f3e10 0x0000000000679ef8 <+104>: mov %rax,%r14 0x0000000000679efb <+107>: movabs $0x400000002500000d,%rax 0x0000000000679f05 <+117>: mov %rax,0x8(%r14) 0x0000000000679f09 <+121>: lea 0x70(%r14),%r15 0x0000000000679f0d <+125>: movq $0x0,0x70(%r14) 0x0000000000679f15 <+133>: movq $0x0,0x10(%r14) 0x0000000000679f1d <+141>: movdqu 0x13(%rbx),%xmm2 0x0000000000679f22 <+146>: movups %xmm2,0x18(%r14) 0x0000000000679f27 <+151>: movdqu 0x23(%rbx),%xmm3 0x0000000000679f2c <+156>: movups %xmm3,0x28(%r14) 0x0000000000679f31 <+161>: movdqu 0x33(%rbx),%xmm4 0x0000000000679f36 <+166>: movups %xmm4,0x38(%r14) 0x0000000000679f3b <+171>: movdqu 0x43(%rbx),%xmm5 0x0000000000679f40 <+176>: movups %xmm5,0x48(%r14) 0x0000000000679f45 <+181>: movdqu 0x53(%rbx),%xmm6 0x0000000000679f4a <+186>: movups %xmm6,0x58(%r14) 0x0000000000679f4f <+191>: mov 0x63(%rbx),%rdx 0x0000000000679f53 <+195>: mov %rdx,0x68(%r14) 0x0000000000679f57 <+199>: mov 0x70(%r13),%rax 0x0000000000679f5b <+203>: lea -0x3(%rax),%edx 0x0000000000679f5e <+206>: and $0x7,%edx 0x0000000000679f61 <+209>: je 0x679f80 0x0000000000679f63 <+211>: jmp 0x67a064 0x0000000000679f68 <+216>: nopl 0x0(%rax,%rax,1) 0x0000000000679f70 <+224>: mov 0x10(%rbx),%rax 0x0000000000679f74 <+228>: lea -0x3(%rax),%edx 0x0000000000679f77 <+231>: and $0x7,%edx 0x0000000000679f7a <+234>: jne 0x67a064 0x0000000000679f80 <+240>: mov 0x5(%rax),%rsi --Type for more, q to quit, c to continue without paging--c 0x0000000000679f84 <+244>: lea -0x3(%rax),%rbx 0x0000000000679f88 <+248>: cmpb $0x0,0x733212(%rip) # 0xdad1a= 1 0x0000000000679f8f <+255>: mov 0x5(%rsi),%rax 0x0000000000679f93 <+259>: lea -0x3(%rsi),%rdx 0x0000000000679f97 <+263>: mov %rax,%rcx 0x0000000000679f9a <+266>: je 0x679fc0 0x0000000000679f9c <+268>: lea -0x5(%rax),%edi 0x0000000000679f9f <+271>: and $0x7,%edi 0x0000000000679fa2 <+274>: jne 0x679fc0 0x0000000000679fa4 <+276>: movabs $0x4000000006000000,%r9 0x0000000000679fae <+286>: mov 0x3(%rax),%rdi 0x0000000000679fb2 <+290>: and %r12,%rdi 0x0000000000679fb5 <+293>: cmp %r9,%rdi 0x0000000000679fb8 <+296>: jne 0x679fc0 0x0000000000679fba <+298>: mov 0xb(%rax),%rcx 0x0000000000679fbe <+302>: xchg %ax,%ax 0x0000000000679fc0 <+304>: cmp $0x14c8,%rcx 0x0000000000679fc7 <+311>: je 0x679f70 0x0000000000679fc9 <+313>: lea -0x3(%rsi),%ecx 0x0000000000679fcc <+316>: and $0x7,%ecx 0x0000000000679fcf <+319>: jne 0x67a080 0x0000000000679fd5 <+325>: mov 0x10(%rdx),%rsi 0x0000000000679fd9 <+329>: movq %rax,%xmm0 0x0000000000679fde <+334>: movq %rsi,%xmm1 0x0000000000679fe3 <+339>: mov $0x18,%edi 0x0000000000679fe8 <+344>: mov 0x220249(%rip),%rax # 0x89a23= 8 0x0000000000679fef <+351>: punpcklqdq %xmm1,%xmm0 0x0000000000679ff3 <+355>: mov $0x3,%esi 0x0000000000679ff8 <+360>: mov 0x210(%rax),%rax 0x0000000000679fff <+367>: movaps %xmm0,-0x40(%rbp) 0x000000000067a003 <+371>: mov 0x20(%rax),%rdx 0x000000000067a007 <+375>: call 0x6f3e10 0x000000000067a00c <+380>: movdqa -0x40(%rbp),%xmm0 0x000000000067a011 <+385>: mov $0x3,%esi 0x000000000067a016 <+390>: mov $0x18,%edi 0x000000000067a01b <+395>: mov %rax,%r13 0x000000000067a01e <+398>: movups %xmm0,0x8(%rax) 0x000000000067a022 <+402>: mov 0x22020f(%rip),%rax # 0x89a23= 8 0x000000000067a029 <+409>: mov 0x210(%rax),%rax 0x000000000067a030 <+416>: mov 0x20(%rax),%rdx 0x000000000067a034 <+420>: call 0x6f3e10 0x000000000067a039 <+425>: lea 0x3(%r13),%rcx 0x000000000067a03d <+429>: lea 0x3(%rax),%rdx 0x000000000067a041 <+433>: mov %rcx,0x8(%rax) 0x000000000067a045 <+437>: movq $0x0,0x10(%rax) 0x000000000067a04d <+445>: mov %rdx,(%r15) 0x000000000067a050 <+448>: lea 0x10(%rax),%r15 0x000000000067a054 <+452>: mov 0x10(%rbx),%rax 0x000000000067a058 <+456>: lea -0x3(%rax),%edx 0x000000000067a05b <+459>: and $0x7,%edx 0x000000000067a05e <+462>: je 0x679f80 0x000000000067a064 <+468>: add $0x18,%rsp 0x000000000067a068 <+472>: lea 0x5(%r14),%rax 0x000000000067a06c <+476>: pop %rbx 0x000000000067a06d <+477>: pop %r12 0x000000000067a06f <+479>: pop %r13 0x000000000067a071 <+481>: pop %r14 0x000000000067a073 <+483>: pop %r15 0x000000000067a075 <+485>: pop %rbp 0x000000000067a076 <+486>: ret 0x000000000067a077 <+487>: nopw 0x0(%rax,%rax,1) 0x000000000067a080 <+496>: test %rsi,%rsi 0x000000000067a083 <+499>: je 0x679fd9 0x000000000067a089 <+505>: jmp 0x42ef0f Address range 0x42ef02 to 0x42ef19: 0x000000000042ef02 <-2404238>: mov %rbx,%rsi 0x000000000042ef05 <-2404235>: mov $0xa4b8,%edi 0x000000000042ef0a <-2404230>: call 0x42c62f 0x000000000042ef0f <-2404225>: mov $0xe658,%edi 0x000000000042ef14 <-2404220>: call 0x42c62f End of assembler dump. (gdb) disass Flist Dump of assembler code for function Flist: 0x000000000060faf0 <+0>: test %rdi,%rdi 0x000000000060faf3 <+3>: jle 0x60fb68 0x000000000060faf5 <+5>: push %rbp 0x000000000060faf6 <+6>: xor %eax,%eax 0x000000000060faf8 <+8>: mov %rsp,%rbp 0x000000000060fafb <+11>: push %r12 0x000000000060fafd <+13>: mov %rsi,%r12 0x000000000060fb00 <+16>: push %rbx 0x000000000060fb01 <+17>: mov %rdi,%rbx 0x000000000060fb04 <+20>: sub $0x10,%rsp 0x000000000060fb08 <+24>: nopl 0x0(%rax,%rax,1) 0x000000000060fb10 <+32>: movq %rax,%xmm1 0x000000000060fb15 <+37>: mov 0x28a71c(%rip),%rax # 0x89a23= 8 0x000000000060fb1c <+44>: sub $0x1,%rbx 0x000000000060fb20 <+48>: mov $0x3,%esi 0x000000000060fb25 <+53>: movq (%r12,%rbx,8),%xmm0 0x000000000060fb2b <+59>: mov $0x18,%edi 0x000000000060fb30 <+64>: mov 0x210(%rax),%rax 0x000000000060fb37 <+71>: punpcklqdq %xmm1,%xmm0 0x000000000060fb3b <+75>: mov 0x20(%rax),%rdx 0x000000000060fb3f <+79>: movaps %xmm0,-0x20(%rbp) 0x000000000060fb43 <+83>: call 0x6f3e10 0x000000000060fb48 <+88>: movdqa -0x20(%rbp),%xmm0 0x000000000060fb4d <+93>: add $0x3,%rax 0x000000000060fb51 <+97>: movups %xmm0,0x5(%rax) 0x000000000060fb55 <+101>: test %rbx,%rbx 0x000000000060fb58 <+104>: jne 0x60fb10 0x000000000060fb5a <+106>: add $0x10,%rsp 0x000000000060fb5e <+110>: pop %rbx 0x000000000060fb5f <+111>: pop %r12 0x000000000060fb61 <+113>: pop %rbp 0x000000000060fb62 <+114>: ret 0x000000000060fb63 <+115>: nopl 0x0(%rax,%rax,1) 0x000000000060fb68 <+120>: xor %eax,%eax 0x000000000060fb6a <+122>: ret End of assembler dump. (gdb) ``` Eval Exec