Page_AllowAccess: сбой mprotect errno=12 при использовании Electric Fence (libefence)

Я получаю следующую ошибку от программы ac, скомпилированной с gcc и связанной с libefence:

  Electric Fence 2.2.2 Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com>
Page_AllowAccess: mprotect failed errno=12
Segmentation fault (core dumped)

Вот трассировка стека:

[theuser@pluto]$ gdb ~theuser/bin/theexec core.18422
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/theuser/bin/theexec...done.
[New LWP 18422]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/home/theuser/bin/theexec'.
Program terminated with signal 11, Segmentation fault.
#0  __tsearch (key=key@entry=0x7ffd54e37b78, vrootp=vrootp@entry=0x7ff0276e1fe8, compar=compar@entry=0x7ff022272a40 <known_compare>)
    at tsearch.c:285
285       q->red = 1;
Missing separate debuginfos, use: debuginfo-install libbsd-0.8.3-1.el7.x86_64
(gdb) bt
#0  __tsearch (key=key@entry=0x7ffd54e37b78, vrootp=vrootp@entry=0x7ff0276e1fe8, compar=compar@entry=0x7ff022272a40 <known_compare>)
    at tsearch.c:285
#1  0x00007ff022273680 in __GI___nss_lookup_function (ni=0x7ff0276e1fc0, fct_name=fct_name@entry=0x7ff0222e9829 "getpwuid_r") at nsswitch.c:416
#2  0x00007ff022273a9e in __GI___nss_lookup (ni=ni@entry=0x7ffd54e37c20, fct_name=fct_name@entry=0x7ff0222e9829 "getpwuid_r",
    fct2_name=fct2_name@entry=0x0, fctp=fctp@entry=0x7ffd54e37c30) at nsswitch.c:189
#3  0x00007ff022275280 in __GI___nss_passwd_lookup2 (ni=ni@entry=0x7ffd54e37c20, fct_name=fct_name@entry=0x7ff0222e9829 "getpwuid_r",
    fct2_name=fct2_name@entry=0x0, fctp=fctp@entry=0x7ffd54e37c30) at XXX-lookup.c:75
#4  0x00007ff022225a10 in __getpwuid_r (uid=uid@entry=1001, resbuf=resbuf@entry=0x7ff02252a260 <resbuf.9794>, buffer=0x7ff0276d7c00 "",
    buflen=1024, result=result@entry=0x7ffd54e37c80) at ../nss/getXXbyYY_r.c:270
#5  0x00007ff022225026 in getpwuid (uid=1001) at ../nss/getXXbyYY.c:134
#6  0x000000000042a114 in uiInit () at src/userinfo.c:34
#7  0x000000000042a1c5 in uiNameInit (UserName=0x0) at src/userinfo.c:60
#8  0x0000000000402e8b in main (argc=1, argv=0x7ffd54e37e48) at src/theexec.c:51
(gdb) quit

Я подозреваю, что дамп ядра является побочным эффектом сбоя mprotect и не является проблемой.

getpwuid() Страница man читает, что указатель на структуру, которую он возвращает, не должен передаваться free() показывая, что это не делает malloc(),

errno=12 для memprotect является NOMEM. Этот сбой происходит так рано во время выполнения, что он не может быть исчерпан из памяти.

0 ответов

Другие вопросы по тегам