Dobby icon indicating copy to clipboard operation
Dobby copied to clipboard

NearMemoryAllocator::allocateNearBlock always print error log

Open LinzerLee opened this issue 3 years ago • 1 comments

Environment: RedHat 7.5 (x64)

I am using the lastest commit. When I call DobbyHook function, it always faild and print error log.

[!] [/home/Dobby/source/MemoryAllocator/NearMemoryAllocator.cc:198:allocateNearBlock][near memory allocator] allocate near block failed (0x8, 0x400e10, 0x80000000)
[!] [/home/Dobby/source/TrampolineBridge/Trampoline/x64/trampoline_x64.cc:22:allocate_indirect_stub]Not found near forward stub

In NearMemoryAllocator::allocateNearBlockFromDefaultAllocator and NearMemoryAllocator::allocateNearBlockFromUnusedRegion and method

min_valid_addr = pos - search_range;  // if pos < search_range, and min_valid_addr will be a large value,this maybe a bug
max_valid_addr = pos + search_range;

Modify according to the following example, it run normal:

min_valid_addr = pos >= search_range ? (pos - search_range) : 0;

LinzerLee avatar Nov 22 '22 13:11 LinzerLee

Got the same issue. Following @LinzerLee 's example solved the problem

gxosty avatar Jun 20 '23 07:06 gxosty