-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can I dlsym malloc function? #112
Comments
Hello @CaffeMrDe, I am not sure how to address your problem. To debug further, did you check if this works correctly if you use directly Win32 APIs like Anyhow, I marked the issue as |
@CaffeMrDe Well, if I understand correctly, you are trying to wrap system malloc() function (more precisely malloc() from msvcrt.dl) via dlsym+RTLD_NEXT like on linux/ELF systems. The problem is that dlsym() implementation in dlfcn-win32 project internally uses malloc() function, so you are not able to resolve malloc symbol via dlsym+RTLD_NEXT. I do not think that on Windows it is possible to write RTLD_NEXT support without dynamic allocation. @traversaro |
Thanks @pali ! |
@CaffeMrDe As a simple "hack", you can replace malloc() in dlfcn-win32 project by some other dynamic allocator. For example by LocalAlloc() from WinAPI/kernel32.dll (and free() by LocalFree()). Then you should be able to wrap msvcrt.dll's malloc(), but you cannot wrap kernel32.dll's LocalAlloc(). |
Okay, I see what you mean! Thank you for your help! |
platform
window10
mingw 8.1.0 g++/gcc
result: stack frame recursion
How can I solve it? Thanks
The text was updated successfully, but these errors were encountered: