Unix backtrace call detection
If the supposed return address is a pointer to the beginning of an executable page, and the page before is an oversized file mapping, like vvar before vdso, the backtrace would be terminated by SIGBUS. To avoid this, check not for readable, but for executable instead.
This commit is contained in:
@@ -236,8 +236,7 @@ static bool PointsToValidCall( const void *ptr )
|
||||
int len = 7;
|
||||
while( len )
|
||||
{
|
||||
int val = find_address( buf-len, g_ReadableBegin, g_ReadableEnd );
|
||||
if( val != -1 )
|
||||
if( IsExecutableAddress( buf - len ) )
|
||||
break;
|
||||
--len;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user