emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [scratch/igc] 985247b6bee crash on Linux, KDE, Wayland


From: Eval EXEC
Subject: Re: [scratch/igc] 985247b6bee crash on Linux, KDE, Wayland
Date: Fri, 06 Sep 2024 00:32:59 +0800

Pip Cet <pipcet@protonmail.com> writes:

> "Eval EXEC" <execvy@gmail.com> writes:
>> Pip Cet <pipcet@protonmail.com> writes:
>>> "Eval EXEC" <execvy@gmail.com> writes:
>>>> Pip Cet <pipcet@protonmail.com> writes:
>>>>> "Eval EXEC" <execvy@gmail.com> 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=native on that machine to an explicit
>>> -march=... argument?
>>
>> My gcc version is : gcc (GCC) 13.2.0
>
> And that's a -march=raptorlake -mtune=raptorlake CPU, I think.  The
> closest I have is a version of GCC 13.3, and that generates what looks
> like working code with -march=raptorlake -mtune=raptorlake; 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  scratch/igc via ❄️   impure
>> ❯ 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 <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-unknown-linux-gnu".
>> 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 ../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  scratch/igc via ❄️   impure
❯ 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 <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-unknown-linux-gnu".
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/>.

--Type <RET> 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 <copy_font_spec.cold>
   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 <copy_font_spec.cold>
   0x0000000000679ed7 <+71>:    mov    0x22035a(%rip),%rax        # 0x89a238 
<current_thread>
   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 <alloc_impl>
   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 <copy_font_spec+240>
   0x0000000000679f63 <+211>:   jmp    0x67a064 <copy_font_spec+468>
   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 <copy_font_spec+468>
   0x0000000000679f80 <+240>:   mov    0x5(%rax),%rsi
--Type <RET> for more, q to quit, c to continue without paging--c
   0x0000000000679f84 <+244>:   lea    -0x3(%rax),%rbx
   0x0000000000679f88 <+248>:   cmpb   $0x0,0x733212(%rip)        # 0xdad1a1 
<globals+4513>
   0x0000000000679f8f <+255>:   mov    0x5(%rsi),%rax
   0x0000000000679f93 <+259>:   lea    -0x3(%rsi),%rdx
   0x0000000000679f97 <+263>:   mov    %rax,%rcx
   0x0000000000679f9a <+266>:   je     0x679fc0 <copy_font_spec+304>
   0x0000000000679f9c <+268>:   lea    -0x5(%rax),%edi
   0x0000000000679f9f <+271>:   and    $0x7,%edi
   0x0000000000679fa2 <+274>:   jne    0x679fc0 <copy_font_spec+304>
   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 <copy_font_spec+304>
   0x0000000000679fba <+298>:   mov    0xb(%rax),%rcx
   0x0000000000679fbe <+302>:   xchg   %ax,%ax
   0x0000000000679fc0 <+304>:   cmp    $0x14c8,%rcx
   0x0000000000679fc7 <+311>:   je     0x679f70 <copy_font_spec+224>
   0x0000000000679fc9 <+313>:   lea    -0x3(%rsi),%ecx
   0x0000000000679fcc <+316>:   and    $0x7,%ecx
   0x0000000000679fcf <+319>:   jne    0x67a080 <copy_font_spec+496>
   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        # 0x89a238 
<current_thread>
   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 <alloc_impl>
   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        # 0x89a238 
<current_thread>
   0x000000000067a029 <+409>:   mov    0x210(%rax),%rax
   0x000000000067a030 <+416>:   mov    0x20(%rax),%rdx
   0x000000000067a034 <+420>:   call   0x6f3e10 <alloc_impl>
   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 <copy_font_spec+240>
   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 <copy_font_spec+329>
   0x000000000067a089 <+505>:   jmp    0x42ef0f <copy_font_spec-2404225>
Address range 0x42ef02 to 0x42ef19:
   0x000000000042ef02 <-2404238>:       mov    %rbx,%rsi
   0x000000000042ef05 <-2404235>:       mov    $0xa4b8,%edi
   0x000000000042ef0a <-2404230>:       call   0x42c62f <wrong_type_argument>
   0x000000000042ef0f <-2404225>:       mov    $0xe658,%edi
   0x000000000042ef14 <-2404220>:       call   0x42c62f <wrong_type_argument>
End of assembler dump.
(gdb) disass Flist
Dump of assembler code for function Flist:
   0x000000000060faf0 <+0>:     test   %rdi,%rdi
   0x000000000060faf3 <+3>:     jle    0x60fb68 <Flist+120>
   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        # 0x89a238 
<current_thread>
   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 <alloc_impl>
   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 <Flist+32>
   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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]