Здравствуйте, kov_serg, Вы писали:
_>поставте бряк на catch syscall arch_prctl
| | прогнал |
| | gdb ./t
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./t...
(No debugging symbols found in ./t)
(gdb) catch syscall arch_prctl
Catchpoint 1 (syscall 'arch_prctl' [158])
(gdb) run
Starting program: t
This GDB supports auto-downloading debuginfo from the following URLs:
<https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Downloading separate debug info for system-supplied DSO at 0x7ffff7ffd000
Program received signal SIGSEGV, Segmentation fault.
0x00000000004ed0a0 in ?? ()
|
| | |
_>Заведите в своём коде static __thread int var = 0;
_>прогоните с strace
| | strace |
| | до ввода статической переменной
strace ./m
execve("./m", ["./m"], 0x7ffeb677f330 /* 78 vars */) = 0
mprotect(0x401000, 1536000, PROT_READ|PROT_EXEC) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x28} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)
после ввода статической переменной
strace ./t
execve("./t", ["./t"], 0x7ffd4e270b00 /* 78 vars */) = 0
mprotect(0x401000, 1536000, PROT_READ|PROT_EXEC) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x28} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)
|
| | |