Motivation
I am trying to improve my understanding of SIGBUS Error in Xwayland . This is evidenced by some users of Fedora Linux from February 20, 2018 with Xwayland 1.19.6-5.fc27.x86_64and the Linux kernel 4.15.3-300.fc27.x86-64.
Unfortunately, I do not have the "segfault" log message (or the equivalent for SIGBUS). Xwayland has some kind of meaningless code that captures a fatal signal. But I see siginfoby debugging the coredump, and it seems almost as good.
Definition
I understand that the "main page error" occurs when a virtual memory page is not available in RAM and must be read from disk. I think I am interested in pages supported by the ext4 file system (for example, without direct access to block devices) for this question.
Therefore, a “minor page error” occurs when there is no need to access the disk. I guess the difference is pretty clear, since Linux provides counters for serious and minor page crashes.
My question
If the kernel sends a SIGBUS program, I wonder if I should expect this to be the main page error.
coredump , SIGBUS, . siginfo->si_addr , , . coredump . , coredump : - (.
" " (BUS_ADRALN), siginfo->si_code 2, BUS_ADRERR, " ". , x86, , - SSE.
, , , , "". , , , SIGBUS. , :
, , , . , , 8 ~ 100 /.
, Out Of Memory (OOM) , , .
, SIGBUS? - , ? ?
, , .
. , , SIGBUS . , . -. - . rpm --verify --all SMART . , , , . , , , , ; , . - ; , .
- , , copy-on-write MAP_PRIVATE .
- /dev/zero MAP_ANONYMOUS, , .
. , . ( , , ).
MAP_NONBLOCK ( Linux 2.5.46)
MAP_POPULATE. : , . Linux 2.6.23, MAP_POPULATE . , MAP_POPULATE MAP_NONBLOCK .
: ,
, . https://bugzilla.redhat.com/show_bug.cgi?id=1557682
, . .
$ gdb 2018-03-21.core
...
Core was generated by `/usr/bin/Xwayland :0 -rootless -terminate -core -listen 4 -listen 5 -displayfd'.
Program terminated with signal SIGBUS, Bus error.
#0 _dl_fixup (l=0x7fc0be2e0130, reloc_arg=203) at ../elf/dl-runtime.c:73
73 const ElfW(Sym) *sym = &symtab[ELFW(R_SYM) (reloc->r_info)];
[Current thread is 1 (Thread 0x7fc0be29fa80 (LWP 1918))]
(gdb) p $_siginfo.si_signum
$1 = 7
(gdb) p $_siginfo.si_code
$2 = 2
(gdb) p $_siginfo._sifields._sigfault.si_addr
$3 = (void *) 0x41bd80
(gdb) disassemble
Dump of assembler code for function _dl_fixup:
0x00007fc0be0c8bd0 <+0>: push %rbx
0x00007fc0be0c8bd1 <+1>: mov %rdi,%r10
0x00007fc0be0c8bd4 <+4>: mov %esi,%esi
0x00007fc0be0c8bd6 <+6>: lea (%rsi,%rsi,2),%rdx
0x00007fc0be0c8bda <+10>: sub $0x10,%rsp
0x00007fc0be0c8bde <+14>: mov 0x68(%rdi),%rax
0x00007fc0be0c8be2 <+18>: mov 0x8(%rax),%rdi
0x00007fc0be0c8be6 <+22>: mov 0xf8(%r10),%rax
0x00007fc0be0c8bed <+29>: mov 0x8(%rax),%rax
0x00007fc0be0c8bf1 <+33>: lea (%rax,%rdx,8),%r8
0x00007fc0be0c8bf5 <+37>: mov 0x70(%r10),%rax
=> 0x00007fc0be0c8bf9 <+41>: mov 0x8(%r8),%rcx
(gdb) p/x $r8
$4 = 0x41bd78
(gdb) p/x $r8 + 8
$5 = 0x41bd80
, reloc->r_info .
(gdb) p reloc
$6 = (const Elf64_Rela * const) 0x41bd78
(gdb) p &reloc->r_info
$7 = (Elf64_Xword *) 0x41bd80
(gdb) p *reloc
$8 = {r_offset = 8443504, r_info = 936302870535, r_addend = 0}
( maps , abrtd):
00400000-0060b000 r-xp 00000000 fd:00 1708508 /usr/bin/Xwayland
0080a000-0080d000 r--p 0020a000 fd:00 1708508 /usr/bin/Xwayland
0080d000-00817000 rw-p 0020d000 fd:00 1708508 /usr/bin/Xwayland
$ size -x /usr/bin/Xwayland
text data bss dec hex filename
0x209ffb 0xbe9d 0x1f3e0 2314872 235278 /usr/bin/Xwayland