Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Androidでこれら2つのセグメンテーション違反が見られます。1 つは SEGV_MAPERR と言い、もう 1 つは SEGV_ACCERR と言いました。
この2つの違いを教えてください。
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 41963214 signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 4006e000
ありがとう。
のようなメモリにアクセスする*((int*)0)=1と、 が得られSEGV_MAPERRます。
*((int*)0)=1
SEGV_MAPERR
mprotect(2)たとえば でメモリを保護した場合mprotect(buffer, pagesize, PROT_READ)、メモリを のよう*(buffer)=1に変更すると、 が得られSEGV_ACCERRます。
mprotect(2)
mprotect(buffer, pagesize, PROT_READ)
*(buffer)=1
SEGV_ACCERR
詳細をお願いman mprotectします。
man mprotect