First of all, sorry to call malloc inside the signal handler :). I also understand that we should not do any laborious task / this kind of nasty stuff inside the signal handler.
But am I curious to know the reason why it crashed?
#0 0x00006e3ff2b60dce in _lll_lock_wait_private () from /lib64/libc.so.6 #1 0x00006e3ff2aec138 in _L_lock_9164 () from /lib64/libc.so.6 #2 0x00006e3ff2ae9a32 in malloc () from /lib64/libc.so.6 #3 0x00006e3ff1f691ad in ?? () from ..
I got a similar kernel specified at https://access.redhat.com/solutions/48701 .
Operating System: RHEL
malloc() , . . , malloc() . . man signal , .
malloc()
GDB, , malloc() , malloc() , .
.
Per POSIX:
, [replicated below], . . , POSIX.1-2008 , , , (, exit(), to main()) , undefined. , longjmp().
exit()
longjmp()
" " , " undefined".
Linux signal.7 man page:
signal.7
Async, - . POSIX " ". , , longjmp() siglongjmp(), , undefined.
Async
, - . POSIX " ". , , longjmp() siglongjmp(), , undefined.
Linux , Linux. POSIX - , . " " POSIX " " :
_Exit() _exit() abort() accept() access() aio_error() aio_return() aio_suspend() alarm() bind() cfgetispeed() cfgetospeed() cfsetispeed() cfsetospeed() chdir() chmod() chown() clock_gettime() close() connect() creat() dup() dup2() execl() execle() execv() execve() faccessat() fchdir() fchmod() fchmodat() fchown() fchownat() fcntl() fdatasync() fexecve() ffs() fork() fstat() fstatat() fsync() ftruncate() futimens() getegid() geteuid() getgid() getgroups() getpeername() getpgrp() getpid() getppid() getsockname() getsockopt() getuid() htonl() htons() kill() link() linkat() listen() longjmp() lseek() lstat() memccpy() memchr() memcmp() memcpy() memmove() memset() mkdir() mkdirat() mkfifo() mkfifoat() mknod() mknodat() ntohl() ntohs() open() openat() pause() pipe() poll() posix_trace_event() pselect() pthread_kill() pthread_self() pthread_sigmask() raise() read() readlink() readlinkat() recv() recvfrom() recvmsg() rename() renameat() rmdir() select() sem_post() send() sendmsg() sendto() setgid() setpgid() setsid() setsockopt() setuid() shutdown() sigaction() sigaddset() sigdelset() sigemptyset() sigfillset() sigismember() siglongjmp() signal() sigpause() sigpending() sigprocmask() sigqueue() sigset() sigsuspend() sleep() sockatmark() socket() socketpair() stat() stpcpy() stpncpy() strcat() strchr() strcmp() strcpy() strcspn() strlen() strncat() strncmp() strncpy() strnlen() strpbrk() strrchr() strspn() strstr() strtok_r() symlink() symlinkat() tcdrain() tcflow() tcflush() tcgetattr() tcgetpgrp() tcsendbreak() tcsetattr() tcsetpgrp() time() timer_getoverrun() timer_gettime() timer_settime() times() umask() uname() unlink() unlinkat() utime() utimensat() utimes() wait() waitpid() wcpcpy() wcpncpy() wcscat() wcschr() wcscmp() wcscpy() wcscspn() wcslen() wcsncat() wcsncmp() wcsncpy() wcsnlen() wcspbrk() wcsrchr() wcsspn() wcsstr() wcstok() wmemchr() wmemcmp() wmemcpy() wmemmove() wmemset() write()
malloc glibc. , . malloc 'd , , malloc. malloc , , . . , AS-safe.
malloc
OP. glibc (, malloc arenas printf) concurrency. , "lll_", , .
: 1) 2) glibc - . . printf, write. glibc malloc, syscall (sbrk...) - , , ... 3) ,
Source: https://habr.com/ru/post/1695899/More articles:How can I find out the source of this backcrace glibc created with clone ()? - cJava SAXParser - keep InputStream open - javaWrite to an XML file at the same time - javaRemove all application actions from each existing task in Activity Back Stack - androidsomatoChart in r (plot or ggplot) - rКак динамически создавать IQueryable из списка имен столбцов - c#https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1695901/using-clangs-feature-checking-macros-to-detect-existence-of-stdlaunder&usg=ALkJrhggxi2ehU5DEE4MpADXY9XwHH317wHow to combine only the first number in a string, and not the full one? - phpGlide FileNotFoundException: no content provider when loading images from the Internet - androidRemoving an element from an array in a loop in Java - javaAll Articles